Class: Message

Message

A Message represents a Message in a Channel.

Properties:
Name Type Description
author String The name of the user that authored this Message.
body String The body of the Message.
attributes Object Message custom attributes
channel Channel The Channel the Message belongs to.
dateUpdated Date When the Message was updated.
index Number Index of Message in the Channel's messages stream.
lastUpdatedBy String The name of the last user updated this Message.
sid String The server-assigned unique identifier for the Message.
timestamp Date When the Message was sent.
Fires:
  • Message#event:updated

Methods


remove()

Remove the Message.
Returns:
Type
Promise.<(Message|SessionError)>

updateAttributes(attributes)

Edit message attributes.
Parameters:
Name Type Description
attributes Object new attributes for Message.
Returns:
Type
Promise.<(Message|Error|SessionError)>

updateBody(body)

Edit message body.
Parameters:
Name Type Description
body String new body of Message.
Returns:
Type
Promise.<(Message|Error|SessionError)>