WebSocketManager
ManagerOn 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.
Constructor
WebSocketManager.new(client) The class table is callable, so WebSocketManager(client) is the same as .new.
| Name | Type | Required | Behavior |
|---|---|---|---|
client |
any |
required | Passed through to the implementation as written. |
local discord = require("discord")
local object = discord.WebSocketManager({})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 WebSocketManager.
- 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.
- 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.
- 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
- 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
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
| Name | Type | Required | Behavior |
|---|---|---|---|
id |
string |
required | Snowflake id string. |
Returns
WebSocketManager — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a WebSocketManager
object:shard("123")Examples
local discord = require("discord")
local object = discord.WebSocketManager({})Related APIs
ApplicationCommandManager · ApplicationCommandPermissionsManager · ApplicationEmojiManager · AutoModerationRuleManager · BaseGuildEmojiManager · BaseManager · CachedManager · CategoryChannelChildManager
Version: discord 1.2.4 · runtime 1.0.0