mirror of
https://github.com/abocn/TelegramBot.git
synced 2025-03-10 12:49:57 +00:00
Fixed security issue with self-kicking
This commit is contained in:
parent
f2d7c58ac9
commit
c05ee25f25
@ -78,10 +78,12 @@ module.exports = (bot) => {
|
|||||||
|
|
||||||
bot.command('botkickme', spamwatchMiddleware, async (ctx) => {
|
bot.command('botkickme', spamwatchMiddleware, async (ctx) => {
|
||||||
const Strings = getStrings(ctx.from.language_code);
|
const Strings = getStrings(ctx.from.language_code);
|
||||||
|
handleAdminCommand(ctx, async () => {
|
||||||
ctx.reply(Strings.kickingMyself, {
|
ctx.reply(Strings.kickingMyself, {
|
||||||
parse_mode: 'Markdown',
|
parse_mode: 'Markdown',
|
||||||
reply_to_message_id: ctx.message.message_id
|
reply_to_message_id: ctx.message.message_id
|
||||||
});
|
});
|
||||||
await ctx.telegram.leaveChat(ctx.chat.id);
|
await ctx.telegram.leaveChat(ctx.chat.id);
|
||||||
|
}, '', Strings.kickingMyselfErr);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
"varNo": "No",
|
"varNo": "No",
|
||||||
"varNone": "None",
|
"varNone": "None",
|
||||||
"kickingMyself": "*Since you don't need me, I'll get out of here.*",
|
"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.",
|
"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.",
|
"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.",
|
"privateOnly": "This command should be used only on private chats, and not on groups.",
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
"varNo": "Não",
|
"varNo": "Não",
|
||||||
"varNone": "Nenhum",
|
"varNone": "Nenhum",
|
||||||
"kickingMyself": "*Já que você não precisa de mim, vou ir embora.*",
|
"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.",
|
"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.",
|
"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.",
|
"privateOnly": "Esse comando deve ser utilizado apenas em chats privados, e não em grupos.",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user