mirror of
https://github.com/thedevs-network/the-guard-bot
synced 2025-08-31 06:05:22 +00:00
More fixes
This commit is contained in:
9
index.js
9
index.js
@@ -26,10 +26,17 @@ const config = loadJSON('config.json');
|
||||
|
||||
const bot = new Telegraf(config.token);
|
||||
|
||||
bot.command('admin', ({ message, reply }) => {
|
||||
bot.command('admin', async ({ message, reply }) => {
|
||||
if (message.from.id !== config.masterID) {
|
||||
return null;
|
||||
}
|
||||
const userToAdmin = message.reply_to_message
|
||||
? message.reply_to_message.from
|
||||
: message.from;
|
||||
|
||||
if (await admins.isAdmin(userToAdmin)) {
|
||||
return reply('Already admin');
|
||||
}
|
||||
return admins.admin(userToAdmin).then(() =>
|
||||
reply('Admined ' + link(userToAdmin), replyOptions));
|
||||
});
|
||||
|
Reference in New Issue
Block a user