mast / telegram-bot-api

First Telegram Bot API node.js library
http://mast.github.io/telegram-bot-api/
MIT License
245 stars 65 forks source link

Q: Did you manage to send custom keyboard? #1

Closed BatuhanK closed 9 years ago

BatuhanK commented 9 years ago

Hello, I tried almost 40 times to send custom keyboard layout, but it didn't worked. Apperantly I'm doing something wrong, did you try to send custom keyboard layout?

mast commented 9 years ago

Hi,

Yes, it works fine for me. You need to have Telegram app updated with this feature support. Just make sure you have latest version from AppStore. And then the code is:

var keyboard = {
        keyboard: [
                ['Answer 1', 'Answer 2']
        ]
};

api.sendMessage({
        chat_id: <your chat id>
        text: 'Hello from brain with answers',
        reply_markup: JSON.stringify(keyboard)
}, function(err, data)
{
        console.log(util.inspect(data, false, null));
});
BatuhanK commented 9 years ago

@mast Thank you, I was doing the same but my Telegram app is not updated.