diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-07-26 18:45:31 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-07-26 18:45:31 -0400 |
commit | cca0b7a03bcd61af12b7f9bff51276f6c70beeb3 (patch) | |
tree | 2b2adebc166ac033520e5b582773e63fbdc5ddb9 /src/commands/dev/superUser.ts | |
parent | 13ba1ad552047eb9386e91d542a975c4bef58b08 (diff) | |
download | tanzanite-cca0b7a03bcd61af12b7f9bff51276f6c70beeb3.tar.gz tanzanite-cca0b7a03bcd61af12b7f9bff51276f6c70beeb3.tar.bz2 tanzanite-cca0b7a03bcd61af12b7f9bff51276f6c70beeb3.zip |
refactor: this.client.util -> util
Diffstat (limited to 'src/commands/dev/superUser.ts')
-rw-r--r-- | src/commands/dev/superUser.ts | 16 |
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.` ); } } |