On this page

MessageDraftV2 object

MessageDraftV2 represents a message that has not been published yet.

Message draft versions

Version 2 provides a more generic way to work with user mentions, channel references, and links ("message elements"). Refer to Drafts (v2) and Drafts (v1).

MessageDraftV2 has the following properties:

1class MessageDraftV2 {
2 channel: Channel,
3 value: string,
4 quotedMessage?: Message,
5 config: MessageDraftConfig,
6 files?: FileList | File[] | SendFileParameters["file"][];
7}
ParameterDescription
channel
Type: Channel
The channel the draft message is being created on.
value
Type: string
Message that includes mentions.
quotedMessage
Type: Message or undefined
Object added to a draft message when you quote another message.
config
Type: MessageDraftConfig
Configuration of the message containing mentions - what is the user source (channel members or app's keyset users), whether the typing indicator is enabled, and what is the maximum number of user names mentioned in one message (the default value is 10 and max is 100).
files
Type: FileList or File[] or SendFileParameters["file"][], or undefined
One or multiple files attached to the draft text message. They can take the form of a read-only files property of the HTML <input /> element (when a user has selected one or more files from their device), or through a drag-and-drop operation (FileList). Alternatively, that can be an array of file objects (File[]) or PubNub-specific `SendFileParameters["file"][].
icon

Message draft configuration


Methods

Available methods:

Use case

MessageDraftV2 methods enable users to prepare draft messages with:

Last updated on
On this page