DiscordLua
discorddiscord
v1.2.4
Install

PollAnswer

Class
On 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.

class Module 1.2.4 Source

Properties

PollAnswer.client

# readonly
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.

PollAnswer.emoji

# readonly
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.

PollAnswer.id

# readonly
Name
id
Type
any
Access
readonly
Description
Snowflake id of this PollAnswer.
Availability
Populated from the Gateway/REST payload or constructor for this PollAnswer.

PollAnswer.partial

# readonly
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.

PollAnswer.poll

# readonly
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.

PollAnswer.raw

# readonly
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.

PollAnswer.text

# readonly
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.

PollAnswer.voteCount

# readonly
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.

PollAnswer.voters

# readonly
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.new and 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

NameTypeRequiredBehavior
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

lua
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.

ActionRow · Activity · ActivityInstance · ActivityLocation · AnonymousGuild · ApplicationCommand · ApplicationRoleConnectionMetadata · Attachment

Version: discord 1.2.4 · runtime 1.0.0

Search Ctrl K Navigate Open Esc