mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 20:13:30 +01:00
Fix Guild.equals (#1713)
This commit is contained in:
@@ -1094,23 +1094,24 @@ class Guild {
|
|||||||
equals(guild) {
|
equals(guild) {
|
||||||
let equal =
|
let equal =
|
||||||
guild &&
|
guild &&
|
||||||
|
guild instanceof this.constructor &&
|
||||||
this.id === guild.id &&
|
this.id === guild.id &&
|
||||||
this.available === !guild.unavailable &&
|
this.available === guild.available &&
|
||||||
this.splash === guild.splash &&
|
this.splash === guild.splash &&
|
||||||
this.region === guild.region &&
|
this.region === guild.region &&
|
||||||
this.name === guild.name &&
|
this.name === guild.name &&
|
||||||
this.memberCount === guild.member_count &&
|
this.memberCount === guild.memberCount &&
|
||||||
this.large === guild.large &&
|
this.large === guild.large &&
|
||||||
this.icon === guild.icon &&
|
this.icon === guild.icon &&
|
||||||
Util.arraysEqual(this.features, guild.features) &&
|
Util.arraysEqual(this.features, guild.features) &&
|
||||||
this.ownerID === guild.owner_id &&
|
this.ownerID === guild.ownerID &&
|
||||||
this.verificationLevel === guild.verification_level &&
|
this.verificationLevel === guild.verificationLevel &&
|
||||||
this.embedEnabled === guild.embed_enabled;
|
this.embedEnabled === guild.embedEnabled;
|
||||||
|
|
||||||
if (equal) {
|
if (equal) {
|
||||||
if (this.embedChannel) {
|
if (this.embedChannel) {
|
||||||
if (this.embedChannel.id !== guild.embed_channel_id) equal = false;
|
if (!guild.embedChannel || this.embedChannel.id !== guild.embedChannel.id) equal = false;
|
||||||
} else if (guild.embed_channel_id) {
|
} else if (guild.embedChannel) {
|
||||||
equal = false;
|
equal = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user