From cca0b7a03bcd61af12b7f9bff51276f6c70beeb3 Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Mon, 26 Jul 2021 18:45:31 -0400 Subject: refactor: this.client.util -> util --- src/commands/dev/superUser.ts | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'src/commands/dev/superUser.ts') 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 { 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.` ); } } -- cgit