Example #1
0
        public TelegramConnector()
        {
            botClient = new Telegram.Bot.TelegramBotClient("524727579:AAHZaFNr3S1vUfuPy-wZEIGO3-WxQWodL5s");
            var me = botClient.GetMeAsync();

            Console.WriteLine("Api for bot: " + me.Result.FirstName + " - was connected");
            Console.WriteLine("Connected to: " + botClient.GetChatAsync(chatId).Result.Title + "chat");

            botClient.OnMessage += onMessage;


            botClient.StartReceiving(Array.Empty <UpdateType>());
            Thread.Sleep(2000);
        }
Example #2
0
 public override Chat GetChatById(ChatItemId id)
 {
     return(FromTelegramChat(TClient.GetChatAsync((long)id.Ids[GetClientId()]).Result));
 }