class MessageBuilder
implements
JSONEncodable<RESTPostAPIChannelMessageJSONBody>declare class MessageBuilder implements JSONEncodable<RESTPostAPIChannelMessageJSONBody>
readonlyreadonly AttachmentBuilder[] attachments :
Gets the attachments of this message.
readonlyreadonly ActionRowBuilder[] components :
Gets the components of this message.
readonlyreadonly EmbedBuilder[] embeds :
Gets the embeds of this message.
addAttachments...attachments: RestOrArray<APIAttachment | AttachmentBuilder | ((builder: AttachmentBuilder) => AttachmentBuilder)>) : this (
Adds attachments to this message.
addComponents...components: RestOrArray<ActionRowBuilder | APIActionRowComponent<APIMessageActionRowComponent> | ((builder: ActionRowBuilder) => ActionRowBuilder)>) : this (
Adds components to this message.
addEmbeds...embeds: RestOrArray<APIEmbed | EmbedBuilder | ((builder: EmbedBuilder) => EmbedBuilder)>) : this (
Appends embeds to this message.
const embeds: APIEmbed[] = ...;
const message = new MessageBuilder()
.addEmbeds(embeds);
const message = new MessageBuilder()
.addEmbeds(
{ title: 'Embed 1' },
{ title: 'Embed 2' },
);
addStickerIds...stickerIds: RestOrArray<Snowflake>) : this (
Adds sticker ids to this message.
setAllowedMentionsallowedMentions: AllowedMentionsBuilder | APIAllowedMentions | ((builder: AllowedMentionsBuilder) => AllowedMentionsBuilder)) : this (
Sets the allowed mentions for this message.
setAttachments...attachments: RestOrArray<APIAttachment | AttachmentBuilder | ((builder: AttachmentBuilder) => AttachmentBuilder)>) : this (
Sets attachments for this message.
setComponents...components: RestOrArray<ActionRowBuilder | APIActionRowComponent<APIMessageActionRowComponent> | ((builder: ActionRowBuilder) => ActionRowBuilder)>) : this (
Sets the components of this message.
setContentcontent: string) : this (
Sets the content of the message.
setEnforceNonceenforceNonce?: boolean) : this (
Sets enforce_nonce
for this message.
setFlagsflags: MessageFlags) : this (
Sets the flags for this message.
setMessageReferencereference: APIMessageReference | MessageReferenceBuilder | ((builder: MessageReferenceBuilder) => MessageReferenceBuilder)) : this (
Sets the message reference for this message.
setPollpoll: APIPoll | PollBuilder | ((builder: PollBuilder) => PollBuilder)) : this (
Sets the poll for this message.
setStickerIds...stickerIds: RestOrArray<Snowflake>) : this (
Sets the sticker ids of this message.
setTTStts?: boolean) : this (
Sets whether the message is TTS.
spliceAttachmentsstart: numberdeleteCount: number...attachments: RestOrArray<APIAttachment | AttachmentBuilder | ((builder: AttachmentBuilder) => AttachmentBuilder)>) : this (
Removes, replaces, or inserts attachments for this message.
message.spliceAttachments(0, 1);
const n = 4;
message.spliceAttachments(0, n);
message.spliceAttachments(-1, 1);
spliceComponentsstart: numberdeleteCount: number...components: RestOrArray<ActionRowBuilder | APIActionRowComponent<APIMessageActionRowComponent> | ((builder: ActionRowBuilder) => ActionRowBuilder)>) : this (
Removes, replaces, or inserts components for this message.
message.spliceComponents(0, 1);
const n = 4;
message.spliceComponents(0, n);
message.spliceComponents(-1, 1);
spliceEmbedsstart: numberdeleteCount: number...embeds: RestOrArray<APIEmbed | EmbedBuilder | ((builder: EmbedBuilder) => EmbedBuilder)>) : this (
Removes, replaces, or inserts embeds for this message.
message.spliceEmbeds(0, 1);
const n = 4;
message.spliceEmbeds(0, n);
message.spliceEmbeds(-1, 1);
Removes, replaces, or inserts sticker ids for this message.
message.spliceStickerIds(0, 1);
const n = 4;
message.spliceStickerIds(0, n);
message.spliceStickerIds(-1, 1);
toJSONvalidationOverride?: boolean) : RESTPostAPIChannelMessageJSONBody (
Serializes this builder to API-compatible JSON data.Note that by disabling validation, there is no guarantee that the resulting object will be valid.
updateAllowedMentionsupdater: (builder: AllowedMentionsBuilder) => AllowedMentionsBuilder) : this (
Updates the allowed mentions for this message (and creates it if it doesn't exist)
updateMessageReferenceupdater: (builder: MessageReferenceBuilder) => MessageReferenceBuilder) : this (
Updates the message reference for this message (and creates it if it doesn't exist)
updatePollupdater: (builder: PollBuilder) => PollBuilder) : this (
Updates the poll for this message (and creates it if it doesn't exist)