Interface

APIMessage

Full message object from GET /channels/{id}/messages, POST /channels/{id}/messages, PATCH, or gateway MESSAGE_CREATE.

Properties

attachments?: APIMessageAttachment[] | null

File attachments.

author: APIUser

Author of the message.

call?: APIMessageCall | null

Call info when type is MessageType.

channel_id: Snowflake

Channel containing the message.

content: string

Message text content.

edited_timestamp: string | null

ISO-8601 timestamp when the message was last edited (null if never edited).

embeds?: APIEmbed[] | null

Embeds attached to the message.

flags: number

MessageFlags bitfield (see MessageFlags).

guild_id?: Snowflake | null

Guild containing the message (if guild message).

Message ID.

member?: APIGuildMember | null

Author's guild member object (gateway MESSAGE_CREATE only, when guild message).

mention_everyone?: boolean

Whether the message mentions @everyone or @here.

mention_roles?: Snowflake[] | null

Role IDs mentioned in the message.

mentions?: APIUser[] | null

Users mentioned in the message.

message_reference?: APIMessageReference | null

Reply/forward reference (see APIMessageReference).

message_snapshots?: APIMessageSnapshot[] | null

Snapshots of forwarded messages.

nonce?: string | null

Client-generated unique ID for deduplication.

pinned: boolean

Whether the message is pinned.

reactions?: APIMessageReaction[] | null

Reactions to the message.

referenced_message?: APIMessage | null

Referenced message (for replies, when available).

stickers?: APIMessageSticker[] | null

Stickers in the message.

timestamp: string

ISO-8601 timestamp when the message was sent.

tts?: boolean

Whether the message is text-to-speech.

Message type (see MessageType).

webhook_id?: Snowflake | null

Webhook ID if message was sent by a webhook.