GatewayClient

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

Constructors

this
this(Client client)
Undocumented in source.

Members

Functions

run
void run()

Runs the GatewayClient until completion.

send
void send(Serializable p)

Send a gateway payload.

start
void start()

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

Properties

log
Logger log [@property getter]

Logger for this GatewayClient.

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

hb_interval
uint hb_interval;

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