Skip to main content
Module

x/denord/raw/RawMessage.ts>RawMessage

🗣 Discord API module
Latest
interface RawMessage
import { type RawMessage } from "https://deno.land/x/denord@0.1.0/raw/RawMessage.ts";

Properties

id of the message

channel_id: ChannelId

id of the channel the message was sent in

optional
guild_id: GuildId

id of the guild the message was sent in

author: RawUser

the author of this message (not guaranteed to be a valid user, see below)

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.

optional
member: Partial<RawGuildMember>

member properties for this message's author

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.

content: string

contents of the message

timestamp: ISO8601Timestamp

when this message was sent

edited_timestamp: ISO8601Timestamp

when this message was edited (or null if never)

tts: boolean

whether this was a TTS message

mention_everyone: boolean

whether this message mentions everyone

mentions: Array<RawUser & { member: Partial<RawGuildMember>; }>

users specifically mentioned in the message array of user objects, with an additional partial member field

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.

mention_roles: RoleId[]

roles specifically mentioned in this message

optional
mention_channels: RawChannelMention[]

channels specifically mentioned in this message

Not all channel mentions in a message will appear in mention_channels. Only textual channels that are visible to everyone in a lurkable 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.

attachments: RawAttachment[]

any attached files

embeds: RawEmbed[]

any embedded content

optional
reactions: RawReaction[]

reactions to the message

optional
nonce: integer | string

used for validating a message was sent

pinned: boolean

whether this message is pinned

optional
webhook_id: WebhookId

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

type: integer

type of message

optional
activity: RawMessageActivity

sent with Rich Presence-related chat embeds

optional
application: RawMessageApplication

sent with Rich Presence-related chat embeds

optional
message_reference: RawMessageReference

reference data sent with crossposted messages

optional
flags: MessageFlag

message flags ORd together, describes extra features of the message