From f5170c573c2a464061c670925df5ac9d8f98eed2 Mon Sep 17 00:00:00 2001 From: yago Date: Tue, 7 Jul 2015 23:15:58 +0200 Subject: [PATCH] Example of reply_markup --- examples/polling.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/examples/polling.js b/examples/polling.js index 6b40ad5..3ce3bdb 100644 --- a/examples/polling.js +++ b/examples/polling.js @@ -29,8 +29,15 @@ bot.on('message', function (msg) { bot.forwardMessage(chatId, chatId, messageId); }); } - if (msg.text == '/help') { - var opts = {reply_to_message_id: msg.message_id}; - bot.sendMessage(chatId, 'This is only a test :D', opts); + if (msg.text == '/love') { + var opts = { + reply_to_message_id: msg.message_id, + reply_markup: JSON.stringify({ + keyboard: [ + ['Yes, you are the bot of my life ❤'], + ['No, sorry there is another one...']] + }) + }; + bot.sendMessage(chatId, 'Do you love me?', opts); } });