Exemple #1
0
        private static async Task AttachGoogleSheetsServiceAsync(IBot bot)
        {
            var config = ConfigManager <SheetsConfig> .Instance;

            var service = new GoogleSheetsUpdaterService(config);

            service.Update += updaterService =>
            {
                Logger.Debug($"Sheets Updated @ {service.LastUpdate}");
                return(Task.CompletedTask);
            };

            await bot.AttachAsync(service).ConfigureAwait(false);
        }
Exemple #2
0
        public virtual async Task AttachToAsync(IBot bot)
        {
            if (!bot.ContainsService(this))
            {
                await bot.AttachAsync(this).ConfigureAwait(false);

                return;
            }

            Bot        = bot;
            IsAttached = true;

            await StartAsync( ).ConfigureAwait(false);
        }
Exemple #3
0
 private static async Task AttachConsoleServiceAsync(IBot bot)
 {
     await bot.AttachAsync(new ConsolePrintService( )).ConfigureAwait(false);
 }
Exemple #4
0
 private static async Task AttachTelegramServiceAsync(IBot bot)
 {
     var teleService = new TelegramBotService(ConfigManager <TelegramBotConfig> .Instance);
     await bot.AttachAsync(teleService).ConfigureAwait(false);
 }