Class: Message

Message

A Message represents a Message in a Channel.

Properties:
Name Type Description
author String The name of the user that sent Message
body String The body of the Message. Is null if Message is Media Message
attributes Object Message custom attributes
channel Channel Channel Message belongs to
dateUpdated Date When Message was updated
index Number Index of Message in the Channel's messages list
lastUpdatedBy String Identity of the last user that updated Message
media Media Contains Media information (if present)
sid String The server-assigned unique identifier for Message
timestamp Date When Message was created
type 'text' | 'media' Type of message: 'text' or 'media'
Fires:

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)>

Events


updated

Fired when the Message's properties or body has been updated.
Type: Message