Manager
Manages the connection and communication with the Discord Gateway using multiple shards.
This serves as the primary class for developers wanting to interact with the Discord Gateway, this class is responsible for creating the required shards sending messages asynchronously through each shard.
Properties
token
Manager.token :: Secret
intents
Manager.intents :: number
webSocketVersion
Manager.webSocketVersion :: number
largeThreshold
Manager.largeThreshold :: number?
shouldReconnect
Manager.shouldReconnect :: boolean
ready
Manager.ready :: boolean
shardIds
shards
Manager.shards :: {
{ [ShardId]: WebSocket.Shard } }
{ [ShardId]: WebSocket.Shard } }
logger
Manager.logger :: Logger.Logger
onDisconnected
onReconnected
onConnected
onHeartbeat
onDispatch
Manager.onDispatch :: Emitter<ShardPayload<{ shardId: number, event: apiTypes.ReceiveEvent, payload: apiTypes.Payload<unknown>
onAllShardsReady
Manager.onAllShardsReady :: Emitter<ShardPayload<{ shardId: number, payload: apiTypes.ReadyPayload }>
Methods
The Manager instance has no set methods!
Functions
connectAsync
Manager . connectAsync () -> ()
self: Manager
gatewayInformation: apiTypes.GetGatewayBotResponse
Will create, as well as connect all of the shards this application requires in order to communicate back and fourth between discords WebSocket
sendAsync
Manager . sendAsync () -> ()
self: Manager
operation: apiTypes.Opcode
data: T
Will send a message through all shards this Manager is currently responsible for. This message is sent to the discord WebSocket.
new
Will instantiate a new Manager class.