GatewayClient

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

Constructors

this
this(Client client, bool eventTracking)

Members

Functions

log
Logger log()

Logger for this GatewayClient.

run
void run(Game game)

Runs the GatewayClient until completion

send
void send(Serializable p)

Send a gateway payload.

start
void start(Game game)

Starts a connection to the gateway. Also called for resuming/reconnecting.

updateStatus
void updateStatus(Game game)

Undocumented in source. Be warned that the author may not have intended to support it.

Variables

client
Client client;

Client instance for this gateway connection

connected
bool connected;

Whether this GatewayClient is currently connected

eventEmitter
Emitter eventEmitter;

Event emitter for Gateway Packets

heartbeatInterval
uint heartbeatInterval;

Heartbeat interval

heartbeater
Task heartbeater;

The heartbeater task

reconnects
ubyte reconnects;

Number of reconnects attempted

seq
uint seq;

Gateway sequence number, used for resuming

sessionID
string sessionID;

Gateway SessionID, used for resuming.

sock
WebSocket sock;

WebSocket connection for this gateway connection

Meta