fix(Guild): equals method modifying features array of guild (#2544)

* Fixed a bug where Guild#equals would cause the given guild to lose its features

* Fix Util.arraysEqual

* Fixed docs for Util.arraysEqual

* Remove Util.arraysEqual
This commit is contained in:
Kyra
2018-05-29 11:15:19 +02:00
committed by SpaceEEC
parent 30c7d6d1b1
commit d02c303afd
2 changed files with 5 additions and 21 deletions

View File

@@ -944,10 +944,13 @@ class Guild extends Base {
this.memberCount === guild.memberCount &&
this.large === guild.large &&
this.icon === guild.icon &&
Util.arraysEqual(this.features, guild.features) &&
this.ownerID === guild.ownerID &&
this.verificationLevel === guild.verificationLevel &&
this.embedEnabled === guild.embedEnabled;
this.embedEnabled === guild.embedEnabled &&
(this.features === guild.features || (
this.features.length === guild.features.length &&
this.features.every((feat, i) => feat === guild.features[i]))
);
if (equal) {
if (this.embedChannel) {