WorkerContextFetchingStrategy
ClassOn this page
WorkerContextFetchingStrategy is a DiscordLua class representing a Discord resource. Obtain it from a manager, an event payload, or the constructor when one is documented below.
Constructor
WorkerContextFetchingStrategy.new(options) The class table is callable, so WorkerContextFetchingStrategy(options) is the same as .new.
| Name | Type | Required | Behavior |
|---|---|---|---|
options |
table |
optional | Lua option table. Field names match the corresponding DiscordLua option type when one exists. |
local discord = require("discord")
local object = discord.WorkerContextFetchingStrategy({})Properties
- Name
options- Type
any- Access
- readonly
- Description
- Instance field
WorkerContextFetchingStrategy.options. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this WorkerContextFetchingStrategy.
Methods
WorkerContextFetchingStrategy:retrieveSessionInfo()
#Performs retrieve session info on this WorkerContextFetchingStrategy. Call it from bot code when you need that operation on the current object.
Signature
WorkerContextFetchingStrategy:retrieveSessionInfo(shardId) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
shardId |
string |
required | Snowflake id string. |
Returns
WorkerContextFetchingStrategy — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a WorkerContextFetchingStrategy
object:retrieveSessionInfo("123")WorkerContextFetchingStrategy:updateSessionInfo()
#Performs update session info on this WorkerContextFetchingStrategy. Call it from bot code when you need that operation on the current object.
Signature
WorkerContextFetchingStrategy:updateSessionInfo(shardId, sessionInfo) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
shardId |
string |
required | Snowflake id string. |
sessionInfo |
any |
required | Passed through to the implementation as written. |
Returns
WorkerContextFetchingStrategy — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a WorkerContextFetchingStrategy
object:updateSessionInfo("123", sessionInfo)WorkerContextFetchingStrategy:waitForIdentify()
#Performs wait for identify on this WorkerContextFetchingStrategy. Call it from bot code when you need that operation on the current object.
Signature
WorkerContextFetchingStrategy:waitForIdentify(shardId, signal) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
shardId |
string |
required | Snowflake id string. |
signal |
any |
required | Passed through to the implementation as written. |
Returns
WorkerContextFetchingStrategy — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a WorkerContextFetchingStrategy
object:waitForIdentify("123", signal)Examples
local discord = require("discord")
local object = discord.WorkerContextFetchingStrategy({})Related APIs
ActionRow · Activity · ActivityInstance · ActivityLocation · AnonymousGuild · ApplicationCommand · ApplicationCommandNumericOptionMinMaxValueMixin · ApplicationCommandOptionBase
Version: discord 1.2.9 · runtime 1.0.0