Esempio n. 1
0
        public void Cleanup()
        {
            ResponseQueue.Cleanup();

            if (TheClient.IsReceiving)
            {
                TheClient.StopReceiving();
            }

            RequestQueue.Cleanup();
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            //bot.loadSettings();

            bot.OnMessage += BotOnMessage;
            bot.SetWebhookAsync();

            var me = bot.GetMeAsync().Result;

            Console.Title = me.Username;
            bot.StartReceiving();
            Console.ReadLine();
            bot.StopReceiving();
        }
Esempio n. 3
0
        static void Main(string[] args)
        {
            // 透過SendTextMessageAsync來傳送訊息,傳入chanelid及要傳送的訊息
            //chanelId test
            Bot.SendTextMessageAsync(chanelId, "每5秒傳送一個訊息");
            Bot.SendTextMessageAsync(chanelId, "Mickey Mouse");

            var me = Bot.GetMeAsync().Result;

            Console.Title        = me.Username;
            Bot.OnMessage       += BotOnMessageEcho;
            Bot.OnMessageEdited += BotOnMessageEcho;

            /* Bot.OnCallbackQuery += BotOnCallbackQueryReceived;
             * Bot.OnReceiveError += BotOnReceiveError;*/
            Bot.StartReceiving(Array.Empty <UpdateType>());
            Console.WriteLine($"Start listening for @cutebaby0630_Bot");
            Console.ReadLine();
            Bot.StopReceiving();
        }
Esempio n. 4
0
 public Task DisconnectAsync()
 {
     _bot.StopReceiving();
     _active = false;
     return(Task.CompletedTask);
 }
Esempio n. 5
0
 public override void Stop()
 {
     Running = false;
     TClient.StopReceiving();
 }
Esempio n. 6
0
 /// <summary>
 /// Остановка бота.
 /// </summary>
 public void Stop()
 {
     botWorker.OnMessage -= BotLstner;
     botWorker.StopReceiving();
 }
Esempio n. 7
0
 public void Stop()
 {
     botik.StopReceiving();
 }