fix: add clone methods to GuildMember and GuildMemberRoleStore

Fixes #2312
This adds clone method to both classes to achieve the expected behaviour when cloning a GuildMember, also cloning their roles store
This commit is contained in:
Pascal
2018-01-31 21:04:15 +01:00
parent 9810bdbc5f
commit 32e2dd212e
2 changed files with 12 additions and 0 deletions

View File

@@ -75,6 +75,12 @@ class GuildMember extends Base {
if (data.roles) this.roles._patch(data.roles);
}
_clone() {
const clone = super._clone();
clone.roles = this.roles.clone();
return clone;
}
get voiceState() {
return this._frozenVoiceState || this.guild.voiceStates.get(this.id) || {};
}