DiscordLua
discorddiscord
v1.2.9
Install

SimpleShardingStrategy

Class
On this page

SimpleShardingStrategy 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.9 Source

Constructor

SimpleShardingStrategy.new(manager)

The class table is callable, so SimpleShardingStrategy(manager) is the same as .new.

NameTypeRequiredBehavior
manager any required Passed through to the implementation as written.
lua
local discord = require("discord")
local object = discord.SimpleShardingStrategy({})

Properties

SimpleShardingStrategy.manager

# readonly
Name
manager
Type
any
Access
readonly
Description
Instance field SimpleShardingStrategy.manager. Read it after the object is constructed or wrapped from Gateway/REST data.
Availability
Populated from the Gateway/REST payload or constructor for this SimpleShardingStrategy.

SimpleShardingStrategy.shards

# readonly
Name
shards
Type
Collection
Access
readonly
Description
Instance field SimpleShardingStrategy.shards. Read it after the object is constructed or wrapped from Gateway/REST data.
Availability
Populated from the Gateway/REST payload or constructor for this SimpleShardingStrategy.
Related
Collection

Methods

SimpleShardingStrategy:connect()

#

Performs connect on this SimpleShardingStrategy. Call it from bot code when you need that operation on the current object.

Signature

SimpleShardingStrategy:connect()

Parameters

No parameters.

Returns

SimpleShardingStrategy — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a SimpleShardingStrategy
object:connect()

SimpleShardingStrategy:destroy()

#

Close the Gateway, voice, and REST resources owned by this client.

Signature

SimpleShardingStrategy:destroy(options)

Parameters

NameTypeRequiredBehavior
options table optional Lua option table. Field names match the corresponding DiscordLua option type when one exists.

Returns

SimpleShardingStrategy — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a SimpleShardingStrategy
object:destroy({})

SimpleShardingStrategy:fetchStatus()

#

Fetch Status from REST and update the local cache when the request succeeds.

Signature

SimpleShardingStrategy:fetchStatus()

Parameters

No parameters.

Returns

SimpleShardingStrategy — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a SimpleShardingStrategy
object:fetchStatus()

SimpleShardingStrategy:send()

#

Send a message, payload, or packet using this object.

Signature

SimpleShardingStrategy:send(shardId, payload)

Parameters

NameTypeRequiredBehavior
shardId string required Snowflake id string.
payload any required Passed through to the implementation as written.

Returns

SimpleShardingStrategy — the same instance, for chaining.

Throws

A DiscordLua error when arguments are invalid or the request fails without a callback.

Example

lua
local discord = require("discord")
-- object is a SimpleShardingStrategy
object:send("123", payload)

SimpleShardingStrategy:spawn()

#

Start child processes or shards.

Signature

SimpleShardingStrategy:spawn(shardIds)

Parameters

NameTypeRequiredBehavior
shardIds any required Passed through to the implementation as written.

Returns

SimpleShardingStrategy — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a SimpleShardingStrategy
object:spawn(shardIds)

Examples

lua
local discord = require("discord")
local object = discord.SimpleShardingStrategy({})

ActionRow · Activity · ActivityInstance · ActivityLocation · AnonymousGuild · ApplicationCommand · ApplicationCommandNumericOptionMinMaxValueMixin · ApplicationCommandOptionBase

Version: discord 1.2.9 · runtime 1.0.0

Search Ctrl K Navigate Open Esc