Telegram bot inline keyboard via Node.JS

喜你入骨 提交于 2019-12-12 10:19:45

问题


I'm using the node-telegram-bot-api module, How can I make my keyboard to inline Keyboard? This is my code:

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);
});

回答1:


I answered a question similar to this link: How can create menu for telegram bot in bot father?

in your case you could use:

keyboard: [["uno :+1:"],["uno \ud83d\udc4d", "due"],["uno", "due","tre"],["uno", "due","tre","quattro"]]


来源:https://stackoverflow.com/questions/41977699/telegram-bot-inline-keyboard-via-node-js

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!