From 012dfb14bc0369d8654fef0c510f5f5bd928c802 Mon Sep 17 00:00:00 2001 From: Bsian Date: Wed, 15 Apr 2020 11:15:18 -0400 Subject: [PATCH] Fixes my fix --- src/class/Util.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/class/Util.ts b/src/class/Util.ts index 47d0fa0..c03aec5 100644 --- a/src/class/Util.ts +++ b/src/class/Util.ts @@ -47,9 +47,9 @@ export default class Util { } } - public resolveMember(message: Message, search: string, guild: Guild): Member | undefined { - return members.find((m) => m.mention.replace('!', '') === query.replace('!', '') || `${m.username}#${m.discriminator}` === query || m.username === query || m.id === query || m.nick === query) // Exact match for mention, username+discrim, username and user ID - || members.find((m) => `${m.username.toLowerCase()}#${m.discriminator}` === query.toLowerCase() || m.username.toLowerCase() === query.toLowerCase() || (m.nick && m.nick.toLowerCase() === query.toLowerCase())) // Case insensitive match for username+discrim, username + public resolveMember(query: string, { members}: Guild): Member | undefined { + return members.find((m) => m.mention.replace('!', '') === query.replace('!', '') || `${m.username}#${m.discriminator}` === query || m.username === query || m.id === query || m.nick === query) // Exact match for mention, username+discrim, username and user ID + || members.find((m) => `${m.username.toLowerCase()}#${m.discriminator}` === query.toLowerCase() || m.username.toLowerCase() === query.toLowerCase() || (m.nick && m.nick.toLowerCase() === query.toLowerCase())) // Case insensitive match for username+discrim, username } public async handleError(error: Error, message?: Message, command?: Command): Promise {