Options
All
  • Public
  • Public/Protected
  • All
Menu

Represents a chatroom

Hierarchy

  • EventEmitter
    • Room

Index

Constructors

  • Creates an instance of Room.

    memberof

    Room

    Parameters

    • client: Client

      The Client instance

    • id: number

      The id of the room

    Returns Room

Properties

id: number
leaving: boolean = false

Accessors

  • get transcriptURL(): string
  • summary

    returns the room's transcript URL

    Returns string

Methods

  • block(user: number | User, howLong?: number): void
  • Blocks a user for a given amount of time (or forever)

    memberof

    Room

    Parameters

    • user: number | User

      user to block

    • howLong: number = Infinity

      how long to block the user (in seconds)

    Returns void

  • Adds a chat event type to the list of ignored types

    memberof

    Room

    Parameters

    Returns void

  • isBlocked(user: number | User): boolean
  • Checks if a user is blocked

    memberof

    Room

    Parameters

    • user: number | User

      user to check

    Returns boolean

  • join(): Promise<boolean>
  • summary

    Join a chat room

    memberof

    Room#

    Returns Promise<boolean>

    A promise when the user succesfully joins this room

  • leave(): Promise<boolean>
  • summary

    Leave a chat room

    memberof

    Room#

    Returns Promise<boolean>

    A promise when the user succesfully leaves this room

  • listUsers(): Promise<User[]>
  • summary

    returns a list of users currently in the room

    Returns Promise<User[]>

  • summary

    exclusively subscribes to a list of events

    Parameters

    Returns void

  • sendMessage(message: string): Promise<Message>
  • summary

    Sends a message to this room

    throws

    {InvalidArgumentError} If content > 500 character, empty, or isn't a string.

    memberof

    Room#

    Parameters

    • message: string

      The message to send

    Returns Promise<Message>

    A promise with the message that was sent

  • unblock(...users: (number | User)[]): void
  • Unblocks users

    memberof

    Room

    Parameters

    • Rest ...users: (number | User)[]

      users to unblock

    Returns void

  • Removes an event type from the list of ignored types

    memberof

    Room

    Parameters

    Returns void

  • update(config: Omit<IRoomSave, "host">): Promise<boolean>
  • summary

    attempts to update the room

    Parameters

    Returns Promise<boolean>

  • watch(): Promise<Room>
  • Connects to the chatroom websocket, and watches for new events

    memberof

    Room

    Returns Promise<Room>

    A promise that completes when the webscocket connection is successfull.

Generated using TypeDoc