localization: use dash-case for variables names
This commit is contained in:
parent
e029fd1172
commit
004d20ba43
@ -1,7 +1,7 @@
|
|||||||
err_invalid_url = ❌ Invalid URL! Please send a valid TikTok link (e.g., https://vt.tiktok.com/...)
|
err-invalid-url = ❌ Invalid URL! Please send a valid TikTok link (e.g., https://vt.tiktok.com/...)
|
||||||
err_invalid_download_urls = 🔍 Download links not found. The video might be deleted or unavailable
|
err-invalid-download-urls = 🔍 Download links not found. The video might be deleted or unavailable
|
||||||
err_generic = ⚠️ Something went wrong. Please try again in a few seconds
|
err-generic = ⚠️ Something went wrong. Please try again in a few seconds
|
||||||
err_limit_exceeded = 🚫 Too many requests! Please wait before sending the next link
|
err-limit-exceeded = 🚫 Too many requests! Please wait before sending the next link
|
||||||
|
|
||||||
|
|
||||||
msg_welcome = Welcome! I can download TikTok videos and images for you without watermark. Just send me the link (for example: https://vt.tiktok.com/...)
|
msg-welcome = Welcome! I can download TikTok videos and images for you without watermark. Just send me the link (for example: https://vt.tiktok.com/...)
|
||||||
@ -1,7 +1,7 @@
|
|||||||
err_invalid_url = ❌ Неверная ссылка! Отправьте корректную ссылку TikTok (например: https://vt.tiktok.com/...)
|
err-invalid-url = ❌ Неверная ссылка! Отправьте корректную ссылку TikTok (например: https://vt.tiktok.com/...)
|
||||||
err_invalid_download_urls = 🔍 Не удалось найти ссылки для скачивания. Возможно, видео удалено или недоступно
|
err-invalid-download-urls = 🔍 Не удалось найти ссылки для скачивания. Возможно, видео удалено или недоступно
|
||||||
err_generic = ⚠️ Что-то пошло не так. Попробуйте еще раз через несколько секунд
|
err-generic = ⚠️ Что-то пошло не так. Попробуйте еще раз через несколько секунд
|
||||||
err_limit_exceeded = 🚫 Слишком много запросов! Подождите немного перед следующей ссылкой
|
err-limit-exceeded = 🚫 Слишком много запросов! Подождите немного перед следующей ссылкой
|
||||||
|
|
||||||
|
|
||||||
msg_welcome = Добро пожаловать! Я могу скачать для вас видео и изображения из TikTok без водяного знака. Для этого просто отправьте мне ссылку (например: https://vt.tiktok.com/...)
|
msg-welcome = Добро пожаловать! Я могу скачать для вас видео и изображения из TikTok без водяного знака. Для этого просто отправьте мне ссылку (например: https://vt.tiktok.com/...)
|
||||||
@ -17,7 +17,7 @@ feature.on('message:text', logHandle('download-message'), async (context) => {
|
|||||||
const url = context.message.text.trim();
|
const url = context.message.text.trim();
|
||||||
|
|
||||||
if (!validateTikTokUrl(url)) {
|
if (!validateTikTokUrl(url)) {
|
||||||
return context.reply(context.t('err_invalid_url'));
|
return context.reply(context.t('err-invalid-url'));
|
||||||
}
|
}
|
||||||
|
|
||||||
const cachedFileId = await redis.get(url);
|
const cachedFileId = await redis.get(url);
|
||||||
@ -34,7 +34,7 @@ feature.on('message:text', logHandle('download-message'), async (context) => {
|
|||||||
const imagesUrls = result?.images;
|
const imagesUrls = result?.images;
|
||||||
|
|
||||||
if (!videoUrl && !imagesUrls?.length) {
|
if (!videoUrl && !imagesUrls?.length) {
|
||||||
return context.reply(context.t('err_invalid_download_urls'));
|
return context.reply(context.t('err-invalid-download-urls'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result?.type === 'video' && videoUrl) {
|
if (result?.type === 'video' && videoUrl) {
|
||||||
@ -50,7 +50,7 @@ feature.on('message:text', logHandle('download-message'), async (context) => {
|
|||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
context.logger.error(error);
|
context.logger.error(error);
|
||||||
return context.reply(context.t('err_generic'));
|
return context.reply(context.t('err-generic'));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -7,7 +7,7 @@ const composer = new Composer<Context>();
|
|||||||
const feature = composer.chatType('private');
|
const feature = composer.chatType('private');
|
||||||
|
|
||||||
feature.command('start', logHandle('command-start'), (ctx) => {
|
feature.command('start', logHandle('command-start'), (ctx) => {
|
||||||
return ctx.reply(ctx.t('msg_welcome'));
|
return ctx.reply(ctx.t('msg-welcome'));
|
||||||
});
|
});
|
||||||
|
|
||||||
export { composer as welcome };
|
export { composer as welcome };
|
||||||
|
|||||||
@ -34,7 +34,7 @@ export function createBot({ apiRoot, token }: Parameters_) {
|
|||||||
},
|
},
|
||||||
limit: 1,
|
limit: 1,
|
||||||
onLimitExceeded: async (ctx) => {
|
onLimitExceeded: async (ctx) => {
|
||||||
await ctx.reply(ctx.t('err_limit_exceeded'));
|
await ctx.reply(ctx.t('err-limit-exceeded'));
|
||||||
},
|
},
|
||||||
storageClient: redis,
|
storageClient: redis,
|
||||||
timeFrame: env.RATE_LIMIT,
|
timeFrame: env.RATE_LIMIT,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user