From 5e65e219d78c903e217291504f1fa12d364970dd Mon Sep 17 00:00:00 2001 From: Navy Date: Mon, 10 Aug 2020 03:00:49 +0300 Subject: [PATCH] dumb bug fix --- structure/client/Resolver.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/structure/client/Resolver.js b/structure/client/Resolver.js index c9b8afb..e6f023c 100644 --- a/structure/client/Resolver.js +++ b/structure/client/Resolver.js @@ -254,13 +254,13 @@ class Resolver { const m = resolveable.match(/^@?([\S\s]{1,32})#([0-9]{4})/u); const username = m[1].toLowerCase(); const discrim = m[2].toLowerCase(); - const user = users.cache.sort((a, b) => a.name.length - b.name.length).filter((u) => u.username.toLowerCase() === username && u.discriminator === discrim).first(); + const user = users.cache.sort((a, b) => a.username.length - b.username.length).filter((u) => u.username.toLowerCase() === username && u.discriminator === discrim).first(); if(user) resolved.push(user); } else if(!strict) { const name = resolveable.toLowerCase(); - const user = users.cache.sort((a, b) => a.name.length - b.name.length).filter((u) => u.username.toLowerCase().includes(name)).first(); + const user = users.cache.sort((a, b) => a.username.length - b.username.length).filter((u) => u.username.toLowerCase().includes(name)).first(); if(user) resolved.push(user); } @@ -330,7 +330,7 @@ class Resolver { } else if((/^@?([\S\s]{1,32})/u).test(resolveable) && guild && !strict) { const nickname = resolveable.match(/^@?([\S\s]{1,32})/u)[0].toLowerCase(); - const member = members.cache.sort((a, b) => a.name.length - b.name.length).filter((m) => m && m.user && + const member = members.cache.sort((a, b) => a.user.username.length - b.user.username.length).filter((m) => m && m.user && ((!m.nickname ? false : m.nickname.toLowerCase() === nickname) || (!m.nickname ? false : m.nickname.toLowerCase().includes(nickname)) || m.user.username.toLowerCase().includes(nickname) ||