export declare class VoiceWebSocket extends EventEmitter
An extension of the WebSocket class to provide helper functionality when interacting with the Discord Voice gateway.
destroyvoid () :
Destroys the VoiceWebSocket. The heartbeat interval is cleared, and the connection is closed.
onMessageevent: MessageEvent) : void (
event: MessageEvent
Handles message events on the WebSocket. Attempts to JSON parse the messages and emit them as packets. Binary messages will be parsed and emitted.
sendBinaryMessageopcode: VoiceOpcodespayload: Buffer) : void (
opcode: VoiceOpcodes
payload: Buffer
Sends a binary mesasge over the WebSocket.
sendPacketpacket: VoiceSendPayload) : void (
packet: VoiceSendPayload
Sends a JSON-stringifiable packet over the WebSocket.
Sets/clears an interval to send heartbeats over the WebSocket.