DiscordLua
discorddiscord
v1.2.4
Install

WebSocketManager

Manager
On this page

WebSocketManager is the cache and REST facade for WebSocket objects owned by the parent. Typical calls are fetch, create, edit, delete, resolve, and resolveId.

manager Module 1.2.4 Source

Constructor

WebSocketManager.new(client)

The class table is callable, so WebSocketManager(client) is the same as .new.

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

Properties

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

WebSocketManager.gateway

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

WebSocketManager.ping

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

WebSocketManager.shards

# readonly
Name
shards
Type
Collection
Access
readonly
Description
Instance field WebSocketManager.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 WebSocketManager.
Related
Collection

WebSocketManager.status

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

Methods

WebSocketManager:destroy()

#

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

Signature

WebSocketManager:destroy()

Parameters

No parameters.

Returns

WebSocketManager — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a WebSocketManager
object:destroy()

WebSocketManager:shard()

#

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

Signature

WebSocketManager:shard(id)

Parameters

NameTypeRequiredBehavior
id string required Snowflake id string.

Returns

WebSocketManager — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a WebSocketManager
object:shard("123")

Examples

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

ApplicationCommandManager · ApplicationCommandPermissionsManager · ApplicationEmojiManager · AutoModerationRuleManager · BaseGuildEmojiManager · BaseManager · CachedManager · CategoryChannelChildManager

Version: discord 1.2.4 · runtime 1.0.0

Search Ctrl K Navigate Open Esc