Skip to content

DiscordWebsocket

The DiscordWebsocket class manages the websocket connection to Discord. It handles sending and receiving messages, managing the connection state, and processing incoming and outgoing events.

Properties

websocketWebsocketBuffer

DiscordWebsocket.websocketWebsocketBuffer  :: Network.WebsocketBuffer

socketActiveChanged

DiscordWebsocket.socketActiveChanged  :: Vendor.Signal<boolean>

socketActive

DiscordWebsocket.socketActive  :: boolean

gatewayEventIn

DiscordWebsocket.gatewayEventIn  :: Network.EventIn

gatewayEventOut

DiscordWebsocket.gatewayEventOut  :: Network.EventOut

onMessageRecv

DiscordWebsocket.onMessageRecv  :: Vendor.Signal<string>

onSocketDead

DiscordWebsocket.onSocketDead  :: Vendor.Signal<number?>

onOperationRecv

DiscordWebsocket.onOperationRecv  :: Vendor.Signal<number, any, string?, number?>

reporter

DiscordWebsocket.reporter  :: Vendor.Console

socketUrl

DiscordWebsocket.socketUrl  :: STRING?

socketInstance

DiscordWebsocket.socketInstance  :: WebSocket

socketRequestSuccess

DiscordWebsocket.socketRequestSuccess  :: boolean?

socketThread

DiscordWebsocket.socketThread  :: thread?

Methods

sendAsync

DiscordWebsocket : sendAsync (

     self: DiscordWebsocket
     dataPacket: table
)  -> Vendor.Future

Sends a data packet asynchronously through the websocket.

connectAsync

DiscordWebsocket : connectAsync (

     self: DiscordWebsocket
     websocketUrl: string
)  -> Vendor.Future

Connects to a websocket URL asynchronously.

disconnectAsync

DiscordWebsocket : disconnectAsync (

     self: DiscordWebsocket
     closingCode: string
)  -> Vendor.Future

Disconnects from the websocket asynchronously.

Functions

new

DiscordWebsocket . new ()  -> ()

Creates a new instance of DiscordWebsocket.