Answer the question
In order to leave comments, you need to log in
How to get response from inline_keyboard(callback_data) nodejs?
I wrote a bot with a regular keyboard, everything worked fine, then I thought to update it and make the inline keyboard look prettier, but in the end I don’t understand how to access the callback_data value so that I could do something like this
else if (callback_data === '1'){
bot.sendMessage(query.message.chat.id , Добро пожаловать)
}
else if (msg.text === '☘Трава☘'
){
bot.sendMessage(chatId, 'Укажите свой город',{
reply_markup:{
inline_keyboard: [
[
{
text: 'Днепр',
callback_data: '1'
}
],
[
{
text: 'Харьков',
callback_data: '1'
}
],
[
{
text: 'Киев',
callback_data: '1'
}
],
[
{
text: 'Одесса',
callback_data: '1'
}
]
]
}
})
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question