aboutsummaryrefslogtreecommitdiff
path: root/src/commands/dev/superUser.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands/dev/superUser.ts')
-rw-r--r--src/commands/dev/superUser.ts16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/commands/dev/superUser.ts b/src/commands/dev/superUser.ts
index e06d064..cc1519f 100644
--- a/src/commands/dev/superUser.ts
+++ b/src/commands/dev/superUser.ts
@@ -41,30 +41,28 @@ export default class SuperUserCommand extends BushCommand {
}
public async exec(message: BushMessage | BushSlashMessage, args: { action: 'add' | 'remove'; user: User }): Promise<unknown> {
if (!message.author.isOwner())
- return await message.util.reply(`${this.client.util.emojis.error} Only my developers can run this command.`);
+ return await message.util.reply(`${util.emojis.error} Only my developers can run this command.`);
const superUsers = (await Global.findByPk(this.client.config.environment)).superUsers;
let success;
if (args.action === 'add') {
if (superUsers.includes(args.user.id)) {
- return message.util.reply(`${this.client.util.emojis.warn} \`${args.user.tag}\` is already a superuser.`);
+ return message.util.reply(`${util.emojis.warn} \`${args.user.tag}\` is already a superuser.`);
}
- success = await this.client.util.insertOrRemoveFromGlobal('add', 'superUsers', args.user.id).catch(() => false);
+ success = await util.insertOrRemoveFromGlobal('add', 'superUsers', args.user.id).catch(() => false);
} else {
if (!superUsers.includes(args.user.id)) {
- return message.util.reply(`${this.client.util.emojis.warn} \`${args.user.tag}\` is not superuser.`);
+ return message.util.reply(`${util.emojis.warn} \`${args.user.tag}\` is not superuser.`);
}
- success = await this.client.util.insertOrRemoveFromGlobal('remove', 'superUsers', args.user.id).catch(() => false);
+ success = await util.insertOrRemoveFromGlobal('remove', 'superUsers', args.user.id).catch(() => false);
}
if (success) {
const responses = [args.action == 'remove' ? '' : 'made', args.action == 'remove' ? 'is no longer' : ''];
- return message.util.reply(
- `${this.client.util.emojis.success} ${responses[0]} \`${args.user.tag}\` ${responses[1]} a superuser.`
- );
+ return message.util.reply(`${util.emojis.success} ${responses[0]} \`${args.user.tag}\` ${responses[1]} a superuser.`);
} else {
const response = [args.action == 'remove' ? `removing` : 'making', args.action == 'remove' ? `from` : 'to'];
return message.util.reply(
- `${this.client.util.emojis.error} There was an error ${response[0]} \`${args.user.tag}\` ${response[1]} the superuser list.`
+ `${util.emojis.error} There was an error ${response[0]} \`${args.user.tag}\` ${response[1]} the superuser list.`
);
}
}