fix: GuildMemberStore now patches existing members (#1870)

This commit is contained in:
Amish Shah
2018-08-13 16:02:05 +01:00
parent 180813d3e8
commit 332e30d31e

View File

@@ -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;
}
/**