mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
fix(Embed): address equals method issue (#10152)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
@@ -211,9 +211,26 @@ class Embed {
|
||||
*/
|
||||
equals(other) {
|
||||
if (other instanceof Embed) {
|
||||
return isEqual(other.data, this.data);
|
||||
return isEqual(this.data, other.data);
|
||||
}
|
||||
return isEqual(other, this.data);
|
||||
|
||||
return (
|
||||
this.author?.iconURL === other.author?.icon_url &&
|
||||
this.author?.name === other.author?.name &&
|
||||
this.author?.url === other.author?.url &&
|
||||
this.color === (other.color ?? null) &&
|
||||
this.description === (other.description ?? null) &&
|
||||
this.footer?.iconURL === other.footer?.icon_url &&
|
||||
this.footer?.text === other.footer?.text &&
|
||||
this.image?.url === other.image?.url &&
|
||||
this.thumbnail?.url === other.thumbnail?.url &&
|
||||
(this.timestamp && Date.parse(this.timestamp)) === (other.timestamp ? Date.parse(other.timestamp) : null) &&
|
||||
this.title === (other.title ?? null) &&
|
||||
this.url === (other.url ?? null) &&
|
||||
this.video?.url === other.video?.url &&
|
||||
isEqual(this.fields, other.fields?.map(field => ({ ...field, inline: field.inline ?? false })) ?? []) &&
|
||||
isEqual(this.provider, other.provider ?? null)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user