Fixed security issue with self-kicking

This commit is contained in:
Lucas Gabriel 2024-09-07 20:12:14 -03:00
parent f2d7c58ac9
commit c05ee25f25
No known key found for this signature in database
GPG Key ID: D9B075FC6DC93985
3 changed files with 9 additions and 5 deletions

View File

@ -78,10 +78,12 @@ module.exports = (bot) => {
bot.command('botkickme', spamwatchMiddleware, async (ctx) => {
const Strings = getStrings(ctx.from.language_code);
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);
});
};

View File

@ -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.",

View File

@ -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.",