Show all product images after greeting
This commit is contained in:
parent
a7f0787aa2
commit
5eafc06a7f
8
bot.js
8
bot.js
@ -71,9 +71,11 @@ function formatOrder(order) {
|
||||
// --- Хэндлеры ---
|
||||
bot.command('start', async (ctx) => {
|
||||
await ctx.reply('Привет! Я ваш виртуальный продавец зефирных цветов.');
|
||||
// Отправляем одну картинку товара
|
||||
const filePath = path.join(__dirname, images[0]);
|
||||
await ctx.replyWithPhoto(new InputFile(filePath), { caption: 'Зефирный букет' }).catch(() => {});
|
||||
// Отправляем все варианты товара
|
||||
for (let i = 0; i < images.length; i++) {
|
||||
const filePath = path.join(__dirname, images[i]);
|
||||
await ctx.replyWithPhoto(new InputFile(filePath), { caption: `Вариант ${i + 1}` }).catch(() => {});
|
||||
}
|
||||
// Кнопки выбора типа продукта
|
||||
await ctx.reply('Какой вариант вас интересует?', {
|
||||
reply_markup: {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user