mirror of
https://github.com/thedevs-network/the-guard-bot
synced 2025-09-05 08:35:22 +00:00
Added and used scheduleDeletion
...only where I was certain that whis was a good idea, perhaps it could be useful in more places.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
// Utils
|
||||
const { link } = require('../../utils/tg');
|
||||
const { link, scheduleDeletion } = require('../../utils/tg');
|
||||
const { logError } = require('../../utils/log');
|
||||
|
||||
// Bot
|
||||
@@ -24,7 +24,7 @@ const banHandler = async ({ chat, message, reply, telegram, me, state }) => {
|
||||
|
||||
if (!userToBan) {
|
||||
return reply('ℹ️ <b>Reply to a message or mention a user.</b>',
|
||||
replyOptions);
|
||||
replyOptions).then(scheduleDeletion);
|
||||
}
|
||||
|
||||
if (message.chat.type === 'private' || userToBan.username === me) {
|
||||
@@ -36,7 +36,8 @@ const banHandler = async ({ chat, message, reply, telegram, me, state }) => {
|
||||
}
|
||||
|
||||
if (reason.length === 0) {
|
||||
return reply('ℹ️ <b>Need a reason to ban.</b>', replyOptions);
|
||||
return reply('ℹ️ <b>Need a reason to ban.</b>', replyOptions)
|
||||
.then(scheduleDeletion);
|
||||
}
|
||||
|
||||
if (message.reply_to_message) {
|
||||
|
Reference in New Issue
Block a user