@discord-types/builders/message/message
API reference for @discord-types/builders/message/message
@discord-types/builders/message/message
Types
Message
Raw Type
type Message = Message.Prototype, & {
content: string?,
nonce: string?,
tts: boolean?,
embeds: {embed.JSON},
allowedMentions: allowedMention.JSON?,
messageReference: reference.JSON?,
components: {button.JSON | textInput.JSON | selectMenu.JSON | actionRow.JSON},
stickerIds: {string},
-- files[n]
-- payloadJson
attachments: {attachment.JSON},
flags: number?,
enforceNonce: boolean?,
poll: poll.JSON?
}
Intersection with variants:
Variant 2
Prop | Type | Description |
---|---|---|
content? | - | |
nonce? | - | |
tts? | - | |
embeds | - | |
allowedMentions? | - | |
messageReference? | - | |
components | - | |
stickerIds | - | |
attachments | - | |
flags? | - | |
enforceNonce? | - | |
poll? | - |
JSON
Raw Type
type JSON = Message.Prototype.build(nil :: any),
Functions
Message.Prototype.setContent
[[ Sets the content of the message. ]]
Function Signature
--[[
Sets the content of the message.
]]
function Message.Prototype.setContent(self: Message, content: string) -> Message end
Arguments
content
Returns
ret1
Message.Prototype.setNonce
[[ Sets the nonce of the message. ]]
Function Signature
--[[
Sets the nonce of the message.
]]
function Message.Prototype.setNonce(self: Message, nonce: string) -> Message end
Arguments
nonce
Returns
ret1
Message.Prototype.setTTS
[[ Sets whether the message is text-to-speech. ]]
Function Signature
--[[
Sets whether the message is text-to-speech.
]]
function Message.Prototype.setTTS(self: Message, tts: boolean) -> Message end
Arguments
tts
Returns
ret1
Message.Prototype.addEmbed
[[ Adds an embed to the message. ]]
Function Signature
--[[
Adds an embed to the message.
]]
function Message.Prototype.addEmbed(self: Message, embedData: embed.JSON) -> Message end
Arguments
embedData
Returns
ret1
Message.Prototype.setAllowedMentions
[[ Sets the allowed mentions for the message. ]]
Function Signature
--[[
Sets the allowed mentions for the message.
]]
function Message.Prototype.setAllowedMentions(self: Message, mentions: allowedMention.JSON) -> Message end
Arguments
mentions
Returns
ret1
Message.Prototype.setMessageReference
[[ Sets the message reference. ]]
Function Signature
--[[
Sets the message reference.
]]
function Message.Prototype.setMessageReference(self: Message, ref: reference.JSON) -> Message end
Arguments
ref
Returns
ret1
Message.Prototype.addComponent
[[ Adds a component to the message. ]]
Function Signature
--[[
Adds a component to the message.
]]
function Message.Prototype.addComponent(self: Message, component: button.JSON | textInput.JSON | selectMenu.JSON | actionRow.JSON) -> Message end
Arguments
component
Union with variants:
Variant 3
Returns
ret1
Message.Prototype.addStickerId
[[ Adds a sticker ID to the message. ]]
Function Signature
--[[
Adds a sticker ID to the message.
]]
function Message.Prototype.addStickerId(self: Message, stickerId: string) -> Message end
Arguments
stickerId
Returns
ret1
Message.Prototype.addAttachment
[[ Adds an attachment to the message. ]]
Function Signature
--[[
Adds an attachment to the message.
]]
function Message.Prototype.addAttachment(self: Message, attachmentData: attachment.JSON) -> Message end
Arguments
attachmentData
Returns
ret1
Message.Prototype.setFlags
[[ Sets the flags for the message. ]]
Function Signature
--[[
Sets the flags for the message.
]]
function Message.Prototype.setFlags(self: Message, flags: number) -> Message end
Arguments
flags
Returns
ret1
Message.Prototype.setEnforceNonce
[[ If true and nonce is present, it will be checked for uniqueness in the past few minutes. If another message was created by the same author with the same nonce, that message will be returned and no new message will be created. ]]
Function Signature
--[[
If true and nonce is present, it will be checked for uniqueness in the past few minutes. If another message
was created by the same author with the same nonce, that message will be returned and no new message will
be created.
]]
function Message.Prototype.setEnforceNonce(self: Message, enforceNonce: boolean) -> Message end
Arguments
enforceNonce
Returns
ret1
Message.Prototype.setPoll
[[ Sets the poll for the message. ]]
Function Signature
--[[
Sets the poll for the message.
]]
function Message.Prototype.setPoll(self: Message, poll: poll.JSON) -> Message end
Arguments
poll
Returns
ret1
Message.Prototype.build
[[ Responsible for building the Message JSON that can be parsed by the Discord API. ]]
Function Signature
--[[
Responsible for building the Message JSON that can be parsed by the Discord API.
]]
function Message.Prototype.build(self: Message) -> JSON end
Returns
ret1
Message.Interface.new
[[ Responsible for creating a new Message.
```lua
``` ]]
Function Signature
--[[
Responsible for creating a new Message.
\`\`\`lua
\`\`\`
]]
function Message.Interface.new(resource: {
content: string?,
nonce: string?,
tts: boolean?,
embeds: {embed.JSON}?,
allowedMentions: allowedMention.JSON?,
messageReference: reference.JSON?,
components: {button.JSON | textInput.JSON | selectMenu.JSON | actionRow.JSON}?,
stickerIds: {string}?,
attachments: {attachment.JSON}?,
flags: number?,
enforceNonce: boolean?,
poll: poll.JSON?
}?) -> Message end
Arguments
resource
This field is optional and may not be specified
{content: string?, nonce: string?, tts: boolean?, embeds: {embed.JSON}?, allowedMentions: allowedMention.JSON?, messageReference: reference.JSON?, components: {(button.JSON | textInput.JSON | selectMenu.JSON | actionRow.JSON)}?, stickerIds: {string}?, attachments: {attachment.JSON}?, flags: number?, enforceNonce: boolean?, poll: poll.JSON?}?
Returns
ret1
Last updated on