M
M
madhowrad2021-12-22 00:20:54
MySQL
madhowrad, 2021-12-22 00:20:54

How to take names from the database and make buttons?

How to take a lot of text from the database and make a lot of buttons out of it in a telegram bot?
here is the code:

if(text == "/start"){
        connection.query("SELECT * FROM `links`", function(err, results){
            bot.sendMessage(chatId, `Привет`, {reply_markup: {resize_keyboard:true, keyboard: }})
        });
    }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
kapp1, 2021-12-22
@kapp1

Loop through the result, add objects to an array type variable and pass this variable to an array of buttons.
Checked, works)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question