如何删除回复键盘而不在 Telegram 中发送消息? [英] How do you remove reply keyboard without sending a message in Telegram?

查看:43
本文介绍了如何删除回复键盘而不在 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.

推荐答案

您可以使用 编辑消息editMessageTexteditMessageReplyMarkup 并且根本不传递 reply_markup 让它消失.

You could edit the message using editMessageText or editMessageReplyMarkup and simply not pass a reply_markup to make it disappear.

这篇关于如何删除回复键盘而不在 Telegram 中发送消息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆