MessageDraft object
MessageDraft represents a message that has not been published yet. Use drafts to add user mentions, channel references, URLs, and files before sending.
Properties
The MessageDraft object has the following properties:
1extension MessageDraftImpl: MessageDraft {
2 public var channel: ChannelImpl
3 public var isTypingIndicatorTriggered: Bool
4 public var userSuggestionSource: userSuggestionSource
5 public var userLimit: Int
6 public var channelLimit: Int
7 public var quotedMessage: MessageImpl?
8 public var files: [InputFile]
9}
| Parameter | Description |
|---|---|
channelType: ChannelImpl | Channel where this Message Draft will be published. |
isTypingIndicatorTriggeredType: Bool | This parameter refers to the Typing Indicator feature. Defines if the typing indicator should be enabled when writing the message. |
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). |
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: MessageImpl or undefined | Object added to a draft message when you quote another message. |
filesType: [InputFile] | One or multiple files attached to the draft text message. |
Methods
You can call the following methods on the MessageDraft object.
Click on each method for more details.
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
#