Skip to content

Commit

Permalink
fix(Message): review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ckohen committed Jul 8, 2021
1 parent a32b35c commit e7ae4f5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/structures/Message.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ class Message extends Base {
* A collection of attachments in the message - e.g. Pictures - mapped by their ids
* @type {Collection<Snowflake, MessageAttachment>}
*/
this.attachments = partial && this.attachments ? new Collection(this.attachments) : new Collection();
this.attachments =
partial && !data.attachments && this.attachments ? new Collection(this.attachments) : new Collection();
if (data.attachments) {
for (const attachment of data.attachments) {
this.attachments.set(attachment.id, new MessageAttachment(attachment.url, attachment.filename, attachment));
Expand Down Expand Up @@ -259,7 +260,7 @@ class Message extends Base {
* Flags that are applied to the message
* @type {Readonly<MessageFlags>}
*/
this.flags = new MessageFlags(partial ? data.flags ?? 0 : data.flags).freeze();
this.flags = new MessageFlags(partial ? data.flags ?? this.flags : data.flags).freeze();

/**
* Reference data sent in a message that contains ids identifying the referenced message
Expand Down

0 comments on commit e7ae4f5

Please sign in to comment.