Ejemplo n.º 1
0
        public Bot(System.String api) : base(api)
        {
            DataBase db = Singleton.GetInstance().Context;

            _exitEvent = new AutoResetEvent(false);

            BotClient.OnMessage            += BotAnaliz;
            BotClient.OnCallbackQuery      += CallBack;
            BotClient.OnUpdate             += BotClient_OnUpdate;
            BotClient.OnInlineQuery        += BotClient_OnInlineQuery;
            BotClient.OnInlineResultChosen += BotClient_OnInlineResultChosen;
            BotClient.OnReceiveError       += BotClient_OnReceiveError;


            BotClient.StartReceiving();
            Console.WriteLine(BotClient.GetMeAsync().Result);

            var tempUsers = db.GetCalendarUsers();

            if (tempUsers != null)
            {
                users_calendar = GetCalendarUsers(tempUsers);
            }

            UpdateSystem.DeletePinnedMessages(BotClient);
        }