I am writing a telegram-bot-questionnaire. There was a problem with the keyboard, namely with one button. And the text of the button after clicking on it, for some reason I send to the chat. How to make a bot send a message immediately after pressing a button? Please tell me how to solve this problem?
if (text === '/start') {
await bot.sendMessage(msg.chat.id, 'message 1')
await bot.sendMessage(msg.chat.id, 'message 2', {
reply_markup: {
keyboard: [
[{
text: 'event 1'
}]
]
}
})
if ('event 1') {
await bot.sendMessage(msg.chat.id, "message 3")
await bot.sendMessage(msg.chat.id, "message 4", {
reply_markup: {
keyboard: [
[{
text: 'event 2'
}]
]
}
})
}
}