Ejemplo n.º 1
0
 public IRCClient(string channel, string user, string oauth, SpiffCore twitch)
 {
     _channel = channel;
     _user    = user;
     _oauth   = oauth;
     _twitch  = twitch;
 }
Ejemplo n.º 2
0
 public IRCClient(string channel, string user, string oauth, SpiffCore twitch)
 {
     _channel = channel;
     _user = user;
     _oauth = oauth;
     _twitch = twitch;
 }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            if (!Directory.Exists("Plugins"))
            {
                Directory.CreateDirectory("Plugins");
            }

            if (!File.Exists("Config.ini"))
            {
                ConfigFile.SetValue("auth", "Username", "ToyzBot");
                ConfigFile.SetValue("auth", "oauth", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
                ConfigFile.SetValue("channel", "channel", "thetoyz");
                ConfigFile.SetValue("adv", "debug", false);
                ConfigFile.Flush();

                Logger.Info("...SpiffBot...", "SpiffBot");
                Logger.Error("Please Edit Config.ini with your settings...", "SpiffBot");

                Console.ReadKey();
                Environment.Exit(0);
            }

            string pluginPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Plugins");

            Logger.Info("Please Wait... Spiffbot is loading...", "SpiffBot");
            _server = new SpiffCore(ConfigFile.GetValue("channel", "channel", "thetoyz"), ConfigFile.GetValue("auth", "Username", "ToyzBot"), ConfigFile.GetValue("auth", "oauth", "oauth"), pluginPath);

            Logger.Info("Loading all plugins", "SpiffBot");
            SpiffCore.Instance.PluginLoader.LoadPlugins();
            SpiffCore.Instance.PluginLoader.StartPlugins();
            Logger.Info("Plugins have been loaded", "SpiffBot");
            _server.IrcClient.OnTwitchDataDebugOut += IrcClientOnOnTwitchDataDebugOut;
            _server.IrcClient.Start();

            new Thread(TitleUpdater).Start();
            Logger.Info("Spiffbot has started and conntected to twitch", "SpiffBot");

            Console.CancelKeyPress += ConsoleOnCancelKeyPress;
        }