MessagePayload
Fluent message builder (camelCase setters → snake_case via toJSON).
Prefer passing the builder to `channel.send(payload)` / `prepareMessagePostPayload(payload)`
in `@fluxerjs/core` so defaults (allowed mentions, reply ping) apply. Use toJSON
only for low-level REST bodies.
Constructor
()Properties
: (readonly)Max content length (2000 characters).
: MessagePayloadData (readonly)Partial message data (built incrementally via setters).
Methods
(embed: RESTPostAPIEmbed | EmbedBuilder): thisAdd an embed (up to 10 total). Existing embeds are preserved.
| Param | Type | Description |
|---|---|---|
| embed | RESTPostAPIEmbed | EmbedBuilder | Embed object or EmbedBuilder |
(contentOrOptions?: string | MessagePayloadCreateOptions): MessagePayloadCreate from string content or options object.
| Param | Type | Description |
|---|---|---|
| contentOrOptions? | string | MessagePayloadCreateOptions | Text content or full payload options |
(allowedMentions: APIAllowedMentions | null): thisSet allowed mentions (controls who can be pinged). Pass null to clear.
| Param | Type | Description |
|---|---|---|
| allowedMentions | APIAllowedMentions | null | Allowed mention rules, or null |
(attachments: AttachmentInput[] | null): thisSet attachments metadata (file bytes sent separately via multipart). Pass null to clear.
| Param | Type | Description |
|---|---|---|
| attachments | AttachmentInput[] | null | Array of AttachmentBuilder or attachment metadata, or null |
(content: string | null): thisSet message content (max 2000 characters). Pass null to clear.
| Param | Type | Description |
|---|---|---|
| content | string | null | Text content or null |
(embeds: (RESTPostAPIEmbed | EmbedBuilder)[] | null): thisReplace all embeds (max 10). Pass null or empty array to clear.
| Param | Type | Description |
|---|---|---|
| embeds | (RESTPostAPIEmbed | EmbedBuilder)[] | null | Array of embed objects or EmbedBuilder instances, or null |
(flags: number): thisSet message flags (e.g., suppress embeds).
| Param | Type | Description |
|---|---|---|
| flags | number | Message flags bitfield |
(reference: ReplyInput | null): thisSet message reference (reply target). Pass null to clear.
| Param | Type | Description |
|---|---|---|
| reference | ReplyInput | null | Reply target (channel/message IDs), or null |
(tts: boolean): thisSet text-to-speech flag.
| Param | Type | Description |
|---|---|---|
| tts | boolean | Whether to use TTS |
(): MessagePayloadDataSerialize to API payload (snake_case keys).