mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-14 10:33:30 +01:00
fix: GuildMemberStore now patches existing members (#1870)
This commit is contained in:
@@ -14,8 +14,12 @@ class GuildMemberStore extends DataStore {
|
|||||||
this.guild = guild;
|
this.guild = guild;
|
||||||
}
|
}
|
||||||
|
|
||||||
add(data, cache) {
|
add(data, cache = true) {
|
||||||
return super.add(data, cache, { extras: [this.guild] });
|
const existing = this.get(data.user.id);
|
||||||
|
if (existing) return existing._patch(data);
|
||||||
|
const entry = new GuildMember(this.client, data, this.guild);
|
||||||
|
if (cache) this.set(data.user.id, entry);
|
||||||
|
return entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user