Class

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

new MessagePayload()

Properties

NameTypeDescription
ContentMaxLengthstaticread-only2000Max content length (2000 characters).
dataread-onlyMessagePayloadDataPartial message data (built incrementally via setters).

Methods

.setContent(content)

content: string | nullthis

Set message content (max 2000 characters). Pass null to clear.

content
string | nullText content or null
messagePayload.setContent(content);

.setFlags(flags)

flags: numberthis

Set message flags (e.g., suppress embeds).

flags
numberMessage flags bitfield
messagePayload.setFlags(flags);

.setReply(reference)

reference: ReplyInput | nullthis

Set message reference (reply target). Pass null to clear.

reference
ReplyInput | nullReply target (channel/message IDs), or null
messagePayload.setReply(reference);

.setTTS(tts)

tts: booleanthis

Set text-to-speech flag.

tts
booleanWhether to use TTS
messagePayload.setTTS(tts);