public TelegramController( IUpdateParser updateParser, IOptionsSnapshot <TelegramConfiguration> options, ILogger <TelegramController> logger) { this.updateParser = updateParser; this.options = options; this.logger = logger; }
/// <summary> /// Initializes a new Bot Manager /// </summary> /// <param name="bot">Bot to be managed</param> /// <param name="updateParser">List of update parsers for the bot</param> /// <param name="botOptions">Options used to configure the bot</param> public BotManager(TBot bot, IUpdateParser <TBot> updateParser, IOptions <BotOptions <TBot> > botOptions) { _bot = bot; _updateParser = updateParser; _botOptions = botOptions.Value; if (_botOptions.WebhookUrl != null) { WebhookUrl = ReplaceUrlTokens(_botOptions.WebhookUrl); } }
/// <summary> /// Initializes a new Bot Manager /// </summary> /// <param name="bot">Bot to be managed</param> /// <param name="updateParser">List of update parsers for the bot</param> /// <param name="botOptions">Options used to configure the bot</param> /// <param name="logger"></param> public BotManager(TBot bot, IUpdateParser <TBot> updateParser, IOptions <BotOptions <TBot> > botOptions, ILogger <BotManager <TBot> > logger = null) { _bot = bot; _updateParser = updateParser; this.logger = logger; _botOptions = botOptions.Value; if (_botOptions.WebhookUrl != null) { WebhookUrl = ReplaceUrlTokens(_botOptions.WebhookUrl); } logger?.LogInformation("Bot logging started"); }