public async void UpdateMessage(string chatId, int messageId, string text, string parse_mode = "html") { var body = new UpdateMessageBody() { chat_id = chatId, message_id = messageId, text = text, parse_mode = parse_mode }; var url = "https://api.telegram.org/bot" + _settings.botToken + "/editMessageText"; var json = JsonConvert.SerializeObject(body); var content = new StringContent(json, Encoding.UTF8, "application/json"); var res = await _client.PostAsync(url, content); }
public async void LeaveChat(string chatId) { var body = new UpdateMessageBody() { chat_id = chatId }; var url = "https://api.telegram.org/bot" + _settings.botToken + "/leaveChat"; var json = JsonConvert.SerializeObject(body); var content = new StringContent(json, Encoding.UTF8, "application/json"); var res = await _client.PostAsync(url, content); }