messages
constmessages:object
Defined in: sdk/js/src/api.ts:12
Messages and reactions in channels the bot can see.
Type Declaration
Section titled “Type Declaration”delete()
Section titled “delete()”delete(
channelId,messageId):void
Parameters
Section titled “Parameters”channelId
Section titled “channelId”string
messageId
Section titled “messageId”string
Returns
Section titled “Returns”void
dm(
memberId,payload):object
A direct message to memberId (capability dms): opens the DM when needed. Returns the
DM’s channel id and the message id.
Parameters
Section titled “Parameters”memberId
Section titled “memberId”string
payload
Section titled “payload”Returns
Section titled “Returns”object
channelId
Section titled “channelId”channelId:
string
messageId
Section titled “messageId”messageId:
string
edit()
Section titled “edit()”edit(
channelId,messageId,payload):void
Edits one of the bot’s messages.
Parameters
Section titled “Parameters”channelId
Section titled “channelId”string
messageId
Section titled “messageId”string
payload
Section titled “payload”Returns
Section titled “Returns”void
history()
Section titled “history()”history(
channelId,options?):Message[]
Up to limit (1–100) messages before the sequence before.
Parameters
Section titled “Parameters”channelId
Section titled “channelId”string
options?
Section titled “options?”before?
Section titled “before?”number
limit?
Section titled “limit?”number
Returns
Section titled “Returns”Message[]
react()
Section titled “react()”react(
channelId,messageId,emoji):void
Parameters
Section titled “Parameters”channelId
Section titled “channelId”string
messageId
Section titled “messageId”string
string
Returns
Section titled “Returns”void
send()
Section titled “send()”send(
channelId,payload,options?):string
Posts a message; returns its id.
Parameters
Section titled “Parameters”channelId
Section titled “channelId”string
payload
Section titled “payload”options?
Section titled “options?”replyTo?
Section titled “replyTo?”string
Returns
Section titled “Returns”string
unreact()
Section titled “unreact()”unreact(
channelId,messageId,emoji):void
Parameters
Section titled “Parameters”channelId
Section titled “channelId”string
messageId
Section titled “messageId”string
string
Returns
Section titled “Returns”void
upload()
Section titled “upload()”upload(
channelId,name,mime,bytes):string
Uploads a file for the bot’s next message (capability attachments); returns its id.
Parameters
Section titled “Parameters”channelId
Section titled “channelId”string
string
string
Uint8Array
Returns
Section titled “Returns”string