Esempio n. 1
0
        public ServerAnswer(IBot bot, ExchangeRate exchangeRate) : base(bot)
        {
            parsingDriver = new ParsingDriver(exchangeRate);

            bot.telegramBotClient.OnMessage += (object?sender, Telegram.Bot.Args.MessageEventArgs e) =>
            {
                var msg = $"{DateTime.Now.ToShortTimeString()}: {e.Message.Chat.FirstName} {e.Message.Chat.Id} {e.Message.Text}";
                Logging.LogToConsole(msg);
                CheckProductAndSendMessage(e);
            };
            bot.telegramBotClient.StartReceiving();
        }
Esempio n. 2
0
 public ServerScaner(IBot bot, ExchangeRate exchangeRate) : base(bot)
 {
     parsingDriver = new ParsingDriver(exchangeRate);
 }