mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-15 11:03:30 +01:00
fix: GuildMemberStore now works with custom structures again
This commit is contained in:
@@ -15,11 +15,7 @@ class GuildMemberStore extends DataStore {
|
|||||||
}
|
}
|
||||||
|
|
||||||
add(data, cache = true) {
|
add(data, cache = true) {
|
||||||
const existing = this.get(data.user.id);
|
return super.add(data, cache, { id: data.user.id, extras: [this.guild] });
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -164,7 +164,9 @@ class Message extends Base {
|
|||||||
*/
|
*/
|
||||||
this._edits = [];
|
this._edits = [];
|
||||||
|
|
||||||
if (data.member && this.guild && this.author) {
|
if (this.member) {
|
||||||
|
this.member._patch(data.member);
|
||||||
|
} else if (data.member && this.guild && this.author) {
|
||||||
this.guild.members.add(Object.assign(data.member, { user: this.author }));
|
this.guild.members.add(Object.assign(data.member, { user: this.author }));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user