2
0
mirror of https://github.com/thedevs-network/the-guard-bot synced 2025-09-05 00:25:19 +00:00

ban/warn command on admins doesn't delete the message now

This commit is contained in:
Pouria Ezzati
2017-10-10 22:20:50 +03:30
parent 9ed3a54319
commit d487a6fc75
2 changed files with 8 additions and 8 deletions

View File

@@ -31,6 +31,10 @@ const banHandler = async ({ chat, message, reply, telegram, me, state }) => {
return null;
}
if (await isAdmin(userToBan)) {
return reply(' <b>Can\'t ban other admins.</b>', replyOptions);
}
if (reason.length === 0) {
return reply(' <b>Need a reason to ban.</b>', replyOptions);
}
@@ -41,10 +45,6 @@ const banHandler = async ({ chat, message, reply, telegram, me, state }) => {
message.reply_to_message.message_id);
}
if (await isAdmin(userToBan)) {
return reply(' <b>Can\'t ban other admins.</b>', replyOptions);
}
if (await isBanned(userToBan)) {
return reply(`🚫 ${link(userToBan)} <b>is already banned.</b>`,
replyOptions);