Skip to main content

DiscordMessage

@discordeno/bot


Documentation / @discordeno/bot / DiscordMessage

Interface: DiscordMessage

Defined in: packages/types/dist/types/discord.d.ts:1215

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

Properties

activity?

optional activity: DiscordMessageActivity

Defined in: packages/types/dist/types/discord.d.ts:1274

Sent with Rich Presence-related chat embeds


application?

optional application: Partial<DiscordApplication>

Defined in: packages/types/dist/types/discord.d.ts:1276

Sent with Rich Presence-related chat embeds


application_id?

optional application_id: string

Defined in: packages/types/dist/types/discord.d.ts:1278

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.d.ts:1260

Any attached files


author

author: DiscordUser

Defined in: packages/types/dist/types/discord.d.ts:1229

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.d.ts:1316

The call associated with the message


channel_id

channel_id: string

Defined in: packages/types/dist/types/discord.d.ts:1219

id of the channel the message was sent in


components?

optional components: DiscordMessageComponents

Defined in: packages/types/dist/types/discord.d.ts:1308

The components related to this message


content?

optional content: string

Defined in: packages/types/dist/types/discord.d.ts:1236

Contents of the message


edited_timestamp

edited_timestamp: null | string

Defined in: packages/types/dist/types/discord.d.ts:1240

When this message was edited (or null if never)


embeds

embeds: DiscordEmbed[]

Defined in: packages/types/dist/types/discord.d.ts:1262

Any embedded content


flags?

optional flags: MessageFlags

Defined in: packages/types/dist/types/discord.d.ts:1282

Message flags combined as a bitfield


guild_id?

optional guild_id: string

Defined in: packages/types/dist/types/discord.d.ts:1224

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.d.ts:1217

id of the message


interaction?

optional interaction: DiscordMessageInteraction

Defined in: packages/types/dist/types/discord.d.ts:1302

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.d.ts:1296

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


member?

optional member: DiscordMember

Defined in: packages/types/dist/types/discord.d.ts:1234

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.d.ts:1258

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.d.ts:1244

Whether this message mentions everyone


mention_roles?

optional mention_roles: string[]

Defined in: packages/types/dist/types/discord.d.ts:1253

Roles specifically mentioned in this message


mentions

mentions: DiscordUser & object[]

Defined in: packages/types/dist/types/discord.d.ts:1249

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.d.ts:1280

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.d.ts:1294

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.d.ts:1266

Used for validating a message was sent


pinned

pinned: boolean

Defined in: packages/types/dist/types/discord.d.ts:1268

Whether this message is pinned


poll?

optional poll: DiscordPoll

Defined in: packages/types/dist/types/discord.d.ts:1314

The poll object


position?

optional position: number

Defined in: packages/types/dist/types/discord.d.ts:1312

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.d.ts:1264

Reactions to the message


referenced_message?

optional referenced_message: DiscordMessage

Defined in: packages/types/dist/types/discord.d.ts:1292

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.d.ts:1310

Sent if the message contains stickers


stickers?

optional stickers: DiscordSticker[]

Defined in: packages/types/dist/types/discord.d.ts:1287

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.d.ts:1304

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.d.ts:1238

When this message was sent


tts

tts: boolean

Defined in: packages/types/dist/types/discord.d.ts:1242

Whether this was a TTS message


type

type: MessageTypes

Defined in: packages/types/dist/types/discord.d.ts:1272

Type of message


webhook_id?

optional webhook_id: string

Defined in: packages/types/dist/types/discord.d.ts:1270

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