feat: add support for donation link in bot descriptions and update short descriptions
This commit is contained in:
parent
7cc225ca47
commit
4e5631487f
@ -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 =
|
||||
|
||||
@ -10,9 +10,9 @@ description =
|
||||
⚡ Просто отправьте ссылку на видео и изображения, и бот сразу скачает его для вас!
|
||||
|
||||
short-description =
|
||||
Скачивай видео и изображения из TikTok, Instagram и YouTube.
|
||||
|
||||
По всем вопросам: @v_dev_support
|
||||
Бот скачивает видео и изображения
|
||||
Поддержка: @v_dev_support
|
||||
Поблагодарить: { $donateLink }
|
||||
|
||||
|
||||
start =
|
||||
|
||||
@ -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 }),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -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))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user