diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-06-14 12:47:57 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-06-14 12:47:57 -0400 |
commit | 661e4c9935aeb8760dafc7ced4bbec6cc356a033 (patch) | |
tree | bb4c12bdef067d203f100e13e05ccb705b299834 /src/commands/dev/superUser.ts | |
parent | eaf592b72eb5b1d66aa2bde5151a8947570a506c (diff) | |
download | tanzanite-661e4c9935aeb8760dafc7ced4bbec6cc356a033.tar.gz tanzanite-661e4c9935aeb8760dafc7ced4bbec6cc356a033.tar.bz2 tanzanite-661e4c9935aeb8760dafc7ced4bbec6cc356a033.zip |
remove the war crimes that I previously committed
- Remove custom typings and replace with declaration merging
- Fix the typings for args
- Replace all discord-api-types imports with discord.js imports
- Fix discord.js breaking changes
Diffstat (limited to 'src/commands/dev/superUser.ts')
-rw-r--r-- | src/commands/dev/superUser.ts | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/src/commands/dev/superUser.ts b/src/commands/dev/superUser.ts index d62ac8e..6a2b745 100644 --- a/src/commands/dev/superUser.ts +++ b/src/commands/dev/superUser.ts @@ -1,6 +1,5 @@ -import { BushCommand, type ArgType, type BushMessage } from '#lib'; -import { ArgumentGeneratorReturn } from 'discord-akairo'; -import { ArgumentTypeCasterReturn } from 'discord-akairo/dist/src/struct/commands/arguments/Argument.js'; +import { BushCommand, type ArgType, type CommandMessage } from '#lib'; +import { type ArgumentGeneratorReturn, type ArgumentTypeCasterReturn } from 'discord-akairo'; export default class SuperUserCommand extends BushCommand { public constructor() { @@ -54,30 +53,30 @@ export default class SuperUserCommand extends BushCommand { return { action, user }; } - public override async exec(message: BushMessage, { action, user }: { action: 'add' | 'remove'; user: ArgType<'user'> }) { + public override async exec(message: CommandMessage, args: { action: 'add' | 'remove'; user: ArgType<'user'> }) { if (!message.author.isOwner()) return await message.util.reply(`${util.emojis.error} Only my developers can run this command.`); const superUsers: string[] = util.getShared('superUsers'); - if (action === 'add' ? superUsers.includes(user.id) : !superUsers.includes(user.id)) + if (args.action === 'add' ? superUsers.includes(args.user.id) : !superUsers.includes(args.user.id)) return message.util.reply( - `${util.emojis.warn} ${util.format.input(user.tag)} is ${action === 'add' ? 'already' : 'not'} a superuser.` + `${util.emojis.warn} ${util.format.input(args.user.tag)} is ${args.action === 'add' ? 'already' : 'not'} a superuser.` ); - const success = await util.insertOrRemoveFromShared(action, 'superUsers', user.id).catch(() => false); + const success = await util.insertOrRemoveFromShared(args.action, 'superUsers', args.user.id).catch(() => false); if (success) { return await message.util.reply( - `${util.emojis.success} ${action == 'remove' ? '' : 'made'} ${util.format.input(user.tag)} ${ - action == 'remove' ? 'is no longer ' : '' + `${util.emojis.success} ${args.action == 'remove' ? '' : 'made'} ${util.format.input(args.user.tag)} ${ + args.action == 'remove' ? 'is no longer ' : '' }a superuser.` ); } else { return await message.util.reply( - `${util.emojis.error} There was an error ${action == 'remove' ? `removing` : 'making'} ${util.format.input(user.tag)} ${ - action == 'remove' ? `from` : 'to' - } the superuser list.` + `${util.emojis.error} There was an error ${args.action == 'remove' ? `removing` : 'making'} ${util.format.input( + args.user.tag + )} ${args.action == 'remove' ? `from` : 'to'} the superuser list.` ); } } |