如何从Telebot键盘上删除按钮?

发布于 2025-01-25 17:53:39 字数 89 浏览 6 评论 0原文

我需要从ReplyKeyboardmarkup中删除按钮。我在Google中搜索很好。 使用了Telebot库(Pytelegrambotapi)。 先感谢您 :)

I need to remove the button from ReplyKeyboardMarkup. I search in Google very well.
The telebot library(PyTelegramBotAPI) is used.
Thank you in advance :)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

恰似旧人归 2025-02-01 17:53:39

使用telebot.types.replykeyboardremove删除键盘

from telebot.types import ReplyKeyboardRemove()
  
@bot.message_handler(func=lambda message:True)
def all_messages(message):
    if message.text:
        
        bot.send_message(message.from_user.id,"Done with Keyboard",reply_markup=ReplyKeyboardRemove())

bot.infinity_pooling()

Use telebot.types.ReplyKeyboardRemove to remove keyboard

from telebot.types import ReplyKeyboardRemove()
  
@bot.message_handler(func=lambda message:True)
def all_messages(message):
    if message.text:
        
        bot.send_message(message.from_user.id,"Done with Keyboard",reply_markup=ReplyKeyboardRemove())

bot.infinity_pooling()
呆橘 2025-02-01 17:53:39

您应该使用

You should use edit_message_reply_markup method to send a new set of buttons.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文