public static IHostBuilder ConfigureTelegram(this IHostBuilder hostBuilder) { return(hostBuilder.ConfigureServices((_, collection) => { collection.AddSingleton <ITelegramBotClient>(_ => new TelegramBotClient(EnvironmentVars.GetTelegramToken())); })); }