Ejemplo n.º 1
0
 public BotSession(ITelegramBotClient client, IBotRouter router, ILogger logger, string token)
 {
     Bot    = client;
     Logger = logger;
     Router = router;
     Token  = token;
     Clear();
     BotInfo = client.GetMeAsync().Result;
 }
Ejemplo n.º 2
0
        public BotListener(string token, ILogger logger, IBotRouter router, Func <IBotControllerFactory> factoryCreator)
        {
            _logger         = logger;
            _router         = router;
            _factoryCreator = factoryCreator;

            Token                      = token;
            Bot                        = new TelegramBotClient(token);
            BotInfo                    = Bot.GetMeAsync().Result;
            Bot.OnReceiveError        += Bot_OnReceiveError;
            Bot.OnReceiveGeneralError += Bot_OnReceiveGeneralError;
            Bot.OnUpdate              += _bot_OnUpdate;
        }