mirror of
https://github.com/danbulant/discord.js
synced 2026-06-05 07:42:09 +00:00
fix: GuildMemberStore now patches existing members (#1870)
This commit is contained in:
parent
180813d3e8
commit
332e30d31e
1 changed files with 6 additions and 2 deletions
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue