mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +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;
|
||||
}
|
||||
|
||||
add(data, cache) {
|
||||
return super.add(data, cache, { extras: [this.guild] });
|
||||
add(data, cache = true) {
|
||||
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