MainClass.cs 490 B

123456789101112131415161718
  1. using System;
  2. using System.Threading;
  3. using Telegram.Bot;
  4. using Telegram.Bot.Extensions.Polling;
  5. namespace MafiaTelegramBot
  6. {
  7. public static class MainClass
  8. {
  9. public static void Main()
  10. {
  11. var cts = new CancellationTokenSource();
  12. Bot.Get().StartReceiving(new DefaultUpdateHandler(MessageController.HandleUpdateAsync, MessageController.HandleErrorAsync), cts.Token);
  13. Console.ReadLine();
  14. cts.Cancel();
  15. }
  16. }
  17. }