Answer the question
In order to leave comments, you need to log in
( 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:
It became this:
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 }, "Каталог нашего магазина:")
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