M
M
madhowrad2021-12-20 21:59:39
Node.js
madhowrad, 2021-12-20 21:59:39

How to draw data from the database in bot.edit?

How to draw data from the database in bot.edit?
Here is the code:

if(action == "find"){
        connection.query("SELECT * FROM `links`", async function(err, results){
            if(results != 0){
                for(let i in results){
                    if(results[i]['href'] != 0){
                        await bot.getChatMember(`${results[i]['href']}`, chatId).then(async member => {
                            if(member.status == 'left'){
                                let board = {reply_markup: {inline_keyboard: }};
                                await bot.editMessageText("Чтобы искать фильмы по номерам\nподпишитесь на эти каналы:  ",opts);
                                await bot.editMessageReplyMarkup({inline_keyboard: }, opts);
                            } 
                        });
                    }
                }
            }
        });
    }

but it takes only 1 line from the database and puts it into the buttons, how to do it in order to enter data from the database into the
node-telegram-bot-api keyboard

Answer the question

In order to leave comments, you need to log in

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

You need to fit a lot of buttons in one message, and you change the same button many times, and send the last version.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question