Message
Defined in: sdk/js/src/message-object.ts:13
A channel message.
Implements
Section titled “Implements”Message
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Message(
raw):Message
Defined in: sdk/js/src/message-object.ts:32
Parameters
Section titled “Parameters”Message
Returns
Section titled “Returns”Message
Properties
Section titled “Properties”attachments
Section titled “attachments”
readonlyattachments:Attachment[]
Defined in: sdk/js/src/message-object.ts:29
Implementation of
Section titled “Implementation of”wit.Message.attachments
authorId
Section titled “authorId”
readonlyauthorId:string
Defined in: sdk/js/src/message-object.ts:17
Implementation of
Section titled “Implementation of”wit.Message.authorId
channelId
Section titled “channelId”
readonlychannelId:string
Defined in: sdk/js/src/message-object.ts:15
Implementation of
Section titled “Implementation of”wit.Message.channelId
components
Section titled “components”
readonlycomponents:Component[]
Defined in: sdk/js/src/message-object.ts:23
Implementation of
Section titled “Implementation of”wit.Message.components
content
Section titled “content”
readonlycontent:string
Defined in: sdk/js/src/message-object.ts:21
Empty when the bot lacks message_content (unless it is mentioned).
Implementation of
Section titled “Implementation of”wit.Message.content
createdAt
Section titled “createdAt”
readonlycreatedAt:bigint
Defined in: sdk/js/src/message-object.ts:18
Implementation of
Section titled “Implementation of”wit.Message.createdAt
editedAt
Section titled “editedAt”
readonlyeditedAt:bigint
Defined in: sdk/js/src/message-object.ts:19
Implementation of
Section titled “Implementation of”wit.Message.editedAt
embeds
Section titled “embeds”
readonlyembeds:Embed[]
Defined in: sdk/js/src/message-object.ts:22
Implementation of
Section titled “Implementation of”wit.Message.embeds
readonlyflags:number
Defined in: sdk/js/src/message-object.ts:24
Raw flag bits.
Implementation of
Section titled “Implementation of”wit.Message.flags
interaction
Section titled “interaction”
readonlyinteraction:InteractionMetadata
Defined in: sdk/js/src/message-object.ts:30
Implementation of
Section titled “Implementation of”wit.Message.interaction
mentions
Section titled “mentions”
readonlymentions:MessageMentions
Defined in: sdk/js/src/message-object.ts:28
Who it mentions, as the host honoured them (on an edit event: the new mentions, or none when the edit left them unchanged).
Implementation of
Section titled “Implementation of”wit.Message.mentions
messageId
Section titled “messageId”
readonlymessageId:string
Defined in: sdk/js/src/message-object.ts:14
Implementation of
Section titled “Implementation of”wit.Message.messageId
replyTo
Section titled “replyTo”
readonlyreplyTo:string
Defined in: sdk/js/src/message-object.ts:25
Implementation of
Section titled “Implementation of”wit.Message.replyTo
sequence
Section titled “sequence”
readonlysequence:bigint
Defined in: sdk/js/src/message-object.ts:16
Implementation of
Section titled “Implementation of”wit.Message.sequence
Accessors
Section titled “Accessors”createdTimestamp
Section titled “createdTimestamp”Get Signature
Section titled “Get Signature”get createdTimestamp():
number
Defined in: sdk/js/src/message-object.ts:55
When it was posted, ms since the epoch.
Returns
Section titled “Returns”number
Get Signature
Section titled “Get Signature”get id():
string
Defined in: sdk/js/src/message-object.ts:50
The message id.
Returns
Section titled “Returns”string
Methods
Section titled “Methods”delete()
Section titled “delete()”delete():
void
Defined in: sdk/js/src/message-object.ts:70
Deletes it (the bot’s own, or any with MANAGE_MESSAGES).
Returns
Section titled “Returns”void
edit()
Section titled “edit()”edit(
payload):void
Defined in: sdk/js/src/message-object.ts:65
Edits it (the bot’s own messages only).
Parameters
Section titled “Parameters”payload
Section titled “payload”Returns
Section titled “Returns”void
react()
Section titled “react()”react(
emoji):void
Defined in: sdk/js/src/message-object.ts:75
Adds a reaction.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”void
reply()
Section titled “reply()”reply(
payload):string
Defined in: sdk/js/src/message-object.ts:60
Replies in the same channel; returns the reply’s id.
Parameters
Section titled “Parameters”payload
Section titled “payload”Returns
Section titled “Returns”string
unreact()
Section titled “unreact()”unreact(
emoji):void
Defined in: sdk/js/src/message-object.ts:80
Removes the bot’s own reaction.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”void