mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 16:43:31 +01:00
feat(Message): allow removing attachments (#5557)
This commit is contained in:
@@ -196,6 +196,7 @@ class APIMessage {
|
||||
typeof content === 'undefined' && typeof message_reference === 'undefined' ? undefined : allowedMentions,
|
||||
flags,
|
||||
message_reference,
|
||||
attachments: this.options.attachments,
|
||||
};
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -478,6 +478,7 @@ class Message extends Base {
|
||||
* @property {string|boolean} [code] Language for optional codeblock formatting to apply
|
||||
* @property {MessageMentionOptions} [allowedMentions] Which mentions should be parsed from the message content
|
||||
* @property {MessageFlags} [flags] Which flags to set for the message. Only `SUPPRESS_EMBEDS` can be edited.
|
||||
* @property {MessageAttachment[]} [attachments] The new attachments of the message (can only be removed, not added)
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -656,6 +657,14 @@ class Message extends Base {
|
||||
return this.edit({ flags });
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes the attachments from this message.
|
||||
* @returns {Promise<Message>}
|
||||
*/
|
||||
removeAttachments() {
|
||||
return this.edit({ attachments: [] });
|
||||
}
|
||||
|
||||
/**
|
||||
* Used mainly internally. Whether two messages are identical in properties. If you want to compare messages
|
||||
* without checking all the properties, use `message.id === message2.id`, which is much more efficient. This
|
||||
|
||||
Reference in New Issue
Block a user