Adds one attachment to the message's list of attachments, this will not overwrite any existing ones but just adds.
the attachment to add
Gets the attachments array for the message
Gets the resulting message that has been built up to the point of calling it.
Note: This will error out if the Room has not been defined OR if the room is not of type RoomType.LIVE_CHAT.
Returns a message builder based on the livechat message of this builder
Removes an attachment at the given position (index). If there is no attachment at that position, there will be an error thrown.
the index of the attachment to remove
Replaces an attachment at the given position (index). If there is no attachment at that position, there will be an error thrown.
the index of the attachment to replace
the attachment to replace with
Sets the attachments for the message, replacing and destroying all of the current attachments.
array of the attachments
Sets the url which to display for the avatar, this overwrites the current avatar whether it be the user's or an emoji one.
image url to use as the avatar
Provides a convient way to set the data for the message. Note: Providing an "id" field here will be ignored.
the message data to set
Sets the user who is editing this message. This is required if you are modifying an existing message.
the editor
Sets the emoji to use for the avatar, this overwrites the current avatar whether it be the user's or the avatar url provided.
the emoji code
Sets whether this message can group with others. This is desirable if you want to avoid confusion with other integrations.
whether this message can group with others
Sets whether this message should have any URLs in the text parsed by Rocket.Chat and get the details added to the message's attachments.
whether URLs should be parsed in this message
Sets the room where this message should be sent to.
the room where to send
Sets the sender of this message.
the user sending the message
Sets the text of the message.
the actual text
Set the token of the livechat visitor that sent the message
The Livechat visitor's token
Sets the display text of the sender's username that is visible.
the username alias to display
If the sender of the message is a Livechat Visitor, set the visitor who sent the message.
If you set the visitor property of a message, the sender will be emptied
The visitor who sent the message
Generated using TypeDoc
Interface for building out a livechat message. Please note, that a room and sender must be associated otherwise you will NOT be able to successfully save the message object.