我正在使用Node.js 电报-bot-api。
想法:
下面是我现在使用的代码:
bot.sendMessage({
text: 'Please give us your phone number',
reply_markup: JSON.stringify({
keyboard: [
[{
text: 'Share my phone number',
request_contact: true
}]
],
resize_keyboard: true,
one_time_keyboard: true
})
});问题:
request_contact标志时,one_time_keyboard工作正常(使用后隐藏按钮),但即使在这种情况下,它也只是隐藏按钮,因此用户可以单击一个图标将其带回屏幕,这一点都不好。如果我做错了什么,请告诉我。谢谢
发布于 2016-08-01 12:10:45
找到了。
以下是一个解决方案:
bot.sendMessage({
chat_id: message.chat.id,
text: 'Some text...',
reply_markup: JSON.stringify({
hide_keyboard: true
})
});发布于 2018-07-27 07:58:04
自hide_keyboard以来,remove_keyboard已被重命名为remove_keyboard。
bot.sendMessage({
chat_id: message.chat.id,
text: 'Some text...',
reply_markup: JSON.stringify({
remove_keyboard: true
})
});发布于 2016-08-01 11:24:12
您应该使用editMessageReplyMarkup,并在客户端用户单击收到后用空字符串('')更新消息的replyMarkup。
更新这适用于内联键盘。
https://stackoverflow.com/questions/38696771
复制相似问题