MainClass.cs 557 B

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