Fixed security issue with self-kicking

This commit is contained in:
lucmsilva651 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);
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);
});
};