export declare class VoiceWebSocket extends EventEmitterAn extension of the WebSocket class to provide helper functionality when interacting with the Discord Voice gateway.
destroy() : void
Destroys the VoiceWebSocket. The heartbeat interval is cleared, and the connection is closed.
onMessage(event: 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.
sendBinaryMessage(opcode: VoiceOpcodespayload: Buffer) : void
opcode: VoiceOpcodes
payload: Buffer
Sends a binary message over the WebSocket.
sendPacket(packet: VoiceSendPayload) : void
packet: VoiceSendPayload
Sends a JSON-stringifiable packet over the WebSocket.
Sets/clears an interval to send heartbeats over the WebSocket.