Skip to main content

DiscordMessage

Documentation


Documentation / @discordeno/types / DiscordMessage

Interface: DiscordMessage

Defined in: discord/message.ts:19

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

Extends

Extended by

Properties

activity?

optional activity?: DiscordMessageActivity

Defined in: discord/message.ts:67

Sent with Rich Presence-related chat embeds


application?

optional application?: Partial<DiscordApplication>

Defined in: discord/message.ts:69

Sent with Rich Presence-related chat embeds


application_id?

optional application_id?: string

Defined in: discord/message.ts:71

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


attachments

attachments: DiscordAttachment[]

Defined in: discord/message.ts:53

Any attached files


author

author: DiscordUser

Defined in: discord/message.ts:30

The author of this message (not guaranteed to be a valid user)

Remarks

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: discord/message.ts:113

The call associated with the message


channel_id

channel_id: string

Defined in: discord/message.ts:23

id of the channel the message was sent in


components?

optional components?: DiscordMessageComponents

Defined in: discord/message.ts:96

The components related to this message


content

content: string

Defined in: discord/message.ts:32

Contents of the message


edited_timestamp

edited_timestamp: string | null

Defined in: discord/message.ts:36

When this message was edited (or null if never)


embeds

embeds: DiscordEmbed[]

Defined in: discord/message.ts:55

Any embedded content


flags?

optional flags?: MessageFlags

Defined in: discord/message.ts:73

Message flags combined as a bitfield


guild_id?

optional guild_id?: string

Defined in: discord/gateway.ts:729

ID of the guild the message was sent in - unless it is an ephemeral message

Inherited from

DiscordMessageCreateExtra.guild_id


id

id: string

Defined in: discord/message.ts:21

id of the message


interaction?

optional interaction?: DiscordMessageInteraction

Defined in: discord/message.ts:92

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: discord/message.ts:86

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


member?

optional member?: Partial<DiscordMemberWithUser>

Defined in: discord/gateway.ts:731

Member properties for this message's author. Missing for ephemeral messages and messages from webhooks

Inherited from

DiscordMessageCreateExtra.member


mention_channels?

optional mention_channels?: DiscordChannelMention[]

Defined in: discord/message.ts:51

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: discord/message.ts:40

Whether this message mentions everyone


mention_roles

mention_roles: string[]

Defined in: discord/message.ts:46

Roles specifically mentioned in this message


mentions?

optional mentions?: DiscordUser & object[]

Defined in: discord/gateway.ts:733

Users specifically mentioned in the message

Inherited from

DiscordMessageCreateExtra.mentions


message_reference?

optional message_reference?: Omit<DiscordMessageReference, "failIfNotExists">

Defined in: discord/message.ts:75

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


message_snapshots?

optional message_snapshots?: DiscordMessageSnapshot[]

Defined in: discord/message.ts:77

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: discord/message.ts:59

Used for validating a message was sent


pinned

pinned: boolean

Defined in: discord/message.ts:61

Whether this message is pinned


poll?

optional poll?: DiscordPoll

Defined in: discord/message.ts:111

The poll object


position?

optional position?: number

Defined in: discord/message.ts:105

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: discord/message.ts:57

Reactions to the message


referenced_message?

optional referenced_message?: DiscordMessage | null

Defined in: discord/message.ts:84

The message associated with the 'message_reference'

Remarks

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.


resolved?

optional resolved?: DiscordInteractionDataResolved

Defined in: discord/message.ts:109

data for users, members, channels, and roles referenced in this message


role_subscription_data?

optional role_subscription_data?: DiscordRoleSubscriptionData

Defined in: discord/message.ts:107

data of the role subscription purchase or renewal that prompted this ROLE_SUBSCRIPTION_PURCHASE message


sticker_items?

optional sticker_items?: DiscordStickerItem[]

Defined in: discord/message.ts:98

Sent if the message contains stickers


stickers?

optional stickers?: DiscordSticker[]

Defined in: discord/message.ts:103

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: discord/message.ts:94

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

Type Declaration

member

member: DiscordThreadMember


timestamp

timestamp: string

Defined in: discord/message.ts:34

When this message was sent


tts

tts: boolean

Defined in: discord/message.ts:38

Whether this was a TTS message


type

type: MessageTypes

Defined in: discord/message.ts:65

Type of message


webhook_id?

optional webhook_id?: string

Defined in: discord/message.ts:63

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