Skip to content

Instantly share code, notes, and snippets.

@donma
Last active March 7, 2025 09:03
Show Gist options
  • Save donma/3776bcdcb330f763a34182a36583fbfc to your computer and use it in GitHub Desktop.
Save donma/3776bcdcb330f763a34182a36583fbfc to your computer and use it in GitHub Desktop.
private static Task _TelegramBotClient_OnUpdate(Telegram.Bot.Types.Update update)
{
if (update.CallbackQuery != null)
{
Console.WriteLine(update.CallbackQuery.From.Id + ":" + update.CallbackQuery.Data);
var sentMessage = _TelegramBotClient.SendMessage(
//該用戶或是群組的 Id
chatId: update.CallbackQuery.From.Id,
text: "收回應訊息 :" + update.CallbackQuery.Data,
cancellationToken: cts.Token);
//刪除原本的問句
return _TelegramBotClient.DeleteMessage(update.CallbackQuery.Message.Chat.Id, update.CallbackQuery.Message.Id);
}
return Task.FromResult<object>(null);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment