.addEmbed(embed)
embed: RESTPostAPIEmbed | EmbedBuilder → this
Add an embed (up to 10 total). Existing embeds are preserved.
- embed
RESTPostAPIEmbed | EmbedBuilderEmbed object or EmbedBuilder
messagePayload.addEmbed(embed);Class
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.
new MessagePayload()| Name | Type | Description |
|---|---|---|
| ContentMaxLengthstaticread-only | 2000 | Max content length (2000 characters). |
| dataread-only | MessagePayloadData | Partial message data (built incrementally via setters). |
embed: RESTPostAPIEmbed | EmbedBuilder → this
Add an embed (up to 10 total). Existing embeds are preserved.
RESTPostAPIEmbed | EmbedBuilderEmbed object or EmbedBuildermessagePayload.addEmbed(embed);contentOrOptions?: string | MessagePayloadCreateOptions → MessagePayload
Create from string content or options object.
string | MessagePayloadCreateOptionsText content or full payload optionsMessagePayload.create();allowedMentions: APIAllowedMentions | null → this
Set allowed mentions (controls who can be pinged). Pass null to clear.
APIAllowedMentions | nullAllowed mention rules, or nullmessagePayload.setAllowedMentions(allowedMentions);attachments: AttachmentInput[] | null → this
Set attachments metadata (file bytes sent separately via multipart). Pass null to clear. Prefer AttachmentMeta for index metadata; AttachmentBuilder serializes via toJSON(id).
AttachmentInput[] | nullArray of AttachmentMeta, AttachmentBuilder, or plain objects, or nullmessagePayload.setAttachments(attachments);content: string | null → this
Set message content (max 2000 characters). Pass null to clear.
string | nullText content or nullmessagePayload.setContent(content);embeds: (RESTPostAPIEmbed | EmbedBuilder)[] | null → this
Replace all embeds (max 10). Pass null or empty array to clear.
(RESTPostAPIEmbed | EmbedBuilder)[] | nullArray of embed objects or EmbedBuilder instances, or nullmessagePayload.setEmbeds(embeds);flags: number → this
Set message flags (e.g., suppress embeds).
numberMessage flags bitfieldmessagePayload.setFlags(flags);reference: ReplyInput | null → this
Set message reference (reply target). Pass null to clear.
ReplyInput | nullReply target (channel/message IDs), or nullmessagePayload.setReply(reference);tts: boolean → this
Set text-to-speech flag.
booleanWhether to use TTSmessagePayload.setTTS(tts);