public ChatMessagesController(
     IBotSettingsProvider botSettingsProvider,
     IMessagesProcessor messagesProcessor)
 {
     client = new TelegramBotClient(botSettingsProvider.Token);
     this.messagesProcessor = messagesProcessor;
 }
Beispiel #2
0
        public BotClient(
            IMessagesProcessor messagesProcessor,
            IBotSettingsProvider botSettingsProvider,
            IProxySettingsProvider proxySettingsProvider)
        {
            this.messagesProcessor     = messagesProcessor;
            this.proxySettingsProvider = proxySettingsProvider;

            client = new TelegramBotClient(
                botSettingsProvider.Token,
                CreateClient()
                );

            client.OnMessage      += ClientOnMessageReceived;
            client.OnReceiveError += ClientOnReceiveError;
        }
Beispiel #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BotMentionMessageFilter"/> class.
 /// </summary>
 /// <param name="settingProvider">Bot settings provider.</param>
 public BotMentionMessageFilter(IBotSettingsProvider settingProvider)
 {
     _settingProvider = settingProvider;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="TelegramBotClientFactory"/> class.
 /// </summary>
 /// <param name="settingsProvider">Telegram bot settings provider.</param>
 public TelegramBotClientFactory(IBotSettingsProvider settingsProvider)
 {
     _settingsProvider = settingsProvider;
 }