PollAnswer
ClassOn this page
PollAnswer is a DiscordLua class representing a Discord resource. Obtain it from a manager, an event payload, or the constructor when one is documented below.
Properties
- Name
client- Type
any- Access
- readonly
- Description
- Owning Client instance used for REST, cache, and event dispatch.
- Availability
- Populated from the Gateway/REST payload or constructor for this PollAnswer.
- Name
emoji- Type
any- Access
- readonly
- Description
- Instance field
PollAnswer.emoji. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this PollAnswer.
- Name
id- Type
any- Access
- readonly
- Description
- Snowflake id of this PollAnswer.
- Availability
- Populated from the Gateway/REST payload or constructor for this PollAnswer.
- Name
partial- Type
any- Access
- readonly
- Description
- Instance field
PollAnswer.partial. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this PollAnswer.
- Name
poll- Type
any- Access
- readonly
- Description
- Instance field
PollAnswer.poll. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this PollAnswer.
- Name
raw- Type
any- Access
- readonly
- Description
- Instance field
PollAnswer.raw. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this PollAnswer.
- Name
text- Type
any- Access
- readonly
- Description
- Instance field
PollAnswer.text. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this PollAnswer.
- Name
voteCount- Type
any- Access
- readonly
- Description
- Instance field
PollAnswer.voteCount. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this PollAnswer.
- Name
voters- Type
- PollAnswerVoterManager
- Access
- readonly
- Description
- Cache and REST facade for pollanswervoter objects owned by this PollAnswer. Use it to fetch, create, resolve, and mutate those resources.
- Availability
- Created in
PollAnswer.newand remains valid for the lifetime of the PollAnswer. - Related
- PollAnswerVoterManager
Methods
PollAnswer:fetchVoters()
#Fetch Voters from REST and update the local cache when the request succeeds.
Signature
PollAnswer:fetchVoters(options, callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
options |
table |
optional | Lua option table. Field names match the corresponding DiscordLua option type when one exists. |
callback |
function |
optional | Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error. |
Returns
PollAnswer — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a PollAnswer
object:fetchVoters({}, function(err, result)
if err then error(err) end
end)Examples
Obtain this object from a manager, wrap helper, or event payload — it is not constructed directly in typical bot code.
Related APIs
ActionRow · Activity · ActivityInstance · ActivityLocation · AnonymousGuild · ApplicationCommand · ApplicationRoleConnectionMetadata · Attachment
Version: discord 1.2.4 · runtime 1.0.0