diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-09-01 22:19:41 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-09-01 22:19:41 -0400 |
commit | 560ed31860a420dcc43571d2e12dd2f51bcee7a8 (patch) | |
tree | 855e0cb50c550bbff63ab675e1102b7608573668 /src/commands/info | |
parent | 855aa36c46e250fd3063eb200d784903a8c388d3 (diff) | |
download | tanzanite-560ed31860a420dcc43571d2e12dd2f51bcee7a8.tar.gz tanzanite-560ed31860a420dcc43571d2e12dd2f51bcee7a8.tar.bz2 tanzanite-560ed31860a420dcc43571d2e12dd2f51bcee7a8.zip |
cleanup
Diffstat (limited to 'src/commands/info')
-rw-r--r-- | src/commands/info/color.ts | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/commands/info/color.ts b/src/commands/info/color.ts index 350c23d..5268516 100644 --- a/src/commands/info/color.ts +++ b/src/commands/info/color.ts @@ -1,13 +1,13 @@ import { AllowedMentions, BushCommand, BushGuildMember, BushMessage, BushRole, BushSlashMessage } from '@lib'; import { Argument } from 'discord-akairo'; import { Message, MessageEmbed, Role } from 'discord.js'; -import { Constructor } from 'tinycolor2'; +import tinycolor from 'tinycolor2'; // this is the only way I got it to work consistently -// eslint-disable-next-line @typescript-eslint/no-var-requires -const tinycolor: Constructor = require('tinycolor2'); // this is the only way I got it to work consistently const isValidTinyColor = (_message: Message, phase: string) => { + console.dir(phase); // if the phase is a number it converts it to hex incase it could be representing a color in decimal - const newPhase = Number.isNaN(phase) ? phase : `#${Number(phase).toString(16)}`; + const newPhase = isNaN(phase as any) ? phase : `#${Number(phase).toString(16)}`; + console.dir(newPhase); return tinycolor(newPhase).isValid() ? newPhase : null; }; @@ -25,6 +25,7 @@ export default class ColorCommand extends BushCommand { { id: 'color', customType: Argument.union(isValidTinyColor, 'role', 'member'), + match: 'restContent', prompt: { start: 'What color code, role, or user would you like to find the color of?', retry: '{error} Choose a valid color, role, or member.' |