Show all product images after greeting

This commit is contained in:
RomanDoroshenko 2026-10-06 12:01:27 +00:00
parent a7f0787aa2
commit 5eafc06a7f

8
bot.js
View File

@ -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: {