Class: Room

Room(client, id)

Represents a chatroom

Constructor

new Room(client, id)

Creates an instance of Room.
Parameters:
Name Type Description
client Client The Client instance
id number The id of the room
Source:

Extends

  • EventEmitter

Methods

(async) join() → {Promise.<void>}

Join a chat room
Source:
Returns:
A promise when the user succesfully joins this room
Type
Promise.<void>

sendMessage(message) → {Promise.<void>}

Sends a message to this room
Parameters:
Name Type Description
message string The message to send
Source:
Throws:
If `content` > 500 character, empty, or isn't a string.
Type
InvalidArgumentError
Returns:
A promise that completes when the message has been sent
Type
Promise.<void>

(async) watch() → {Promise.<void>}

Connects to the chatroom websocket, and watches for new events
Source:
Returns:
A promise that completes when the webscocket connection is successfull.
Type
Promise.<void>