Appearance
MessagePayload
Package: @erinjs/builders
Builder for message payloads. Use with channel.send() or message.reply().
Properties
| Name | Type | Readonly | Optional | Description |
|---|---|---|---|---|
ContentMaxLength | 2000 | Yes | No | |
data | MessagePayloadData | Yes | No |
Methods
addEmbed()
Add one embed. Max 10 total.
Returns: this
Parameters:
| Name | Type | Optional | Description |
|---|---|---|---|
embed | any | No |
create()
Create a MessagePayload from a string or options object.
Returns: MessagePayload
Parameters:
| Name | Type | Optional | Description |
|---|---|---|---|
contentOrOptions | string | MessagePayloadData | Yes |
setAttachments()
Set attachment metadata (for files sent with the request).
Returns: this
Parameters:
| Name | Type | Optional | Description |
|---|---|---|---|
attachments | (AttachmentBuilder | { id: number; filename: string; description?: string | null; })[] | null | No |
setContent()
Set message text. Max 2000 characters.
Returns: this
Parameters:
| Name | Type | Optional | Description |
|---|---|---|---|
content | string | null | No |
setEmbeds()
Set embeds. Max 10. Replaces existing.
Returns: this
Parameters:
| Name | Type | Optional | Description |
|---|---|---|---|
embeds | any[] | null | No |
setFlags()
Set message flags (e.g. ephemeral, suppress embeds).
Returns: this
Parameters:
| Name | Type | Optional | Description |
|---|---|---|---|
flags | number | No |
setReply()
Set reply reference (creates a reply to another message).
Returns: this
Parameters:
| Name | Type | Optional | Description |
|---|---|---|---|
reference | any | No |
setTTS()
Enable text-to-speech.
Returns: this
Parameters:
| Name | Type | Optional | Description |
|---|---|---|---|
tts | boolean | No |
toJSON()
Get the payload as a plain object.
Returns: MessagePayloadData
Parameters:
None