3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-10 12:25:02 +00:00

fix: check for snowflake before username match in resolveUserId

This commit is contained in:
Dragory 2021-10-26 22:37:26 +03:00
parent 9b805379cf
commit 23fba8cdcf
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1

View file

@ -1280,6 +1280,11 @@ export function resolveUserId(bot: Client, value: string) {
return null;
}
// Just a user ID?
if (isValidSnowflake(value)) {
return value;
}
// A user mention?
const mentionMatch = value.match(/^<@!?(\d+)>$/);
if (mentionMatch) {
@ -1293,11 +1298,6 @@ export function resolveUserId(bot: Client, value: string) {
if (user) return user.id;
}
// Just a user ID?
if (isValidSnowflake(value)) {
return value;
}
return null;
}