2
0
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:
GingerPlusPlus
2017-10-31 22:20:49 +01:00
parent 84e178f363
commit 337f6e2183
12 changed files with 45 additions and 37 deletions

View File

@@ -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) {