The content of the message. This property requires the privileged intent in a guild for messages that do not mention the client.
Represents a message on Discord.
Extends
BaseName | Constraints | Optional | Default | Description |
---|---|---|---|---|
InGuild | boolean | Yes | boolean | None |
A collection of attachments in the message - e.g. Pictures - mapped by their ids. This property requires the privileged intent in a guild for messages that do not mention the client.
The message contents with all mentions replaced by the equivalent text. If mentions cannot be resolved to a name, the relevant mention in the message content will not be converted.
An array of action rows in the message. This property requires the privileged intent in a guild for messages that do not mention the client.
An array of embeds in the message - e.g. YouTube Player. This property requires the privileged intent in a guild for messages that do not mention the client.
Represents the author of the message as a guild member. Only available if the message comes from a guild where the author is still a member
A random number or string used for checking message delivery This is only received after the message was sent successfully, and lost if re-fetched
A generally increasing integer (there may be gaps or duplicates) that represents the approximate position of the message in a thread.
Whether or not this message was sent by Discord, not actually a user (e.g. pin notifications)
The thread started by this message This property is not suitable for checking whether a message has a thread, use hasThread instead.
Collects a single component interaction that passes the filter. The Promise will reject if the time expires.
Name | Type | Optional | Description |
---|---|---|---|
options | AwaitMessageCollectorOptionsParams<T, InGuild> | Yes | Options to pass to the internal collector |
Similar to createReactionCollector but in promise form. Resolves with a collection of reactions that pass the specified filter.
Name | Type | Optional | Description |
---|---|---|---|
options | AwaitReactionsOptions | Yes | Optional options to pass to the internal collector |
Creates a message component interaction collector.
Name | Type | Optional | Description |
---|---|---|---|
options | MessageCollectorOptionsParams<T, InGuild> | Yes | Options to send to the collector |
Creates a reaction collector.
Name | Type | Optional | Description |
---|---|---|---|
options | ReactionCollectorOptions | Yes | Options to send to the collector |
Publishes a message in an announcement channel to all channels following it.
Deletes the message.
Edits the content of the message.
Name | Type | Optional | Description |
---|---|---|---|
options | string | MessageEditOptions | MessagePayload | No | The options to provide |
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 method allows you to see if there are differences in content, embeds, attachments, nonce and tts properties.Name | Type | Optional | Description |
---|---|---|---|
message | Message | No | The message to compare it to |
rawData | unknown | No | Raw data passed through the WebSocket about this message |
Fetch this message.
Name | Type | Optional | Description |
---|---|---|---|
force | boolean | Yes | Whether to skip the cache check and request the API |
Fetches the Message this crosspost/reply/pin-add references, if available to the client
Fetches the webhook used to create this message.
Whether this message is from a guild.
Pins this message to the channel's pinned messages.
Name | Type | Optional | Description |
---|---|---|---|
reason | string | Yes | Reason for pinning |
Adds a reaction to the message.
Name | Type | Optional | Description |
---|---|---|---|
emoji | EmojiIdentifierResolvable | No | The emoji to react with |
Removes the attachments from this message.
Send an inline reply to this message.
Name | Type | Optional | Description |
---|---|---|---|
options | string | MessagePayload | MessageReplyOptions | No | The options to provide |
Resolves a component by a custom id.
Returns
Name | Type | Optional | Description |
---|---|---|---|
customId | string | No | The custom id to resolve against |
Create a new public thread from this message
Name | Type | Optional | Description |
---|---|---|---|
options | StartThreadOptions | No | Options for starting a thread on this message |
Suppresses or unsuppresses embeds on a message.
Name | Type | Optional | Description |
---|---|---|---|
suppress | boolean | Yes | If the embeds should be suppressed or not |
When concatenated with a string, this automatically concatenates the message's content instead of the object.
Unpins this message from the channel's pinned messages.
Name | Type | Optional | Description |
---|---|---|---|
reason | string | Yes | Reason for unpinning |