diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-12-29 16:15:06 -0500 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-12-29 16:15:06 -0500 |
commit | 08d7e6eb125c5ff6846c3a92491de79d291b8e12 (patch) | |
tree | 4abdaeee3ad258ef8fa0d7b517ea49d262d18b0b /src/commands/config/blacklist.ts | |
parent | f9cf43fc47be2d497d92d728ea892246df96d736 (diff) | |
download | tanzanite-08d7e6eb125c5ff6846c3a92491de79d291b8e12.tar.gz tanzanite-08d7e6eb125c5ff6846c3a92491de79d291b8e12.tar.bz2 tanzanite-08d7e6eb125c5ff6846c3a92491de79d291b8e12.zip |
misc improvements & typings changes
Diffstat (limited to 'src/commands/config/blacklist.ts')
-rw-r--r-- | src/commands/config/blacklist.ts | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/commands/config/blacklist.ts b/src/commands/config/blacklist.ts index d119774..d15b8d7 100644 --- a/src/commands/config/blacklist.ts +++ b/src/commands/config/blacklist.ts @@ -1,4 +1,4 @@ -import { AllowedMentions, ArgType, BushCommand, type BushMessage, type BushSlashMessage } from '#lib'; +import { AllowedMentions, BushCommand, type ArgType, type BushMessage, type BushSlashMessage } from '#lib'; import { User } from 'discord.js'; export default class BlacklistCommand extends BushCommand { @@ -16,10 +16,7 @@ export default class BlacklistCommand extends BushCommand { readableType: "'blacklist'|'unblacklist'", prompt: 'Would you like to add or remove someone or something from/to the blacklist?', slashType: 'STRING', - choices: [ - { name: 'blacklist', value: 'blacklist' }, - { name: 'unblacklist', value: 'unblacklist' } - ], + choices: ['blacklist', 'unblacklist'].map((c) => ({ name: c, value: c })), only: 'slash' }, { @@ -51,7 +48,11 @@ export default class BlacklistCommand extends BushCommand { public override async exec( message: BushMessage | BushSlashMessage, - args: { action?: 'blacklist' | 'unblacklist'; target: ArgType<'channel'> | ArgType<'user'> | string; global: boolean } + args: { + action?: 'blacklist' | 'unblacklist'; + target: ArgType<'channel'> | ArgType<'user'> | string; // there is no way to combine channel and user in slash commands without making subcommands + global: ArgType<'boolean'>; + } ) { let action: 'blacklist' | 'unblacklist' | 'toggle' = args.action ?? (message?.util?.parsed?.alias as 'blacklist' | 'unblacklist' | undefined) ?? 'toggle'; |