Skip to main content
Module

x/denord/mod.ts>Message

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

Properties

id of the message

channelId: ChannelId

id of the channel the message was sent in

optional
guildId: GuildId

id of the guild the message was sent in

author: User

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 webhookId on the message object.

optional
member: Partial<GuildMember>

member properties for this message's author

The member object exists in MESSAGECREATE and MESSAGEUPDATE 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: Date

when this message was sent

editedTimestamp: Date

when this message was edited (or null if never)

tts: boolean

whether this was a TTS message

mentionEveryone: boolean

whether this message mentions everyone

mentions: Array<User & { member: Partial<GuildMember>; }>

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 MESSAGECREATE and MESSAGEUPDATE events from text-based guild channels.

mentionRoles: RoleId[]

roles specifically mentioned in this message

optional
mentionChannels: ChannelMention[]

channels specifically mentioned in this message

Not all channel mentions in a message will appear in mentionChannels. Only textual channels that are visible to everyone in a lurkable guild will ever be included. Only crossposted messages (via Channel Following) currently include mentionChannels at all. If no mentions in the message meet these requirements, this field will not be sent.

attachments: Attachment[]

any attached files

embeds: Embed[]

any embedded content

optional
reactions: Reaction[]

reactions to the message

optional
nonce: integer | string

used for validating a message was sent

pinned: boolean

whether this message is pinned

optional
webhookId: WebhookId

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

type: integer

type of message

optional
activity: MessageActivity

sent with Rich Presence-related chat embeds

optional
application: MessageApplication

sent with Rich Presence-related chat embeds

optional
messageReference: MessageReference

reference data sent with crossposted messages

optional
flags: MessageFlag

message flags ORd together, describes extra features of the message