聊天字段上的电报机器人键盘
telegram bot keyboard on chat field
我想单击一个按钮并在聊天字段中而不是直接在聊天屏幕上显示文本?
例如:
- 键盘上有一些按键[1][2][3]
- 当我按下 [1] 按钮时,
1
会显示在聊天字段中,而不是聊天屏幕上
- 当我点击 [3][2][1] 时,聊天栏会显示
321
- 当我按下
<enter>
时 321
会显示在屏幕上。
问题
这在电报机器人上可行吗?
bot.on('ask.no', msg => {
let markup = bot.keyboard([
['9', '8','7','*'],
['6', '5','4','/'],
['3', '2','1','+'],
['.', '0','=','-'],
], { resize: true });
return bot.sendMessage(msg.from.id, 'please input key or number', { markup});
正如官方 documentation 所说:
Tapping any of the buttons will immediately send the respective command.
没有。您不能延迟在聊天屏幕上显示按钮值。
我想单击一个按钮并在聊天字段中而不是直接在聊天屏幕上显示文本?
例如:
- 键盘上有一些按键[1][2][3]
- 当我按下 [1] 按钮时,
1
会显示在聊天字段中,而不是聊天屏幕上 - 当我点击 [3][2][1] 时,聊天栏会显示
321
- 当我按下
<enter>
时321
会显示在屏幕上。
问题
这在电报机器人上可行吗?
bot.on('ask.no', msg => {
let markup = bot.keyboard([
['9', '8','7','*'],
['6', '5','4','/'],
['3', '2','1','+'],
['.', '0','=','-'],
], { resize: true });
return bot.sendMessage(msg.from.id, 'please input key or number', { markup});
正如官方 documentation 所说:
Tapping any of the buttons will immediately send the respective command.
没有。您不能延迟在聊天屏幕上显示按钮值。