diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-12-20 22:50:45 -0500 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-12-20 22:50:45 -0500 |
commit | 8fb88c737e49321ff2b612a9d0e0e059c64c272a (patch) | |
tree | 6d22573479b7e7e047eceb85dbb7520b616a5a45 /src/commands/info | |
parent | d4a401ed2315a7b5e7dfa390836f2ebae1299976 (diff) | |
download | tanzanite-8fb88c737e49321ff2b612a9d0e0e059c64c272a.tar.gz tanzanite-8fb88c737e49321ff2b612a9d0e0e059c64c272a.tar.bz2 tanzanite-8fb88c737e49321ff2b612a9d0e0e059c64c272a.zip |
do some fixes or something
Diffstat (limited to 'src/commands/info')
-rw-r--r-- | src/commands/info/avatar.ts | 2 | ||||
-rw-r--r-- | src/commands/info/color.ts | 19 | ||||
-rw-r--r-- | src/commands/info/guildInfo.ts | 2 | ||||
-rw-r--r-- | src/commands/info/userInfo.ts | 2 |
4 files changed, 16 insertions, 9 deletions
diff --git a/src/commands/info/avatar.ts b/src/commands/info/avatar.ts index 87ea0cc..36504f8 100644 --- a/src/commands/info/avatar.ts +++ b/src/commands/info/avatar.ts @@ -13,7 +13,7 @@ export default class AvatarCommand extends BushCommand { { id: 'user', description: 'The user you would like to find the avatar of.', - customType: util.arg.union('member', 'globalUser'), + type: util.arg.union('member', 'globalUser'), readableType: 'member|user', prompt: 'Who would you like to see the avatar of?', retry: '{error} Choose a valid user.', diff --git a/src/commands/info/color.ts b/src/commands/info/color.ts index cb612b5..4277d56 100644 --- a/src/commands/info/color.ts +++ b/src/commands/info/color.ts @@ -1,9 +1,16 @@ -import { AllowedMentions, BushCommand, type BushGuildMember, type BushMessage, type BushRole, type BushSlashMessage } from '#lib'; -import { Argument } from 'discord-akairo'; -import { MessageEmbed, Role, type Message } from 'discord.js'; +import { + AllowedMentions, + BushArgumentTypeCaster, + BushCommand, + type BushGuildMember, + type BushMessage, + type BushRole, + type BushSlashMessage +} from '#lib'; +import { MessageEmbed, Role } from 'discord.js'; import tinycolor from 'tinycolor2'; -const isValidTinyColor = (_message: Message, phase: string) => { +const isValidTinyColor: BushArgumentTypeCaster<string | null> = (_message, phase) => { // if the phase is a number it converts it to hex incase it could be representing a color in decimal const newPhase = isNaN(phase as any) ? phase : `#${Number(phase).toString(16)}`; return tinycolor(newPhase).isValid() ? newPhase : null; @@ -21,7 +28,7 @@ export default class ColorCommand extends BushCommand { { id: 'color', description: 'The color string, role, or member to find the color of.', - customType: Argument.union(isValidTinyColor, 'role', 'member'), + type: util.arg.union(isValidTinyColor as any, 'role', 'member'), readableType: 'color|role|member', match: 'restContent', prompt: 'What color code, role, or user would you like to find the color of?', @@ -41,7 +48,7 @@ export default class ColorCommand extends BushCommand { public override async exec(message: BushMessage | BushSlashMessage, args: { color: string | BushRole | BushGuildMember }) { const _color = message.util.isSlashMessage(message) - ? ((await util.arg.cast(Argument.union(isValidTinyColor, 'role', 'member'), message, args.color as string)) as + ? ((await util.arg.cast(util.arg.union(isValidTinyColor as any, 'role', 'member'), message, args.color as string)) as | string | BushRole | BushGuildMember) diff --git a/src/commands/info/guildInfo.ts b/src/commands/info/guildInfo.ts index a38a446..ab09741 100644 --- a/src/commands/info/guildInfo.ts +++ b/src/commands/info/guildInfo.ts @@ -21,7 +21,7 @@ export default class GuildInfoCommand extends BushCommand { { id: 'guild', description: 'The guild to find information about.', - customType: util.arg.union('guild', 'snowflake'), + type: util.arg.union('guild', 'snowflake'), readableType: 'guild|snowflake', prompt: 'What server would you like to find information about?', retry: '{error} Choose a valid server to find information about.', diff --git a/src/commands/info/userInfo.ts b/src/commands/info/userInfo.ts index 89d3c23..2d7fcfb 100644 --- a/src/commands/info/userInfo.ts +++ b/src/commands/info/userInfo.ts @@ -14,7 +14,7 @@ export default class UserInfoCommand extends BushCommand { { id: 'user', description: 'The user you would like to find information about.', - customType: util.arg.union('user', 'snowflake'), + type: util.arg.union('user', 'snowflake'), readableType: 'user|snowflake', prompt: 'What user would you like to find information about?', retry: '{error} Choose a valid user to find information about.', |