mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 08:33:30 +01:00
fix: do not cache webhook users (#2611)
Goal in mind is to not save the name and avatar used by webhooks because those can change between messages without any other update.
This commit is contained in:
@@ -39,10 +39,10 @@ class ClientDataManager {
|
||||
return guild;
|
||||
}
|
||||
|
||||
newUser(data) {
|
||||
newUser(data, cache = true) {
|
||||
if (this.client.users.has(data.id)) return this.client.users.get(data.id);
|
||||
const user = new User(this.client, data);
|
||||
this.client.users.set(user.id, user);
|
||||
if (cache) this.client.users.set(user.id, user);
|
||||
return user;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user