mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-10 04:25:01 +00:00
fix: check for snowflake before username match in resolveUserId
This commit is contained in:
parent
9b805379cf
commit
23fba8cdcf
1 changed files with 5 additions and 5 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue