diff --git a/commands/crew.js b/commands/crew.js index 48e045c..0b9a530 100644 --- a/commands/crew.js +++ b/commands/crew.js @@ -78,10 +78,12 @@ module.exports = (bot) => { bot.command('botkickme', spamwatchMiddleware, async (ctx) => { const Strings = getStrings(ctx.from.language_code); - ctx.reply(Strings.kickingMyself, { - parse_mode: 'Markdown', - reply_to_message_id: ctx.message.message_id - }); - await ctx.telegram.leaveChat(ctx.chat.id); + handleAdminCommand(ctx, async () => { + ctx.reply(Strings.kickingMyself, { + parse_mode: 'Markdown', + reply_to_message_id: ctx.message.message_id + }); + await ctx.telegram.leaveChat(ctx.chat.id); + }, '', Strings.kickingMyselfErr); }); }; diff --git a/locales/english.json b/locales/english.json index 335329b..5456e14 100644 --- a/locales/english.json +++ b/locales/english.json @@ -7,6 +7,7 @@ "varNo": "No", "varNone": "None", "kickingMyself": "*Since you don't need me, I'll get out of here.*", + "kickingMyselfErr": "Error leaving the chat.", "noPermission": "You don't have permissions to run this command.", "botAdminOnly": "This command is exclusive to the bot's general administrators. I can't disclose who they are, nor what this command does.", "privateOnly": "This command should be used only on private chats, and not on groups.", diff --git a/locales/portuguese.json b/locales/portuguese.json index 450b555..8b8045d 100644 --- a/locales/portuguese.json +++ b/locales/portuguese.json @@ -7,6 +7,7 @@ "varNo": "Não", "varNone": "Nenhum", "kickingMyself": "*Já que você não precisa de mim, vou ir embora.*", + "kickingMyselfErr": "Erro ao sair do chat.", "noPermission": "Você não tem permissões para rodar esse comando.", "botAdminOnly": "Esse comando é exclusivo a administradores gerais do bot. Não posso informar quem são, e nem o que esse comando faz.", "privateOnly": "Esse comando deve ser utilizado apenas em chats privados, e não em grupos.",