예제 #1
0
파일: Main.cs 프로젝트: devast8a/StreamBot
        public static void Main(string[] args)
        {
            // Configure log4net from app.config
            XmlConfigurator.Configure();

            var settings = new SettingsFile("Settings.xml");
            _settingsTimer = new Timer(SaveSettings, settings, SaveInterval, SaveInterval);

            Console.WriteLine("Press Shift+Q to quit.");

            foreach (var instance in settings.Instances)
            {
                var bot = new Bot(instance);
                ThreadPool.QueueUserWorkItem(a => bot.Connect());
            }

            while(true)
            {
                var key = Console.ReadKey(true);

                if(key.Modifiers.HasFlag(ConsoleModifiers.Shift) && key.Key == ConsoleKey.Q)
                {
                    break;
                }
            }

            settings.Save();
        }
예제 #2
0
        public StreamHandler(Bot bot)
        {
            _bot = bot;
            _streams = new List<Stream>();

            _streamPlugins = new IStreamPlugin[]
            {
                new Livestream(),
                new Owned(),
                new Twitch()
            };
        }