Skip to main content

DiscordMessage

@discordeno/bot


Documentation / @discordeno/bot / DiscordMessage

Interface: DiscordMessage

Defined in: packages/types/dist/types/discord/message.d.ts:11

https://discord.com/developers/docs/resources/message#message-object-message-structure

Properties

activity?

optional activity: DiscordMessageActivity

Defined in: packages/types/dist/types/discord/message.d.ts:70

Sent with Rich Presence-related chat embeds


application?

optional application: Partial<DiscordApplication>

Defined in: packages/types/dist/types/discord/message.d.ts:72

Sent with Rich Presence-related chat embeds


application_id?

optional application_id: string

Defined in: packages/types/dist/types/discord/message.d.ts:74

if the message is an Interaction or application-owned webhook, this is the id of the application


attachments

attachments: DiscordAttachment[]

Defined in: packages/types/dist/types/discord/message.d.ts:56

Any attached files


author

author: DiscordUser

Defined in: packages/types/dist/types/discord/message.d.ts:25

The author of this message (not guaranteed to be a valid user) Note: The author object follows the structure of the user object, but is only a valid user in the case where the message is generated by a user or bot user. If the message is generated by a webhook, the author object corresponds to the webhook's id, username, and avatar. You can tell if a message is generated by a webhook by checking for the webhook_id on the message object.


call?

optional call: DiscordMessageCall

Defined in: packages/types/dist/types/discord/message.d.ts:112

The call associated with the message


channel_id

channel_id: string

Defined in: packages/types/dist/types/discord/message.d.ts:15

id of the channel the message was sent in


components?

optional components: DiscordMessageComponents

Defined in: packages/types/dist/types/discord/message.d.ts:104

The components related to this message


content?

optional content: string

Defined in: packages/types/dist/types/discord/message.d.ts:32

Contents of the message


edited_timestamp

edited_timestamp: null | string

Defined in: packages/types/dist/types/discord/message.d.ts:36

When this message was edited (or null if never)


embeds

embeds: DiscordEmbed[]

Defined in: packages/types/dist/types/discord/message.d.ts:58

Any embedded content


flags?

optional flags: MessageFlags

Defined in: packages/types/dist/types/discord/message.d.ts:78

Message flags combined as a bitfield


guild_id?

optional guild_id: string

Defined in: packages/types/dist/types/discord/message.d.ts:20

id of the guild the message was sent in Note: For MESSAGE_CREATE and MESSAGE_UPDATE events, the message object may not contain a guild_id or member field since the events are sent directly to the receiving user and the bot who sent the message, rather than being sent through the guild like non-ephemeral messages.


id

id: string

Defined in: packages/types/dist/types/discord/message.d.ts:13

id of the message


interaction?

optional interaction: DiscordMessageInteraction

Defined in: packages/types/dist/types/discord/message.d.ts:98

Sent if the message is a response to an Interaction

Deprecated

Deprecated in favor of interaction_metadata


interaction_metadata?

optional interaction_metadata: DiscordMessageInteractionMetadata

Defined in: packages/types/dist/types/discord/message.d.ts:92

sent if the message is sent as a result of an interaction


member?

optional member: DiscordMember

Defined in: packages/types/dist/types/discord/message.d.ts:30

Member properties for this message's author Note: The member object exists in MESSAGE_CREATE and MESSAGE_UPDATE events from text-based guild channels. This allows bots to obtain real-time member data without requiring bots to store member state in memory.


mention_channels?

optional mention_channels: DiscordChannelMention[]

Defined in: packages/types/dist/types/discord/message.d.ts:54

Channels specifically mentioned in this message Note: Not all channel mentions in a message will appear in mention_channels. Only textual channels that are visible to everyone in a discoverable guild will ever be included. Only crossposted messages (via Channel Following) currently include mention_channels at all. If no mentions in the message meet these requirements, this field will not be sent.


mention_everyone

mention_everyone: boolean

Defined in: packages/types/dist/types/discord/message.d.ts:40

Whether this message mentions everyone


mention_roles?

optional mention_roles: string[]

Defined in: packages/types/dist/types/discord/message.d.ts:49

Roles specifically mentioned in this message


mentions

mentions: DiscordUser & object[]

Defined in: packages/types/dist/types/discord/message.d.ts:45

Users specifically mentioned in the message Note: The user objects in the mentions array will only have the partial member field present in MESSAGE_CREATE and MESSAGE_UPDATE events from text-based guild channels.


message_reference?

optional message_reference: Omit<DiscordMessageReference, "failIfNotExists">

Defined in: packages/types/dist/types/discord/message.d.ts:76

Data showing the source of a crosspost, channel follow add, pin, or reply message


message_snapshots?

optional message_snapshots: DiscordMessageSnapshot[]

Defined in: packages/types/dist/types/discord/message.d.ts:90

The message associated with the message_reference. This is a minimal subset of fields in a message (e.g. author is excluded.)


nonce?

optional nonce: string | number

Defined in: packages/types/dist/types/discord/message.d.ts:62

Used for validating a message was sent


pinned

pinned: boolean

Defined in: packages/types/dist/types/discord/message.d.ts:64

Whether this message is pinned


poll?

optional poll: DiscordPoll

Defined in: packages/types/dist/types/discord/message.d.ts:110

The poll object


position?

optional position: number

Defined in: packages/types/dist/types/discord/message.d.ts:108

A generally increasing integer (there may be gaps or duplicates) that represents the approximate position of the message in a thread, it can be used to estimate the relative position of the message in a thread in company with total_message_sent on parent thread


reactions?

optional reactions: DiscordReaction[]

Defined in: packages/types/dist/types/discord/message.d.ts:60

Reactions to the message


referenced_message?

optional referenced_message: DiscordMessage

Defined in: packages/types/dist/types/discord/message.d.ts:88

The message associated with the 'message_reference' Note: This field is only returned for messages with a 'type' of '19', '21', or '23'. If the message is one of these but the 'referenced_message' field is not present, the backend did not attempt to fetch the message that was being replied to, so its state is unknown. If the field exists but is null, the referenced message was deleted.


sticker_items?

optional sticker_items: DiscordStickerItem[]

Defined in: packages/types/dist/types/discord/message.d.ts:106

Sent if the message contains stickers


stickers?

optional stickers: DiscordSticker[]

Defined in: packages/types/dist/types/discord/message.d.ts:83

The stickers sent with the message (bots currently can only receive messages with stickers, not send)

Deprecated


thread?

optional thread: Omit<DiscordChannel, "member"> & object

Defined in: packages/types/dist/types/discord/message.d.ts:100

The thread that was started from this message, includes thread member object

Type declaration

member

member: DiscordThreadMember


timestamp

timestamp: string

Defined in: packages/types/dist/types/discord/message.d.ts:34

When this message was sent


tts

tts: boolean

Defined in: packages/types/dist/types/discord/message.d.ts:38

Whether this was a TTS message


type

type: MessageTypes

Defined in: packages/types/dist/types/discord/message.d.ts:68

Type of message


webhook_id?

optional webhook_id: string

Defined in: packages/types/dist/types/discord/message.d.ts:66

If the message is generated by a webhook, this is the webhook's id