“中间件中的 GrammyError”错误:编辑时出现 404,据说是因为未进行任何编辑。直接从 Telegram bot API 文档中编写代码

问题描述 投票:0回答:1

我正在尝试在电报上制作一个聊天内交互式菜单,第一件事就是查看文档。我正在运行 此代码(链接在 机器人 API 文档的第一页,并且不接受问题提交);每次我单击“下一步”按钮时,它都会挂起并控制台记录:

GrammyError in middleware: Call to 'editMessageText' failed! (400: Bad Request: message is not modified: specified new message content and reply markup are exactly the same as a current content and reply markup of the message)

更改

/menu
命令的源菜单,并提供
secondMenu
+
secondMenuMarkup
,可以单击返回,并且将消息编辑到“firstMenu”。

telegram grammy
1个回答
0
投票

更改此行:

const firstMenuMarkup = new InlineKeyboard().text(nextButton, backButton);

对此:

const firstMenuMarkup = new InlineKeyboard().text(nextButton, nextButton);

解决了问题。

© www.soinside.com 2019 - 2024. All rights reserved.