From 58ad6fcd3d59c388c7350d063c9b1ccc6087864a Mon Sep 17 00:00:00 2001 From: mierenmanz Date: Wed, 28 Apr 2021 15:09:39 +0200 Subject: [PATCH] misc changes --- src/utils/command.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/utils/command.ts b/src/utils/command.ts index e604427..d4b699f 100644 --- a/src/utils/command.ts +++ b/src/utils/command.ts @@ -1,14 +1,15 @@ +import { MessageMentions } from "../structures/messageMentions.ts"; export type CommandArgumentMatchTypes = 'flag' | 'mention' | 'content' | 'rest' export interface Args { name: string match: CommandArgumentMatchTypes - type?: unknown // Still needs to be implemented - defaultValue?: unknown // Still needs to be implemented + // Still needs to be implemented + // type?: unknown + defaultValue?: string; flag?: string } -const mentionRegex = /([0-9]{18})/g export function parseArgs( commandArgs: Args[] | undefined, @@ -56,7 +57,7 @@ function parseMention( argsNullable: Array ): void { const index = argsNullable.findIndex((x) => typeof x === 'string') - const mention = mentionRegex.exec(argsNullable[index]!)![0] + const mention = MessageMentions.USER_MENTION.exec(argsNullable[index]!)![0] argsNullable[index] = null args[entry.name] = mention }