From 0af901a258307ede2922b32d65c7942d1495dbb6 Mon Sep 17 00:00:00 2001 From: Luquinhas Date: Fri, 10 Jan 2025 09:24:05 -0300 Subject: [PATCH] Changed error handling on crew.js --- src/commands/crew.js | 4 ++-- src/locales/english.json | 2 +- src/locales/portuguese.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/commands/crew.js b/src/commands/crew.js index 80cc8c4..4ac7173 100644 --- a/src/commands/crew.js +++ b/src/commands/crew.js @@ -159,12 +159,12 @@ module.exports = (bot) => { caption: botFile }); } catch (error) { - ctx.reply(Strings.fileError.replace('{error}', error.message), { + ctx.reply(Strings.varErr.replace('{error}', error.message), { parse_mode: 'Markdown', reply_to_message_id: ctx.message.message_id }); } - }, '', Strings.fileError); + }, '', Strings.varErr); }); bot.command('run', spamwatchMiddleware, async (ctx) => { diff --git a/src/locales/english.json b/src/locales/english.json index a7588f5..c941527 100644 --- a/src/locales/english.json +++ b/src/locales/english.json @@ -11,6 +11,7 @@ "varIs": "is", "varWas": "was", "varNone": "None", + "varErr": "Some unexpected error occurred during a bot action. Please report it to the developers.", "invalidOption": "Whoops! Invalid option!", "kickingMyself": "*Since you don't need me, I'll leave.*", "kickingMyselfErr": "Error leaving the chat.", @@ -27,7 +28,6 @@ "banErr": "Could not ban the user. Check if the ID is correct and if the bot has admin permissions.\n\n`{tgErr}`", "unBanSuccess": "User with ID `{userId}` has been unbanned.", "unBanErr": "Could not unban the user. Check if the ID is correct and if the bot has admin permissions.\n\n`{tgErr}`", - "error": "An unexpected error occured. Please, report to the developers.", "isGay": "Yes, you are *gay*!", "isNtGay": "Ah, you are not gay!", "isFurry": "Yes, you are *furry*!", diff --git a/src/locales/portuguese.json b/src/locales/portuguese.json index e111cb6..30b8354 100644 --- a/src/locales/portuguese.json +++ b/src/locales/portuguese.json @@ -11,6 +11,7 @@ "varIs": "está", "varWas": "estava", "varNone": "Nenhum", + "varErr": "Algum erro inesperado ocorreu durante uma ação do bot. Por favor, reporte aos desenvolvedores.\n\n{error}", "invalidOption": "Ops! Opção inválida!", "kickingMyself": "*Já que você não precisa de mim, vou sair daqui.*", "kickingMyselfErr": "Erro ao sair do chat.", @@ -25,7 +26,6 @@ "invalidId": "Por favor, insira um ID de usuário válido.", "banSuccess": "Usuário com ID `{userId}` foi banido.", "banErr": "Não foi possível banir o usuário. Verifique se o ID está correto e se o bot tem permissões de administrador.\n\n`{tgErr}`", - "error": "Um erro inesperado ocorreu, por favor reporte ao desenvolvedor", "unBanSuccess": "Usuário com ID `{userId}` foi desbanido.", "unBanErr": "Não foi possível desbanir o usuário. Verifique se o ID está correto e se o bot tem permissões de administrador.\n\n`{tgErr}`", "isGay": "Sim, você é *gay*!",