From b3220fa1550e7b9b61479a690c329291c2608fdb Mon Sep 17 00:00:00 2001 From: mierenmanz Date: Thu, 29 Apr 2021 11:05:31 +0200 Subject: [PATCH] don't assume that the first string found is a mention --- src/utils/command.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/utils/command.ts b/src/utils/command.ts index 4e963ee..11fe653 100644 --- a/src/utils/command.ts +++ b/src/utils/command.ts @@ -55,7 +55,9 @@ function parseMention( entry: Args, argsNullable: Array ): void { - const index = argsNullable.findIndex((x) => typeof x === 'string') + const index = argsNullable.findIndex( + (x) => typeof x === 'string' && x.includes('<@!') + ) const regexMatches = MessageMentions.USER_MENTION.exec(argsNullable[index]!) args[entry.name] = regexMatches !== null