From 0c789f66291b3389c302c724d94283cf4e546d62 Mon Sep 17 00:00:00 2001 From: Matthew R Date: Wed, 15 Apr 2020 23:03:07 -0400 Subject: [PATCH] fix issues relating to recent merged MR --- src/class/Util.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/class/Util.ts b/src/class/Util.ts index c218a83..1c6d3e9 100644 --- a/src/class/Util.ts +++ b/src/class/Util.ts @@ -51,7 +51,7 @@ export default class Util { } public resolveGuildChannel(query: string, { channels }: Guild): AnyGuildChannel | undefined { - const nchannels = channels.map(c => c).sort((a: AnyGuildChannel, b: AnyGuildChannel) => a.type - b.type); + const nchannels = channels.map((c) => c).sort((a: AnyGuildChannel, b: AnyGuildChannel) => a.type - b.type); return nchannels.find((c) => (c.id === query || c.name === query || c.name.toLowerCase() === query.toLowerCase() || c.name.toLowerCase().startsWith(query.toLowerCase()))); } @@ -60,7 +60,7 @@ 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 === queries || m.id === query || m.nick === query) // Exact match for mention, username+discrim, username and user ID + 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().startsWith(query.toLowerCase()) || (m.nick && m.nick.toLowerCase().startsWith(query.toLowerCase()))); }