我正在使用node-telegram-bot-api模块,我如何使我的键盘内联键盘?这是我的密码:
bot.onText(/^\/start$/, function (msg) {
const opts = {
reply_to_message_id: msg.message_id,
reply_markup: {
resize_keyboard: true,
one_time_keyboard: true,
keyboard: [ ['Level 1'] ]
}
};
bot.sendMessage(msg.chat.id, "I'm a test robot", opts);
});发布于 2017-02-01 21:54:59
我回答了一个类似于这个链接的问题:How can create menu for telegram bot in bot father?
在您的情况下,您可以使用:
keyboard: [["uno :+1:"],["uno \ud83d\udc4d", "due"],["uno", "due","tre"],["uno", "due","tre","quattro"]]发布于 2020-04-06 19:05:58
就你的情况而言,解决办法是:
const opts = {
reply_to_message_id: msg.message_id,
reply_markup: JSON.stringify({
inline_keyboard:
[
[{text: 'Level 1'}],
]
})
};发布于 2020-12-05 15:13:56
您可以使用:https://github.com/RealPeha/telegram-keyboard
图书馆如果专注于Telegraf,但你可以不用它。
https://stackoverflow.com/questions/41977699
复制相似问题