MessageParams
Implementation of discords MessageParams object as a Luau builder.
Summary
Properties
MessageParams.content :: string?MessageParams.embeds :: { Builders.Embed }MessageParams.allowedMentions :: Builders.Message.AllowedMentionMessageParams.components :: { Builders.Message.Button | Builders.Message.TextInput | Builders.Message.SelectMenu | Builders.Message.ActionRow }MessageParams.stickerIds :: { string }MessageParams.attachments :: { Builders.Attachment }MessageParams.flags :: number?Methods
MessageParams:setContent(content: string) → MessageParamsMessageParams:addEmbed(embedData: embed.JSON) → MessageParamsMessageParams:setAllowedMentions(mentions: allowedMention.JSON) → MessageParamsMessageParams:addComponent(component: button.JSON | textInput.JSON | selectMenu.JSON | actionRow.JSON) → MessageParamsMessageParams:addStickerId(stickerId: string) → MessageParamsMessageParams:addAttachment(attachmentData: attachment.JSON) → MessageParamsMessageParams:setFlags(flags: number) → MessageParamsMessageParams:build() → JSONProperties
Section titled “Properties”content
Section titled “content”The message content that will be sent.
embeds
Section titled “embeds”Array of embed objects that will be attached to the message.
allowedMentions
Section titled “allowedMentions”Controls the mentions that will ping in the message.
components
Section titled “components”Array of message components that will be attached to the message.
stickerIds
Section titled “stickerIds”Array of sticker IDs that will be attached to the message.
attachments
Section titled “attachments”Array of attachment objects that will be attached to the message.
Message flags to be applied to the message.
Methods
Section titled “Methods”setContent
Section titled “setContent”MessageParams : setContent ( content ) -> MessageParams
Sets the content of the message.
Parameters
| content: string |
Returns
| MessageParams |
addEmbed
Section titled “addEmbed”MessageParams : addEmbed ( embedData ) -> MessageParams
Adds an embed to the message.
Parameters
| embedData: JSON |
Returns
| MessageParams |
setAllowedMentions
Section titled “setAllowedMentions”MessageParams : setAllowedMentions ( mentions ) -> MessageParams
Sets the allowed mentions for the message.
Parameters
| mentions: JSON |
Returns
| MessageParams |
addComponent
Section titled “addComponent”MessageParams : addComponent ( component ) -> MessageParams
Adds a component to the message.
Parameters
| component: JSON |
Returns
| MessageParams |
addStickerId
Section titled “addStickerId”MessageParams : addStickerId ( stickerId ) -> MessageParams
Adds a sticker ID to the message.
Parameters
| stickerId: string |
Returns
| MessageParams |
addAttachment
Section titled “addAttachment”MessageParams : addAttachment ( attachmentData ) -> MessageParams
Adds an attachment to the message.
Parameters
| attachmentData: JSON |
Returns
| MessageParams |
setFlags
Section titled “setFlags”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 |
Functions
Section titled “Functions”MessageParams . new ( resource ) -> MessageParams
Responsible for creating a new MessageParams.
Parameters
| resource: { content: string?, embeds: { embed.JSON, } |
Returns
| MessageParams |