LogoAntiRaid

@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
PropTypeDescription
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

string

Returns

ret1

Message

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

string

Returns

ret1

Message

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

boolean

Returns

ret1

Message

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

embed.JSON

Returns

ret1

Message

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

allowedMention.JSON

Returns

ret1

Message

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

reference.JSON

Returns

ret1

Message

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 1

button.JSON

Variant 2

textInput.JSON

Variant 3

selectMenu.JSON

Variant 4

actionRow.JSON

Returns

ret1

Message

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

string

Returns

ret1

Message

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

attachment.JSON

Returns

ret1

Message

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

number

Returns

ret1

Message

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

boolean

Returns

ret1

Message

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

poll.JSON

Returns

ret1

Message

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

JSON

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

Message

Last updated on