Fixed security issue with self-kicking
This commit is contained in:
parent
f2d7c58ac9
commit
c05ee25f25
3 changed files with 9 additions and 5 deletions
|
@ -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);
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue