Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/denocordts/src/websocket.ts>WebSocketClient

An Object Oriented Discord API wrapper for Deno.
Latest
class WebSocketClient
import { WebSocketClient } from "https://deno.land/x/denocordts@1.2.0/src/websocket.ts";

Constructors

new
WebSocketClient(url: string)

Properties

private
events: EventEmitter<WebSocketEvents>
private
open: boolean
private
ws: WebSocket
error: boolean

Methods

private
waitToConnect()
on<T = Message>(event: "message", listener: WebSocketEvents<T>["message"]): void
on(event: "close", listener: WebSocketEvents["close"]): void
on(event: "open", listener: WebSocketEvents["open"]): void
on(event: "error", listener: WebSocketEvents["error"]): void
send(message: Message)