Changed error handling on crew.js

This commit is contained in:
Lucas Gabriel 2025-01-10 09:24:05 -03:00
parent a36e1825b9
commit 0af901a258
No known key found for this signature in database
GPG Key ID: D9B075FC6DC93985
3 changed files with 4 additions and 4 deletions

View File

@ -159,12 +159,12 @@ module.exports = (bot) => {
caption: botFile caption: botFile
}); });
} catch (error) { } catch (error) {
ctx.reply(Strings.fileError.replace('{error}', error.message), { ctx.reply(Strings.varErr.replace('{error}', error.message), {
parse_mode: 'Markdown', parse_mode: 'Markdown',
reply_to_message_id: ctx.message.message_id reply_to_message_id: ctx.message.message_id
}); });
} }
}, '', Strings.fileError); }, '', Strings.varErr);
}); });
bot.command('run', spamwatchMiddleware, async (ctx) => { bot.command('run', spamwatchMiddleware, async (ctx) => {

View File

@ -11,6 +11,7 @@
"varIs": "is", "varIs": "is",
"varWas": "was", "varWas": "was",
"varNone": "None", "varNone": "None",
"varErr": "Some unexpected error occurred during a bot action. Please report it to the developers.",
"invalidOption": "Whoops! Invalid option!", "invalidOption": "Whoops! Invalid option!",
"kickingMyself": "*Since you don't need me, I'll leave.*", "kickingMyself": "*Since you don't need me, I'll leave.*",
"kickingMyselfErr": "Error leaving the chat.", "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}`", "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.", "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}`", "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*!", "isGay": "Yes, you are *gay*!",
"isNtGay": "Ah, you are not gay!", "isNtGay": "Ah, you are not gay!",
"isFurry": "Yes, you are *furry*!", "isFurry": "Yes, you are *furry*!",

View File

@ -11,6 +11,7 @@
"varIs": "está", "varIs": "está",
"varWas": "estava", "varWas": "estava",
"varNone": "Nenhum", "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!", "invalidOption": "Ops! Opção inválida!",
"kickingMyself": "*Já que você não precisa de mim, vou sair daqui.*", "kickingMyself": "*Já que você não precisa de mim, vou sair daqui.*",
"kickingMyselfErr": "Erro ao sair do chat.", "kickingMyselfErr": "Erro ao sair do chat.",
@ -25,7 +26,6 @@
"invalidId": "Por favor, insira um ID de usuário válido.", "invalidId": "Por favor, insira um ID de usuário válido.",
"banSuccess": "Usuário com ID `{userId}` foi banido.", "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}`", "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.", "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}`", "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*!", "isGay": "Sim, você é *gay*!",