---
source_url: https://www.pubnub.com/docs/chat/kotlin-chat-sdk/learn/chat-entities/message-draft
title: MessageDraft object
updated_at: 2026-06-15T12:11:38.470Z
---

> Documentation Index
> For a curated overview of PubNub documentation, see: https://www.pubnub.com/docs/llms.txt
> For the full list of all documentation pages, see: https://www.pubnub.com/docs/llms-full.txt


# MessageDraft object

`MessageDraft` represents a message that has not been published yet.

## Properties

The `MessageDraft` object has the following properties:

```kotlin
interface MessageDraft {
    val channel: Channel
    val userSuggestionSource: UserSuggestionSource
    val isTypingIndicatorTriggered: Boolean
    val userLimit: Int
    val channelLimit: Int
    var quotedMessage: Message?
    val files: MutableList<InputFile>
}
```

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| channel | Channel | Optional |  | The [Channel](https://www.pubnub.com/docs/chat/kotlin-chat-sdk/learn/chat-entities/channel) where this Message Draft will be published. |
| userSuggestionSource | UserSuggestionSource | Optional |  | This parameter refers to the [Mentions](https://www.pubnub.com/docs/chat/kotlin-chat-sdk/build/features/users/mentions) feature. Data source from which you want to retrieve users. You can choose either the list of channel members (`UserSuggestionSource.CHANNEL`) or users on the app's Admin Portal keyset (`UserSuggestionSource.GLOBAL`). |
| isTypingIndicatorTriggered | Boolean | Optional |  | This parameter refers to the [Typing Indicator](https://www.pubnub.com/docs/chat/kotlin-chat-sdk/build/features/channels/typing-indicator) feature. Defines if the typing indicator should be enabled when writing the message. |
| userLimit | Int | Optional |  | This parameter refers to the [Mentions](https://www.pubnub.com/docs/chat/kotlin-chat-sdk/build/features/users/mentions) feature. Maximum number of usernames (`name` field from the `User` object) you can mention in one message. The default value is `10`, the min is `1`, and max is `100`. |
| channelLimit | Int | Optional |  | This parameter refers to the [References](https://www.pubnub.com/docs/chat/kotlin-chat-sdk/build/features/channels/references) feature. Maximum number of channel names (`name` field from the `Channel` object) you can reference in one message. The default value is `10`, the min is `1`, and max is `100`. |
| quotedMessage | Message? | Optional |  | Object added to a draft message when you [quote another message](https://www.pubnub.com/docs/chat/kotlin-chat-sdk/build/features/messages/quotes). |
| files | MutableList<InputFile> | Optional |  | One or multiple files attached to the draft text message. |

## Methods

The `MessageDraft` object exposes the following methods.

* [addChangeListener()](https://www.pubnub.com/docs/chat/kotlin-chat-sdk/build/features/messages/drafts#add-message-draft-change-listener)
* [removeChangeListener()](https://www.pubnub.com/docs/chat/kotlin-chat-sdk/build/features/messages/drafts#remove-message-draft-change-listener)
* [addMention()](https://www.pubnub.com/docs/chat/kotlin-chat-sdk/build/features/messages/drafts#add-message-element)
* [removeMention()](https://www.pubnub.com/docs/chat/kotlin-chat-sdk/build/features/messages/drafts#remove-message-element)
* [insertText()](https://www.pubnub.com/docs/chat/kotlin-chat-sdk/build/features/messages/drafts#insert-message-text)
* [removeText()](https://www.pubnub.com/docs/chat/kotlin-chat-sdk/build/features/messages/drafts#remove-message-text)
* [insertSuggestedMention()](https://www.pubnub.com/docs/chat/kotlin-chat-sdk/build/features/messages/drafts#insert-suggested-message-element)
* [send()](https://www.pubnub.com/docs/chat/kotlin-chat-sdk/build/features/messages/drafts#send-a-draft-message)
* [update()](https://www.pubnub.com/docs/chat/kotlin-chat-sdk/build/features/messages/drafts#update-message-text)

## Use case

`MessageDraft` methods enable users to prepare [draft messages](https://www.pubnub.com/docs/chat/kotlin-chat-sdk/build/features/messages/drafts#create-a-draft-message) with:

* [Links](https://www.pubnub.com/docs/chat/kotlin-chat-sdk/build/features/messages/links)
* [User mentions](https://www.pubnub.com/docs/chat/kotlin-chat-sdk/build/features/users/mentions) with `@`
* [Channel references](https://www.pubnub.com/docs/chat/kotlin-chat-sdk/build/features/channels/references) with `#`