2
0
mirror of https://github.com/thedevs-network/the-guard-bot synced 2025-08-31 14:15:25 +00:00

admin tools

This commit is contained in:
Thomas Rory Gummerson
2017-07-24 18:37:43 +02:00
parent 993bc6bccb
commit 68d72098ef

View File

@@ -26,9 +26,13 @@ const config = loadJSON('config.json');
const bot = new Telegraf(config.token);
DEBUG && bot.command('adminme', ctx =>
(admins.admin(ctx.from),
ctx.reply('Admined')));
bot.command('admin', ({ message, reply }) => {
const userToAdmin = message.reply_to_message
? message.reply_to_message.from
: message.from;
return admins.admin(userToAdmin).then(() =>
reply('Admined ' + link(userToAdmin), replyOptions));
});
bot.on('new_chat_member', deleteAfter(10 * 60 * 1000));
bot.on('left_chat_member', deleteAfter(10 * 60 * 1000));