Skip to content

Commit

Permalink
fix(Message): properly compare attachments and embeds (#10282)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
sdanialraza and kodiakhq[bot] authored May 24, 2024
1 parent 638b896 commit a468ae8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/discord.js/src/structures/Message.js
Original file line number Diff line number Diff line change
Expand Up @@ -973,10 +973,12 @@ class Message extends Base {
this.id === message.id &&
this.author.id === message.author.id &&
this.content === message.content &&
this.tts === message.tts &&
this.nonce === message.nonce &&
this.tts === message.tts &&
this.attachments.size === message.attachments.size &&
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) {
equal =
Expand Down

0 comments on commit a468ae8

Please sign in to comment.