Skip to content

MessageParams

Implementation of discords MessageParams object as a Luau builder.

https://discord.com/developers/docs/resources/channel#start-thread-in-forum-or-media-channel-forum-and-media-thread-message-params-object

MessageParams.content  :: string?

The message content that will be sent.

MessageParams.embeds  :: Embed }

Array of embed objects that will be attached to the message.

MessageParams.allowedMentions  :: AllowedMention

Controls the mentions that will ping in the message.

MessageParams.components  :: ActionRow }

Array of message components that will be attached to the message.

MessageParams.stickerIds  :: { string }

Array of sticker IDs that will be attached to the message.

MessageParams.attachments  :: Attachment }

Array of attachment objects that will be attached to the message.

MessageParams.flags  :: number?

Message flags to be applied to the message.

MessageParams : setContent ( content )  -> MessageParams

Sets the content of the message.

Parameters

content: string

Returns

MessageParams
MessageParams : addEmbed ( embedData )  -> MessageParams

Adds an embed to the message.

Parameters

embedData: JSON

Returns

MessageParams
MessageParams : setAllowedMentions ( mentions )  -> MessageParams

Sets the allowed mentions for the message.

Parameters

mentions: JSON

Returns

MessageParams
MessageParams : addComponent ( component )  -> MessageParams

Adds a component to the message.

Parameters

component: JSON

Returns

MessageParams
MessageParams : addStickerId ( stickerId )  -> MessageParams

Adds a sticker ID to the message.

Parameters

stickerId: string

Returns

MessageParams
MessageParams : addAttachment ( attachmentData )  -> MessageParams

Adds an attachment to the message.

Parameters

attachmentData: JSON

Returns

MessageParams
MessageParams : setFlags ( flags )  -> MessageParams

Sets the flags for the message.

Parameters

flags: number

Returns

MessageParams
MessageParams : build ( )  -> JSON

Responsible for building the MessageParams JSON that can be parsed by the Discord API.

Returns

JSON
MessageParams . new ( resource )  -> MessageParams

Responsible for creating a new MessageParams.

Parameters

resource: {
content: string?,
embeds: { embed.JSON,
}

Returns

MessageParams