@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
Prop | Type | Description |
---|---|---|
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
Returns
ret1
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
Returns
ret1
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
Variant 2
Returns
ret1
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
Returns
ret1
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
Returns
ret1
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
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
Last updated on