feat: add support for donation link in bot descriptions and update short descriptions

This commit is contained in:
vchikalkin 2026-02-17 23:50:28 +03:00
parent 7cc225ca47
commit 4e5631487f
4 changed files with 11 additions and 7 deletions

View File

@ -10,9 +10,9 @@ description =
⚡ Simply send the video link, and the bot will download it for you.
short-description =
Download TikTok, Instagram and YouTube videos and images.
For any questions: @v_dev_support
Bot downloads videos and pictures
Support: @v_dev_support
Donate: { $donateLink }
start =

View File

@ -10,9 +10,9 @@ description =
⚡ Просто отправьте ссылку на видео и изображения, и бот сразу скачает его для вас!
short-description =
Скачивай видео и изображения из TikTok, Instagram и YouTube.
По всем вопросам: @v_dev_support
Бот скачивает видео и изображения
Поддержка: @v_dev_support
Поблагодарить: { $donateLink }
start =

View File

@ -1,10 +1,13 @@
import { type Context } from '../context';
import { i18n } from '../i18n';
import { env } from '@/config/env';
import { type Api, type Bot, type RawApi } from 'grammy';
export async function setInfo({ api }: Bot<Context, Api<RawApi>>) {
for (const locale of i18n.locales) {
await api.setMyDescription(i18n.t(locale, 'description'));
await api.setMyShortDescription(i18n.t(locale, 'short-description'));
await api.setMyShortDescription(
i18n.t(locale, 'short-description', { donateLink: env.DONATE_LINK }),
);
}
}

View File

@ -3,6 +3,7 @@ import { z } from 'zod';
export const envSchema = z.object({
BOT_TOKEN: z.string(),
DONATE_LINK: z.string(),
RATE_LIMIT: z
.string()
.transform((value) => Number.parseInt(value, 10))