From 5799ba28f910771e704f183e94d273ed7a82a584 Mon Sep 17 00:00:00 2001 From: Pg Biel Date: Mon, 31 Jul 2017 23:48:46 -0300 Subject: [PATCH] Fix Guild.equals (#1713) --- src/structures/Guild.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/structures/Guild.js b/src/structures/Guild.js index db8795591..12a0c6fe8 100644 --- a/src/structures/Guild.js +++ b/src/structures/Guild.js @@ -1094,23 +1094,24 @@ class Guild { equals(guild) { let equal = guild && + guild instanceof this.constructor && this.id === guild.id && - this.available === !guild.unavailable && + this.available === guild.available && this.splash === guild.splash && this.region === guild.region && this.name === guild.name && - this.memberCount === guild.member_count && + this.memberCount === guild.memberCount && this.large === guild.large && this.icon === guild.icon && Util.arraysEqual(this.features, guild.features) && - this.ownerID === guild.owner_id && - this.verificationLevel === guild.verification_level && - this.embedEnabled === guild.embed_enabled; + this.ownerID === guild.ownerID && + this.verificationLevel === guild.verificationLevel && + this.embedEnabled === guild.embedEnabled; if (equal) { if (this.embedChannel) { - if (this.embedChannel.id !== guild.embed_channel_id) equal = false; - } else if (guild.embed_channel_id) { + if (!guild.embedChannel || this.embedChannel.id !== guild.embedChannel.id) equal = false; + } else if (guild.embedChannel) { equal = false; } }