From 560ed31860a420dcc43571d2e12dd2f51bcee7a8 Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Wed, 1 Sep 2021 22:19:41 -0400 Subject: cleanup --- src/commands/info/color.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/commands/info') 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.' -- cgit