On this page

MessageDraft object

MessageDraft represents a message that has not been published yet.

MessageDraft has the following properties:

1class MessageDraft {
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

MessageDraft methods enable users to prepare draft messages with:

Last updated on
On this page