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); }
public override Chat GetChatById(ChatItemId id) { return(FromTelegramChat(TClient.GetChatAsync((long)id.Ids[GetClientId()]).Result)); }