From 901e5ab98afdfbd34221c0e05e8e476249c97369 Mon Sep 17 00:00:00 2001 From: Luquinhas Date: Fri, 10 Jan 2025 09:24:28 -0300 Subject: [PATCH] Some general changes on strings --- src/commands/help.js | 6 +++--- src/commands/main.js | 4 ++-- src/commands/youtube.js | 7 ++++--- src/locales/english.json | 11 ++++++----- src/locales/portuguese.json | 11 ++++++----- 5 files changed, 21 insertions(+), 18 deletions(-) diff --git a/src/commands/help.js b/src/commands/help.js index 1098cf3..83624dd 100644 --- a/src/commands/help.js +++ b/src/commands/help.js @@ -16,7 +16,7 @@ async function sendHelpMessage(ctx, isEditing) { ] } }; - const helpText = Strings.kowalskiHelp; + const helpText = Strings.botHelp; if (isEditing) { await ctx.editMessageText(helpText, options); } else { @@ -31,7 +31,7 @@ module.exports = (bot) => { bot.command("about", spamwatchMiddleware, async (ctx) => { const Strings = getStrings(ctx.from.language_code); - ctx.reply(Strings.kowalskiAbout, { + ctx.reply(Strings.botAbout, { parse_mode: 'Markdown', disable_web_page_preview: true, reply_to_message_id: ctx.message.message_id @@ -86,7 +86,7 @@ module.exports = (bot) => { break; case 'helpAbout': await ctx.answerCbQuery(); - await ctx.editMessageText(Strings.kowalskiAbout, options); + await ctx.editMessageText(Strings.botAbout, options); break; case 'helpBack': await ctx.answerCbQuery(); diff --git a/src/commands/main.js b/src/commands/main.js index e8bf9c8..8272ed1 100644 --- a/src/commands/main.js +++ b/src/commands/main.js @@ -5,7 +5,7 @@ const spamwatchMiddleware = require('../plugins/lib-spamwatch/Middleware.js')(is module.exports = (bot) => { bot.start(spamwatchMiddleware, async (ctx) => { const Strings = getStrings(ctx.from.language_code); - ctx.reply(Strings.kowalskiWelcome, { + ctx.reply(Strings.botWelcome, { parse_mode: 'Markdown', reply_to_message_id: ctx.message.message_id }); @@ -14,7 +14,7 @@ module.exports = (bot) => { bot.command('privacy', spamwatchMiddleware, async (ctx) => { const Strings = getStrings(ctx.from.language_code); ctx.reply( - Strings.kowalskiPrivacy, { + Strings.botPrivacy, { parse_mode: 'Markdown', disable_web_page_preview: true, reply_to_message_id: ctx.message.message_id diff --git a/src/commands/youtube.js b/src/commands/youtube.js index 6dd3cb9..e0fe2c9 100644 --- a/src/commands/youtube.js +++ b/src/commands/youtube.js @@ -68,6 +68,7 @@ module.exports = (bot) => { const dlpCommand = ytDlpPath; const ffmpegPath = getFfmpegPath(); const ffmpegArgs = ['-i', tempMp4File, '-i', tempWebmFile, '-c:v copy -c:a copy -strict -2', mp4File]; + if (!videoUrl) { return ctx.reply(Strings.ytNoLink, { parse_mode: "Markdown", @@ -146,7 +147,7 @@ module.exports = (bot) => { fs.unlinkSync(mp4File); } catch (error) { - await ctx.reply(Strings.error, { + await ctx.reply(Strings.ytFileError, { parse_mode: 'Markdown', reply_to_message_id: ctx.message.message_id, }); @@ -164,7 +165,7 @@ module.exports = (bot) => { ctx.chat.id, downloadingMessage.message_id, null, - Strings.ytFileErr, { + Strings.ytLibNotFound, { parse_mode: 'Markdown', reply_to_message_id: ctx.message.message_id, }, @@ -172,7 +173,7 @@ module.exports = (bot) => { } } catch (error) { console.error(error); - await ctx.reply(Strings.error, { + await ctx.reply(Strings.ytFileError, { parse_mode: 'Markdown', reply_to_message_id: ctx.message.message_id, }); diff --git a/src/locales/english.json b/src/locales/english.json index c941527..c8a18f3 100644 --- a/src/locales/english.json +++ b/src/locales/english.json @@ -1,8 +1,8 @@ { - "kowalskiWelcome": "*Hello! I am Kowalski!*\nI was made with love by some nerds who really love programming!\n\n*Before using, you need to read the privacy policy (/privacy) to understand where your data goes when using this bot.*\n\nAlso, you can use /help to see the bot commands!\n\n*Special thanks to @givfnz2 for his many contributions to the bot!*", - "kowalskiHelp": "*Hey, I'm Kowalski, a simple bot made entirely from scratch in Telegraf and Node.js by some nerds who really love programming.*\n\nClick on the buttons below to see which commands you can use!\n", - "kowalskiPrivacy": "Check out [this link](https://blog.lucmsilva.com/posts/lynx-privacy-policy) to read the bot's privacy policy.", - "kowalskiAbout": "*About the bot*\n\nKowalski was originally created by [Lucas Gabriel (lucmsilva)](https://github.com/lucmsilva651), now maintained by several people.\n\nThe bot's purpose is to bring fun to your groups here on Telegram in a relaxed and simple way. The bot also features some very useful commands, which you can see using the help command (/help).\n\nSee the source code: [Click here to go to GitHub](https://github.com/abocn/TelegramBot)", + "botWelcome": "*Hello! I am Kowalski!*\nI was made with love by some nerds who really love programming!\n\n*Before using, you need to read the privacy policy (/privacy) to understand where your data goes when using this bot.*\n\nAlso, you can use /help to see the bot commands!\n\n*Special thanks to @givfnz2 for his many contributions to the bot!*", + "botHelp": "*Hey, I'm Kowalski, a simple bot made entirely from scratch in Telegraf and Node.js by some nerds who really love programming.*\n\nClick on the buttons below to see which commands you can use!\n", + "botPrivacy": "Check out [this link](https://blog.lucmsilva.com/posts/lynx-privacy-policy) to read the bot's privacy policy.", + "botAbout": "*About the bot*\n\nKowalski was originally created by [Lucas Gabriel (lucmsilva)](https://github.com/lucmsilva651), now maintained by several people.\n\nThe bot's purpose is to bring fun to your groups here on Telegram in a relaxed and simple way. The bot also features some very useful commands, which you can see using the help command (/help).\n\nSee the source code: [Click here to go to GitHub](https://github.com/abocn/TelegramBot)", "aboutBot": "About the bot", "unKnown": "Unknown", "varYes": "Yes", @@ -70,7 +70,7 @@ "maInvalidModule": "Please provide a valid module ID from The Mod Archive.\nExample: `/modarchive 81574`", "maDownloadError": "Error downloading the file. Check the module ID and try again.", "ytDownloading": "*Downloading video...*", - "ytFileErr": "*It seems that the yt-dlp executable does not exist on our server...\n\nIn that case, the problem is on our end! Please wait until we have noticed and solved the problem.*", + "ytLibNotFound": "*It seems that the yt-dlp executable does not exist on our server...\n\nIn that case, the problem is on our end! Please wait until we have noticed and solved the problem.*", "ytCheckingSize": "*Checking if the video exceeds the 50MB limit...*", "ytUploading": "*Uploading video...*", "ytUploadDesc": "*[{userName}](tg://user?id={userId}), there is your downloaded video.*", @@ -78,6 +78,7 @@ "ytUploadLimit": "*This video exceeds the 50 MB upload limit imposed by Telegram on our bot. Please try another video. We're doing our best to increase this limit.*", "ytUploadLimit2": "*This video had its quality reduced because it exceeded the 50MB limit for uploads imposed by Telegram.*", "ytNoLink": "Please provide a link to a video to download.", + "ytFileError": "Error uploading file. Please try again later.", "botUpdated": "Bot updated with success.\n\n```{result}```", "errorUpdatingBot": "Error updating bot\n\n{error}", "catImgErr": "Sorry, but I couldn't get the cat photo you wanted.", diff --git a/src/locales/portuguese.json b/src/locales/portuguese.json index 30b8354..b28d1b1 100644 --- a/src/locales/portuguese.json +++ b/src/locales/portuguese.json @@ -1,8 +1,8 @@ { - "kowalskiWelcome": "*Olá! Eu sou o Kowalski!*\nFui feito com carinho por uns nerds que gostam de programação!\n\n*Antes de usar, você precisa ler a política de privacidade (/privacy) para entender onde seus dados vão ao usar este bot.*\n\nAlém disso, você pode usar /help para ver os comandos do bot!\n\n*Agradecimento especial ao @givfnz2 pelas suas várias contribuições ao bot!*", - "kowalskiHelp": "*Oi, eu sou o Kowalski, um bot simples feito do zero em Telegraf e Node.js por uns nerds que gostam de programação.*\n\nClique nos botões abaixo para ver quais comandos você pode usar!\n", - "kowalskiPrivacy": "Acesse [este link](https://blog.lucmsilva.com/posts/lynx-privacy-policy) para ler a política de privacidade do bot.", - "kowalskiAbout": "*Sobre o bot*\n\nKowalski foi feito originalmente por [Lucas Gabriel (lucmsilva)](https://github.com/lucmsilva651), agora sendo mantido por várias pessoas.\n\nA intenção do bot é trazer diversão para os seus grupos aqui no Telegram de uma maneira bem descontraida e simples. O bot também conta com alguns comandos bem úteis, que você consegue ver com o comando de ajuda (/help).\n\nVeja o código fonte: [Clique aqui para ir ao GitHub](https://github.com/abocn/TelegramBot)", + "botWelcome": "*Olá! Eu sou o Kowalski!*\nFui feito com carinho por uns nerds que gostam de programação!\n\n*Antes de usar, você precisa ler a política de privacidade (/privacy) para entender onde seus dados vão ao usar este bot.*\n\nAlém disso, você pode usar /help para ver os comandos do bot!\n\n*Agradecimento especial ao @givfnz2 pelas suas várias contribuições ao bot!*", + "botHelp": "*Oi, eu sou o Kowalski, um bot simples feito do zero em Telegraf e Node.js por uns nerds que gostam de programação.*\n\nClique nos botões abaixo para ver quais comandos você pode usar!\n", + "botPrivacy": "Acesse [este link](https://blog.lucmsilva.com/posts/lynx-privacy-policy) para ler a política de privacidade do bot.", + "botAbout": "*Sobre o bot*\n\nKowalski foi feito originalmente por [Lucas Gabriel (lucmsilva)](https://github.com/lucmsilva651), agora sendo mantido por várias pessoas.\n\nA intenção do bot é trazer diversão para os seus grupos aqui no Telegram de uma maneira bem descontraida e simples. O bot também conta com alguns comandos bem úteis, que você consegue ver com o comando de ajuda (/help).\n\nVeja o código fonte: [Clique aqui para ir ao GitHub](https://github.com/abocn/TelegramBot)", "aboutBot": "Sobre o bot", "unKnown": "Desconhecido", "varYes": "Sim", @@ -71,13 +71,14 @@ "maDownloadError": "Erro ao baixar o arquivo. Verifique o ID do módulo e tente novamente.", "ytDownloading": "*Baixando vídeo...*", "ytCheckingSize": "Verificando se o vídeo excede o limite de 50 MB...", - "ytFileErr": "*Parece que o executável do yt-dlp não existe no nosso servidor...\n\nNesse caso, o problema está no nosso lado! Aguarde até que tenhamos notado e resolvido o problema.*", + "ytLibNotFound": "*Parece que o executável do yt-dlp não existe no nosso servidor...\n\nNesse caso, o problema está no nosso lado! Aguarde até que tenhamos notado e resolvido o problema.*", "ytUploading": "*Enviando video...*", "ytUploadDesc": "*[{userName}](tg://user?id={userId}), aqui está o seu vídeo baixado.*", "ytDownloadErr": "*Erro durante o download do vídeo do YT:*\n\n`{err}`", "ytUploadLimit": "*Este vídeo excede o limite de carregamento de 50 MB imposto pelo Telegram ao nosso bot. Por favor, tente outro vídeo. Estamos fazendo o possível para aumentar esse limite.*", "ytUploadLimit2": "*Esse vídeo teve a qualidade reduzida por estar excedendo o limite de 50MB para uploads imposto pelo Telegram.*", "ytNoLink": "*Por favor, forneça um link de um vídeo para download.*", + "ytFileError": "Erro ao enviar o arquivo. Tente novamente mais tarde.", "botUpdated": "Bot atualizado com sucesso.\n\n```{result}```", "errorUpdatingBot": "Erro ao atualizar o bot\n\n{error}", "catImgErr": "Desculpe, mas não consegui obter a foto do gato que você queria.",