The Websocket manager for the Guilded API.

Example

new WebsocketManager({ version: 1, token: 'token' });

Hierarchy

  • EventEmitter
    • WebsocketManager

Constructors

Properties

lastMessageId?: string

The last message ID.

ping?: number

The ping of the websocket connection.

pingedAt?: Date

The date the websocket was pinged.

proxyUrl?: string

The proxy URL of the Websocket API.

readyAt?: Date

The date the websocket is ready.

reconnects: number

The anount of times the websocket has been reconnected.

socket?: WebSocket

The websocket.

token?: string

The auth token for the websocket.

version?: number

The version of the Websocket API.

Accessors

  • get isReady(): boolean
  • Whether the websocket is ready.

    Returns boolean

  • get pingedTimestamp(): undefined | number
  • The timestamp the websocket was pinged.

    Returns undefined | number

  • get readyTimestamp(): undefined | number
  • The timestamp of when the websocket is ready.

    Returns undefined | number

  • get uptime(): undefined | number
  • How long the websocket has been connected.

    Returns undefined | number

  • get url(): string
  • The URL of the Websocket.

    Returns string

Methods

  • Connect to the Websocket API.

    Returns

    The Websocket manager.

    Example

    ws.connect('token');
    

    Parameters

    • Optional token: string

      The auth token.

    Returns WebsocketManager

  • Disconnect from the Websocket API.

    Returns

    The websocket manager.

    Example

    ws.disconnect();
    

    Returns WebsocketManager