mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-18 04:23:31 +01:00
fix(Message): properly compare attachments and embeds (#10282)
* fix(Message): properly compare `attachments` and `embeds` * refactor: use `has` instead of `get` * refactor: keep length checks --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
@@ -973,10 +973,12 @@ class Message extends Base {
|
|||||||
this.id === message.id &&
|
this.id === message.id &&
|
||||||
this.author.id === message.author.id &&
|
this.author.id === message.author.id &&
|
||||||
this.content === message.content &&
|
this.content === message.content &&
|
||||||
this.tts === message.tts &&
|
|
||||||
this.nonce === message.nonce &&
|
this.nonce === message.nonce &&
|
||||||
|
this.tts === message.tts &&
|
||||||
|
this.attachments.size === message.attachments.size &&
|
||||||
this.embeds.length === message.embeds.length &&
|
this.embeds.length === message.embeds.length &&
|
||||||
this.attachments.length === message.attachments.length;
|
this.attachments.every(attachment => message.attachments.has(attachment.id)) &&
|
||||||
|
this.embeds.every((embed, index) => embed.equals(message.embeds[index]));
|
||||||
|
|
||||||
if (equal && rawData) {
|
if (equal && rawData) {
|
||||||
equal =
|
equal =
|
||||||
|
|||||||
Reference in New Issue
Block a user