如何删除回复键盘而不在 Telegram 中发送消息? [英] How do you remove reply keyboard without sending a message in Telegram?
问题描述
在 Telegram bot 中,您可以使用 回复键盘 发送消息,使用 <一个 href="https://core.telegram.org/bots/api#sendmessage" rel="nofollow noreferrer">sendMessage 方法.
In Telegram bot you can send a message with the reply keyboard using the sendMessage method.
显示键盘而不是正常的 qwerty.
The keyboard is getting displayed instead of normal qwerty one.
我们可以通过发送另一条消息并传递 ReplyKeyboardRemove 对象来移除显示的键盘用它.但是,这需要发送一些无关的消息.
We can remove the displayed keyboard by sending another message and by passing ReplyKeyboardRemove object with it. However, this requires some extraneous message to be sent.
是否可以在不实际发送任何真实消息的情况下移除键盘?
Is it possible to remove the keyboard without actually sending any real message?
我知道 one_time_keyboard
选项,但它只会隐藏键盘而不会移除它.
I'm aware of one_time_keyboard
option, but it will only hide the keyboard without removing it.
推荐答案
您可以使用 编辑消息editMessageText 或 editMessageReplyMarkup 并且根本不传递 reply_markup
让它消失.
You could edit the message using editMessageText or editMessageReplyMarkup and simply not pass a reply_markup
to make it disappear.
这篇关于如何删除回复键盘而不在 Telegram 中发送消息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!