From 08d7e6eb125c5ff6846c3a92491de79d291b8e12 Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Wed, 29 Dec 2021 16:15:06 -0500 Subject: misc improvements & typings changes --- src/commands/config/blacklist.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/commands/config/blacklist.ts') 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'; -- cgit