D
D
Dvorak2016-08-22 22:37:15
Node.js
Dvorak, 2016-08-22 22:37:15

How to track the button click event in the telegram bot?

Hello. I am writing a Node.js bot for telegram. With the help of the following code, I made such a button:

const opt = {
   parse_mode: 'markdown',
   disable_web_page_preview: false,
   reply_markup: JSON.stringify({
       keyboard: ,
       resize_keyboard: true
   })
};

app.sendMessage(id, 'text', opt)

16ab32b6873344e7b3bb2e673e7b8585.jpg
Here are the questions:
1) how do I track the click on this button?
2) now when you click on the button, the text of the button is immediately sent to the bot. How to undo it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
hoarywolf, 2016-08-22
@allishappy

send location
catch

bot.on('message', function (msg) {
        console.log(msg); /*тут увидите геокоординаты */
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question