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

Properties

The MessageParams instance has no set properties!

Methods

The MessageParams instance has no set methods!

Functions

setContent

MessageParams . setContent (

     self: MessageParams
     content: string
)  -> ()

Sets the content of the message.

addEmbed

MessageParams . addEmbed (

     self: MessageParams
     embedData: embed.JSON
)  -> ()

Adds an embed to the message.

setAllowedMentions

MessageParams . setAllowedMentions (

     self: MessageParams
     mentions: allowedMention.JSON
)  -> ()

Sets the allowed mentions for the message.

addComponent

MessageParams . addComponent (

     self: MessageParams
     component: button.JSON
                      | textInput.JSON
                      | selectMenu.JSON
                      | actionRow.JSON
)  -> ()

Adds a component to the message.

addStickerId

MessageParams . addStickerId (

     self: MessageParams
     stickerId: string
)  -> ()

Adds a sticker ID to the message.

addAttachment

MessageParams . addAttachment (

     self: MessageParams
     attachmentData: attachment.JSON
)  -> ()

Adds an attachment to the message.

setFlags

MessageParams . setFlags (

     self: MessageParams
     flags: number
)  -> ()

Sets the flags for the message.

build

MessageParams . build (

     self: MessageParams
)  -> ()

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

new

MessageParams . new (

     resource: {
       content: string?,
       embeds: { embed.JSON,
    }
                      | textInput.JSON
                      | selectMenu.JSON
                      | actionRow.JSON }?, stickerIds: { string }?, attachments: { attachment.JSON }?, flags: number?, }?
)  -> ()

Responsible for creating a new MessageParams.