Class GatewayClient

GatewayClient is the base abstraction for connecting to, and interacting with the Discord Websocket (gateway) API.

Inherits from

  • Object (base class)

Constructors

Name Description
this

Fields

Name Type Description
client Client Client instance for this gateway connection
connected bool Whether this GatewayClient is currently connected
eventEmitter Emitter Event emitter for Gateway Packets
heartbeater vibe.core.task.Task The heartbeater task
heartbeatInterval uint Heartbeat interval
reconnects ubyte Number of reconnects attempted
seq uint Gateway sequence number, used for resuming
sessionID string Gateway SessionID, used for resuming.
sock vibe.http.websockets.WebSocket WebSocket connection for this gateway connection

Properties

Name Type Description
log [get] std.experimental.logger.core.Logger Logger for this GatewayClient.

Methods

Name Description
run Runs the GatewayClient until completion.
send Send a gateway payload.
start Starts a connection to the gateway. Also called for resuming/reconnecting.