AV HAS BUG???

This commit is contained in:
Neko Life 2021-06-29 14:50:17 +09:00
parent 2e28c90c9e
commit 9734ba8f23

View file

@ -39,12 +39,14 @@ module.exports = class avatar extends commando.Command {
for (const theAvThis of args) { for (const theAvThis of args) {
let avThis = theAvThis.replace(/(?<!\\)--s +\d+/, ""); let avThis = theAvThis.replace(/(?<!\\)--s +\d+/, "");
let uID = cleanMentionID(avThis.trim()); let uID = cleanMentionID(avThis.trim());
if (uID.length > 0) { if (uID?.length > 0) {
let ree = []; let ree = [];
if (/^\d{17,19}$/.test(uID)) { if (/^\d{17,19}$/.test(uID)) {
const findmem = msg.guild?.member(uID); const findmem = msg.guild?.member(uID);
if (findmem) ree.push(findmem.user); else this.client.users.fetch(uID).then(fetchUser => ree.push(fetchUser)).catch(() => {}); console.log(findmem);
if (findmem) ree.push(findmem.user); else await this.client.users.fetch(uID).then(fetchUser => ree.push(fetchUser)).catch(() => { });
} else ree = findMemberRegEx(msg, uID).map(r => r.user); } else ree = findMemberRegEx(msg, uID).map(r => r.user);
console.log(ree);
if (ree.length > 0) { if (ree.length > 0) {
const duplicateRes = dupliCheck.findIndex(yes => yes === ree[0].id); const duplicateRes = dupliCheck.findIndex(yes => yes === ree[0].id);
if (duplicateRes !== -1) { if (duplicateRes !== -1) {