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:
@@ -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);
|
||||
|
Reference in New Issue
Block a user