mirror of
https://github.com/danbulant/discord.js
synced 2026-05-27 14:02:02 +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;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue