mirror of
https://github.com/thedevs-network/the-guard-bot
synced 2025-08-31 22:25:15 +00:00
Improve /del
This commit is contained in:
@@ -21,6 +21,7 @@ const masterCommands = `\
|
||||
|
||||
const adminCommands = `\
|
||||
<b>Admin commands</b>:
|
||||
<code>/del [reason]</code> - Deletes replied-to message.
|
||||
<code>/warn <reason></code> - Warns the user.
|
||||
<code>/unwarn</code> - Removes the last warn from the user.
|
||||
<code>/nowarns</code> - Clears warns for the user.
|
||||
|
@@ -1,8 +1,10 @@
|
||||
'use strict';
|
||||
|
||||
const { parse } = require('../../utils/parse');
|
||||
const html = require('tg-html');
|
||||
const R = require('ramda');
|
||||
|
||||
const { scheduleDeletion } = require('../../utils/tg');
|
||||
const { parse } = require('../../utils/parse');
|
||||
const { link, scheduleDeletion } = require('../../utils/tg');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
if (ctx.from.status !== 'admin') return;
|
||||
@@ -21,6 +23,11 @@ module.exports = async (ctx) => {
|
||||
);
|
||||
|
||||
if (reason) {
|
||||
await ctx.reply(`🗑 ${reason}`);
|
||||
const emoji = link({
|
||||
id: R.path([ 'message', 'reply_to_message', 'from', 'id' ], ctx),
|
||||
first_name: '🗑',
|
||||
});
|
||||
await ctx.replyWithHTML(html`${emoji} ${reason}`)
|
||||
.then(scheduleDeletion());
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user