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); }
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); }
private static async Task AttachConsoleServiceAsync(IBot bot) { await bot.AttachAsync(new ConsolePrintService( )).ConfigureAwait(false); }
private static async Task AttachTelegramServiceAsync(IBot bot) { var teleService = new TelegramBotService(ConfigManager <TelegramBotConfig> .Instance); await bot.AttachAsync(teleService).ConfigureAwait(false); }