DiscordMessage
@discordeno/bot • Docs
Documentation / @discordeno/bot / DiscordMessage
Interface: DiscordMessage
https://discord.com/developers/docs/resources/channel#message-object
Properties
activity?
optional
activity:DiscordMessageActivity
Sent with Rich Presence-related chat embeds
Defined in
packages/types/dist/types/discord.d.ts:1271
application?
optional
application:Partial
<DiscordApplication
>
Sent with Rich Presence-related chat embeds
Defined in
packages/types/dist/types/discord.d.ts:1273
application_id?
optional
application_id:string
if the message is an Interaction or application-owned webhook, this is the id of the application
Defined in
packages/types/dist/types/discord.d.ts:1275
attachments
attachments:
DiscordAttachment
[]
Any attached files
Defined in
packages/types/dist/types/discord.d.ts:1257
author
author:
DiscordUser
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.
Defined in
packages/types/dist/types/discord.d.ts:1226
call?
optional
call:DiscordMessageCall
The call associated with the message
Defined in
packages/types/dist/types/discord.d.ts:1313
channel_id
channel_id:
string
id of the channel the message was sent in
Defined in
packages/types/dist/types/discord.d.ts:1216
components?
optional
components:DiscordMessageComponents
The components related to this message
Defined in
packages/types/dist/types/discord.d.ts:1305
content?
optional
content:string
Contents of the message
Defined in
packages/types/dist/types/discord.d.ts:1233
edited_timestamp
edited_timestamp:
null
|string
When this message was edited (or null if never)
Defined in
packages/types/dist/types/discord.d.ts:1237
embeds
embeds:
DiscordEmbed
[]
Any embedded content
Defined in
packages/types/dist/types/discord.d.ts:1259
flags?
optional
flags:MessageFlags
Message flags combined as a bitfield
Defined in
packages/types/dist/types/discord.d.ts:1279
guild_id?
optional
guild_id:string
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.
Defined in
packages/types/dist/types/discord.d.ts:1221
id
id:
string
id of the message
Defined in
packages/types/dist/types/discord.d.ts:1214
interaction?
optional
interaction:DiscordMessageInteraction
Sent if the message is a response to an Interaction
Deprecated
Deprecated in favor of interaction_metadata
Defined in
packages/types/dist/types/discord.d.ts:1299
interaction_metadata?
optional
interaction_metadata:DiscordMessageInteractionMetadata
sent if the message is sent as a result of an interaction
Defined in
packages/types/dist/types/discord.d.ts:1293
member?
optional
member:DiscordMember
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.
Defined in
packages/types/dist/types/discord.d.ts:1231
mention_channels?
optional
mention_channels:DiscordChannelMention
[]
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.
Defined in
packages/types/dist/types/discord.d.ts:1255
mention_everyone
mention_everyone:
boolean
Whether this message mentions everyone
Defined in
packages/types/dist/types/discord.d.ts:1241
mention_roles?
optional
mention_roles:string
[]
Roles specifically mentioned in this message
Defined in
packages/types/dist/types/discord.d.ts:1250
mentions
mentions:
DiscordUser
&object
[]
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.
Defined in
packages/types/dist/types/discord.d.ts:1246
message_reference?
optional
message_reference:Omit
<DiscordMessageReference
,"failIfNotExists"
>
Data showing the source of a crosspost, channel follow add, pin, or reply message
Defined in
packages/types/dist/types/discord.d.ts:1277
message_snapshots?
optional
message_snapshots:DiscordMessageSnapshot
[]
The message associated with the message_reference
. This is a minimal subset of fields in a message (e.g. author
is excluded.)
Defined in
packages/types/dist/types/discord.d.ts:1291
nonce?
optional
nonce:string
|number
Used for validating a message was sent
Defined in
packages/types/dist/types/discord.d.ts:1263
pinned
pinned:
boolean
Whether this message is pinned
Defined in
packages/types/dist/types/discord.d.ts:1265
poll?
optional
poll:DiscordPoll
The poll object
Defined in
packages/types/dist/types/discord.d.ts:1311
position?
optional
position:number
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
Defined in
packages/types/dist/types/discord.d.ts:1309
reactions?
optional
reactions:DiscordReaction
[]
Reactions to the message
Defined in
packages/types/dist/types/discord.d.ts:1261
referenced_message?
optional
referenced_message:DiscordMessage
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.
Defined in
packages/types/dist/types/discord.d.ts:1289
sticker_items?
optional
sticker_items:DiscordStickerItem
[]
Sent if the message contains stickers
Defined in
packages/types/dist/types/discord.d.ts:1307
stickers?
optional
stickers:DiscordSticker
[]
The stickers sent with the message (bots currently can only receive messages with stickers, not send)
Deprecated
Defined in
packages/types/dist/types/discord.d.ts:1284
thread?
optional
thread:Omit
<DiscordChannel
,"member"
> &object
The thread that was started from this message, includes thread member object
Type declaration
member
member:
DiscordThreadMember
Defined in
packages/types/dist/types/discord.d.ts:1301
timestamp
timestamp:
string
When this message was sent
Defined in
packages/types/dist/types/discord.d.ts:1235
tts
tts:
boolean
Whether this was a TTS message
Defined in
packages/types/dist/types/discord.d.ts:1239
type
type:
MessageTypes
Type of message
Defined in
packages/types/dist/types/discord.d.ts:1269
webhook_id?
optional
webhook_id:string
If the message is generated by a webhook, this is the webhook's id
Defined in
packages/types/dist/types/discord.d.ts:1267