PollAnswer
Implementation of discords PollAnswer object as a Luau builder.
https://discord.com/developers/docs/resources/poll#poll-answer-object-poll-answer-object-structure
Summary
Properties
Section titled “Properties”answerId
Section titled “answerId”The ID of the poll answer.
pollMedia
Section titled “pollMedia” PollAnswer.pollMedia :: Media?
The media attached to this poll answer.
Methods
Section titled “Methods”PollAnswer : setId ( id ) -> PollAnswer
Sets the ID for the poll answer.
Parameters
| id: number |
Returns
| PollAnswer |
setMedia
Section titled “setMedia”PollAnswer : setMedia ( media ) -> PollAnswer
Sets the media for the poll answer.
Parameters
| media: JSON |
Returns
| PollAnswer |
PollAnswer : build ( ) -> JSON
Responsible for building the PollAnswer JSON that can be parsed by the Discord API.
Returns
| JSON |
Functions
Section titled “Functions”PollAnswer . new ( resource ) -> PollAnswer
Responsible for creating a new PollAnswer.
local answer = PollAnswer.new({ answerId = 1, pollMedia = media:build()})Parameters
| resource: { answerId: number?, pollMedia: mediaBuilder.JSON?, } |
Returns
| PollAnswer |