DiscordGatewayConnection

Constructors

this
this(string token, string yourBotUrl, string yourBotVersion)

Prepare a gateway connection. After you construct it, you still need to call connect.

Members

Functions

api
DiscordRestApi api()

An instance to the REST api object associated with your connection.

applicationId
string applicationId()

Returns your application id. Only available after the connection is established.

close
void close()
void close(int reason, string reasonText)
connect
void connect()
eventReceived
void eventReceived(string eventName, var data)
handleWebsocketClose
void handleWebsocketClose(WebSocket.CloseEvent closeEvent)
handleWebsocketMessage
void handleWebsocketMessage(char[] msg)
sendWebsocketCommand
void sendWebsocketCommand(OpCode op, var d)
setHeartbeatInterval
void setHeartbeatInterval(int msecs)
slashCommandHandler
void slashCommandHandler(SlashCommandHandler t)

Allows you to set up a subclass of SlashCommandHandler for handling discord slash commands.

websocket
WebSocket websocket()

Meta