Formatting
parent
012dfb14bc
commit
28fc40763a
|
@ -47,7 +47,7 @@ export default class Util {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public resolveMember(query: string, { members}: Guild): Member | undefined {
|
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
|
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
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue