This class sends membership changes for rooms in a linearized queue. The queue is lineaized based upon the hash value of the roomId, so that two operations for the same roomId may never happen concurrently.

Constructors

Methods

  • Join a user to a room

    Parameters

    • roomId: string

      The roomId to join

    • userId: undefined | string

      Leave empty to act as the bot user.

    • req: ThinRequest

      The request entry for logging context

    • retry: boolean = true

      Should the request retry if it fails

    • Optional ttl: number

      How long should this request remain queued in milliseconds before it's discarded. Defaults to opts.defaultTtlMs

    Returns Promise<void>

    A promise that resolves when the membership has completed

  • Leave OR kick a user from a room

    Parameters

    • roomId: string

      The roomId to leave

    • userId: string

      Leave empty to act as the bot user.

    • req: ThinRequest

      The request entry for logging context

    • retry: boolean = true

      Should the request retry if it fails

    • Optional reason: string

      Reason for leaving/kicking

    • Optional kickUser: string

      The user to be kicked. If left blank, this will be a leave.

    • Optional ttl: number

      How long should this request remain queued in milliseconds before it's discarded. Defaults to opts.defaultTtlMs

    Returns Promise<void>

    A promise that resolves when the membership has completed

Generated using TypeDoc