Skip to content

Commit

Permalink
modified start command to include media
Browse files Browse the repository at this point in the history
  • Loading branch information
mikedegeofroy committed Nov 19, 2024
1 parent ee5376c commit e189b20
Showing 1 changed file with 31 additions and 18 deletions.
49 changes: 31 additions & 18 deletions src/commands/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,35 @@ import { BOT_USERNAME } from "src/config";
import { Context, Telegraf } from "telegraf";

export function setupStartCommand(bot: Telegraf<Context>) {
bot.start(async (ctx) => {
const username = ctx.from.username || "unknown";
await ctx.reply(
`Добро пожаловать, @${username}!\nЧтобы воспользоваться ботом, откройте мини-приложение DishDash:`,
{
reply_markup: {
inline_keyboard: [
[
{
text: "Открыть DishDash 🤌",
url: `https://t.me/${BOT_USERNAME}/app`,
},
],
],
},
},
);
});
bot.start(async (ctx) => {
await ctx.replyWithPhoto(
"https://storage.yandexcloud.net/dishash-s3/assets/bot/cover.png",
{
reply_markup: {
inline_keyboard: [
[
{
text: "Открыть DishDash 🤌",
url: `https://t.me/${BOT_USERNAME}/app`,
},
],
],
}
}
);

await ctx.replyWithMediaGroup([
{
type: "photo",
media: "https://storage.yandexcloud.net/dishash-s3/assets/bot/card_1.jpeg",
caption: `*Как свайпать?*\n\n• Чтобы посмотреть места в одиночку, запустите бота по кнопке ниже\n\n• Чтобы искать места вместе, запустите бота тут и отправьте приглашение в лобби, или тегните @dishdash\\_bot в любом чате`,
parse_mode: "MarkdownV2",
},
{
type: "photo",
media: "https://storage.yandexcloud.net/dishash-s3/assets/bot/card_2.jpeg",
},
]);

});
}

0 comments on commit e189b20

Please sign in to comment.