N
N
null_null_null2020-11-02 18:03:48
Node.js
null_null_null, 2020-11-02 18:03:48

( telegram bot api ) How to attach an image to buttons?

Greetings.
I got a telegram autosales bot script on node.js (Which I don’t know at all)
How to attach a picture to the buttons?
So that instead:
5fa01ec197baa107175623.png

It became this:
5fa01f1ed46c3657526728.png

Part of the code with buttons:

else if (d.split("_")[0] == "catalog") {
        var kb = bot.inlineKeyboard()
        for (var i = 0; i < items.length; i++) {

            if (items[i].type == "section")
                kb.inline_keyboard[i] = [bot.inlineButton(items[i].label, { callback: "s_" + i })]
            else if (items[i].type == "item")
                kb.inline_keyboard[i] = [bot.inlineButton(items[i].label, { callback: "item_" + items[i].id })]
        }
        bot.editMessageText({ chatId: uid, messageId: msg.message.message_id, parseMode: html, replyMarkup: kb }, "Каталог нашего магазина:")


It is desirable that the picture be taken from its own folder.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question