From d548b027e18d12c90a220285d0e42fc5986565b0 Mon Sep 17 00:00:00 2001 From: Bsian Date: Wed, 15 Apr 2020 11:26:03 -0400 Subject: [PATCH] Include partial resolver --- src/class/Util.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/class/Util.ts b/src/class/Util.ts index 3be0e8c..600775b 100644 --- a/src/class/Util.ts +++ b/src/class/Util.ts @@ -49,7 +49,8 @@ export default class Util { 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 + || 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 + || members.find((m) => m.username.toLowerCase().includes(query.toLowerCase()) || (m.nick && m.nick.toLowerCase().includes(query.toLowerCase()))) } public async handleError(error: Error, message?: Message, command?: Command): Promise {