LogoAntiRaid

@discord-types/builders/message/poll/poll

API reference for @discord-types/builders/message/poll/poll

@discord-types/builders/message/poll/poll

Types

Poll

Raw Type
type Poll = Poll.Prototype, & {
	question: mediaBuilder.JSON,

	answers: {answerBuilder.JSON},

	expiry: string,

	allowMultiselect: boolean,

	layoutType: messageTypes.PollLayoutType
}

Intersection with variants:

Variant 2
PropTypeDescription
question
-
answers
-
expiry
-
allowMultiselect
-
layoutType
-

JSON

Raw Type
type JSON = Poll.Prototype.build(nil :: any),

Functions

Poll.Prototype.addAnswer

[[ Adds an answer to the poll. ]]

Function Signature
--[[
	Adds an answer to the poll.
]]
function Poll.Prototype.addAnswer(self: Poll, answer: answerBuilder.JSON) -> Poll end

Arguments

answer

answerBuilder.JSON

Returns

ret1

Poll

Poll.Prototype.setQuestion

[[ Sets the question for the poll. ]]

Function Signature
--[[
	Sets the question for the poll.
]]
function Poll.Prototype.setQuestion(self: Poll, question: mediaBuilder.JSON) -> Poll end

Arguments

question

mediaBuilder.JSON

Returns

ret1

Poll

Poll.Prototype.setExpiry

[[ Sets the expiry time for the poll. ]]

Function Signature
--[[
	Sets the expiry time for the poll.
]]
function Poll.Prototype.setExpiry(self: Poll, expiry: string | number | datetime.DateTime) -> Poll end

Arguments

expiry

Union with variants:

Variant 1

string

Variant 2

number

Variant 3

datetime.DateTime

Returns

ret1

Poll

Poll.Prototype.setMultiselect

[[ Sets whether the poll allows multiple selections. ]]

Function Signature
--[[
	Sets whether the poll allows multiple selections.
]]
function Poll.Prototype.setMultiselect(self: Poll, multiselect: boolean) -> Poll end

Arguments

multiselect

boolean

Returns

ret1

Poll

Poll.Prototype.setLayoutType

[[ Sets the layout type for the poll. ]]

Function Signature
--[[
	Sets the layout type for the poll.
]]
function Poll.Prototype.setLayoutType(self: Poll, layoutType: messageTypes.PollLayoutType) -> Poll end

Arguments

layoutType

messageTypes.PollLayoutType

Returns

ret1

Poll

Poll.Prototype.build

[[ Builds and returns the Poll JSON that can be parsed by the Discord API. ]]

Function Signature
--[[
	Builds and returns the Poll JSON that can be parsed by the Discord API.
]]
function Poll.Prototype.build(self: Poll) -> JSON end

Returns

ret1

JSON

Poll.Interface.new

[[ Responsible for creating a new Poll.

```lua

``` ]]

Function Signature
--[[
	Responsible for creating a new Poll.

	\`\`\`lua
	
	\`\`\`
]]
function Poll.Interface.new(resource: {
		question: mediaBuilder.JSON?,

		answers: {answerBuilder.JSON}?,

		expiry: number?,

		allowMultiselect: boolean?,

		layoutType: messageTypes.PollLayoutType?
	}?) -> Poll end

Arguments

resource

This field is optional and may not be specified

{question: mediaBuilder.JSON?, answers: {answerBuilder.JSON}?, expiry: number?, allowMultiselect: boolean?, layoutType: messageTypes.PollLayoutType?}?

Returns

ret1

Poll

Last updated on