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

Allow some custom commands in /warn and /ban

This commit is contained in:
Wojciech Pawlik
2020-05-23 21:56:04 +02:00
parent 9db362f6ad
commit 1a9e3cecd0
6 changed files with 39 additions and 6 deletions

View File

@@ -3,7 +3,7 @@
// Utils
const { displayUser, scheduleDeletion } = require('../../utils/tg');
const { html } = require('../../utils/html');
const { parse, strip } = require('../../utils/cmd');
const { parse, strip, substom } = require('../../utils/cmd');
// Bot
@@ -63,7 +63,11 @@ const banHandler = async (ctx) => {
);
}
return ctx.ban({ admin: ctx.from, reason, userToBan });
return ctx.ban({
admin: ctx.from,
reason: await substom(reason),
userToBan,
});
};
module.exports = banHandler;

View File

@@ -1,7 +1,7 @@
'use strict';
// Utils
const { parse, strip } = require('../../utils/cmd');
const { parse, strip, substom } = require('../../utils/cmd');
const { scheduleDeletion } = require('../../utils/tg');
// DB
@@ -53,7 +53,7 @@ const warnHandler = async (ctx) => {
return ctx.warn({
admin: ctx.from,
amend: flags.has('amend'),
reason,
reason: await substom(reason),
userToWarn,
mode: 'manual',
});