mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-15 05:41:51 +00:00
Fix occasional error when resolving a user by username
This commit is contained in:
parent
706ccb4fce
commit
0742c19cbb
1 changed files with 1 additions and 1 deletions
|
@ -526,7 +526,7 @@ export async function resolveUser(bot: Client, value: string): Promise<User | Un
|
|||
const usernameMatch = value.match(/^@?([^#]+)#(\d{4})$/);
|
||||
if (usernameMatch) {
|
||||
const user = bot.users.find(u => u.username === usernameMatch[1] && u.discriminator === usernameMatch[2]);
|
||||
userId = user.id;
|
||||
if (user) userId = user.id;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue