This commit is contained in:
Erik 2023-12-08 15:42:49 +02:00
parent ddd695084a
commit ec69dd4862

View File

@ -149,14 +149,14 @@ class Resolver
if (typeof resolveable === 'string' && (/<@!?([0-9]{17,21})>/u).test(resolveable))
{
const [ , id ] = resolveable.toString().match(/<@!?([0-9]{17,21})>/u) || [];
const user = await users.fetch(id).catch(null);
const user = await users.fetch(id).catch(() => null);
if (user)
resolved.push(user);
}
else if (typeof resolveable === 'string' && (/(id:)?([0-9]{17,21})/u).test(resolveable))
{
const [ , , id ] = resolveable.toString().match(/(id:)?([0-9]{17,21})/u) || [];
const user = await users.fetch(id).catch(null);
const user = await users.fetch(id).catch(() => null);
if (user)
resolved.push(user);
}
@ -238,14 +238,14 @@ class Resolver
if (typeof resolveable === 'string' && (/<@!?([0-9]{17,21})>/u).test(resolveable))
{
const [ , id ] = resolveable.toString().match(/<@!?([0-9]{17,21})>/u) || [];
const member = await members.fetch(id).catch(null);
const member = await members.fetch(id).catch(() => null);
if (member)
resolved.push(member);
}
else if (typeof resolveable === 'string' && (/(id:)?([0-9]{17,21})/u).test(resolveable))
{
const [ , , id ] = resolveable.toString().match(/(id:)?([0-9]{17,21})/u) || [];
const member = await members.fetch(id).catch(null);
const member = await members.fetch(id).catch(() => null);
if (member)
resolved.push(member);
}