MessageDraft object
MessageDraft
is an object that refers to a single message that has not been published yet.
Properties
The MessageDraft
object has no properties.
Methods
The MessageDraft
object uses instances of these classes:
UPubnubMentionTarget
to include specific mention targets (user mentions, channel references, or URLs) within these elements.UPubnubMessageElement
to compose message draft content.UPubnubMessageDraft
to manage these components, enabling the drafting, editing, and eventual sending of a complete message.
Click on each method for more details.
addChangeListener()
AddChangeListenerWithSuggestions()
AddMention()
RemoveMention()
InsertText()
RemoveText()
InsertSuggestedMention()
Send()
Update()
Use case
For example, you can use the MessageDraft
object methods to let users work on the created draft messages to prepare the final content. They can enrich that content with links, mention other channel members with @
, or reference channels with #
.