Answer the question
In order to leave comments, you need to log in
How to add a keyboard from an array?
How to add all buttons from a certain array to the keyboard?
Not working code:
bot.onText(/\/start/i, async msg => {
const user = users.filter(x => x.id === msg.from.id)[0]
const buttons = ["Продолжить", "Назад"]
const keyboard = {
reply_keyboard: {
keyboard: [
buttons
]
}
}
bot.sendMessage(user.id, `Привет, ${user.first_name}!`, keyboard)
})
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