Class: Message

Message(room, id, event)

Represents a message that was sent in a chatroom

Constructor

new Message(room, id, event)

Creates an instance of Message.
Parameters:
Name Type Description
room Room The room object that this message originated from
id number The ID of the message
event Object The event object from the websocket
Source:

Methods

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

Send a reply to this message, replying to the user (This will ping the user)
Parameters:
Name Type Description
message string The message to send
Source:
Throws:
If message > 500 character, empty, or isn't a string.
Type
InvalidArgumentError
Returns:
A promise that resolves when the message was sent
Type
Promise.<void>