MessageDraft object
MessageDraft represents a message that has not been published yet.
Properties
The MessageDraft object has the following properties:
1interface MessageDraft {
2 val channel: Channel
3 val userSuggestionSource: UserSuggestionSource
4 val isTypingIndicatorTriggered: Boolean
5 val userLimit: Int
6 val channelLimit: Int
7 var quotedMessage: Message?
8 val files: MutableList<InputFile>
9}
| Parameter | Description |
|---|---|
channelType: Channel | The Channel where this Message Draft will be published. |
userSuggestionSourceType: UserSuggestionSource | This parameter refers to the 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). |
isTypingIndicatorTriggeredType: Boolean | This parameter refers to the Typing Indicator feature. Defines if the typing indicator should be enabled when writing the message. |
userLimitType: Int | This parameter refers to the 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. |
channelLimitType: Int | This parameter refers to the 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. |
quotedMessageType: Message or undefined | Object added to a draft message when you quote another message. |
filesType: MutableList<InputFile> | One or multiple files attached to the draft text message. |
Methods
The MessageDraft object exposes the following methods.
addChangeListener()removeChangeListener()addMention()removeMention()insertText()removeText()insertSuggestedMention()send()update()
Use case
MessageDraft methods enable users to prepare draft messages with:
- Links
- User mentions with
@ - Channel references with
#