public CommandHandler(InitializeCommandHandler init)
        {
            if (init == null)
            {
                throw new ArgumentNullException();
            }

            Client   = init.Client;
            Commands = init.Commands;
            Services = init.Services;
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            Bot            bot            = new Bot();
            Preferences    preferences    = new Preferences(new SqliteStorage());
            ScraperManager scraperManager = new ScraperManager(bot);

            InitializeScrapers(scraperManager, preferences);

            InitializeCommandHandler init = new InitializeCommandHandler(scraperManager, bot, preferences);
            Task botTask = bot.StartAsync(init);

            Task scrapeTask = scraperManager.StartScraping();

            // Wait indefinitely for the bot to finish.
            botTask.Wait(-1);
            scrapeTask.Wait(-1);
        }