Message class

Constructors

Message({List<Attachment> attachments = const [], bool? beforeMessageSendFailed, required String cid, String? command, required DateTime createdAt, Map<String, Object> custom = const {}, DateTime? deletedAt, required int deletedReplyCount, required String html, Map<String, String> i18n = const {}, required String id, Map<String, List<String>> imageLabels = const {}, List<Reaction> latestReactions = const [], List<UserObject> mentionedUsers = const [], DateTime? messageTextUpdatedAt, String? mml, List<Reaction> ownReactions = const [], String? parentId, DateTime? pinExpires, required bool pinned, DateTime? pinnedAt, UserObject? pinnedBy, Poll? poll, String? pollId, Message? quotedMessage, String? quotedMessageId, Map<String, int> reactionCounts = const {}, Map<String, ReactionGroupResponse> reactionGroups = const {}, Map<String, int> reactionScores = const {}, required int replyCount, required bool shadowed, bool? showInChannel, required bool silent, required String text, List<UserObject> threadParticipants = const [], required MessageTypeEnum type, required DateTime updatedAt, UserObject? user})
Returns a new Message instance.

Properties

attachments List<Attachment>
Array of message attachments
getter/setter pair
beforeMessageSendFailed bool?
Whether before_message_send webhook failed or not. Field is only accessible in push webhook
getter/setter pair
cid String
Channel unique identifier in
getter/setter pair
command String?
Contains provided slash command
getter/setter pair
createdAt DateTime
Date/time of creation
getter/setter pair
custom Map<String, Object>
getter/setter pair
deletedAt DateTime?
Date/time of deletion
getter/setter pair
deletedReplyCount int
getter/setter pair
hashCode int
The hash code for this object.
no setteroverride
html String
Contains HTML markup of the message. Can only be set when using server-side API
getter/setter pair
i18n Map<String, String>
Object with translations. Key language contains the original language key. Other keys contain translations
getter/setter pair
id String
Message ID is unique string identifier of the message
getter/setter pair
imageLabels Map<String, List<String>>
Contains image moderation information
getter/setter pair
latestReactions List<Reaction>
List of 10 latest reactions to this message
getter/setter pair
mentionedUsers List<UserObject>
List of mentioned users
getter/setter pair
messageTextUpdatedAt DateTime?
Please note: This property should have been non-nullable! Since the specification file does not include a default value (using the "default:" property), however, the generated source code must fall back to having a nullable type. Consider adding a "default:" property in the specification file to hide this note.
getter/setter pair
mml String?
Should be empty if text is provided. Can only be set when using server-side API
getter/setter pair
ownReactions List<Reaction>
List of 10 latest reactions of authenticated user to this message
getter/setter pair
parentId String?
ID of parent message (thread)
getter/setter pair
pinExpires DateTime?
Date when pinned message expires
getter/setter pair
pinned bool
Whether message is pinned or not
getter/setter pair
pinnedAt DateTime?
Date when message got pinned
getter/setter pair
pinnedBy UserObject?
Please note: This property should have been non-nullable! Since the specification file does not include a default value (using the "default:" property), however, the generated source code must fall back to having a nullable type. Consider adding a "default:" property in the specification file to hide this note.
getter/setter pair
poll Poll?
Please note: This property should have been non-nullable! Since the specification file does not include a default value (using the "default:" property), however, the generated source code must fall back to having a nullable type. Consider adding a "default:" property in the specification file to hide this note.
getter/setter pair
pollId String?
Identifier of the poll to include in the message
getter/setter pair
quotedMessage Message?
Please note: This property should have been non-nullable! Since the specification file does not include a default value (using the "default:" property), however, the generated source code must fall back to having a nullable type. Consider adding a "default:" property in the specification file to hide this note.
getter/setter pair
quotedMessageId String?
Please note: This property should have been non-nullable! Since the specification file does not include a default value (using the "default:" property), however, the generated source code must fall back to having a nullable type. Consider adding a "default:" property in the specification file to hide this note.
getter/setter pair
reactionCounts Map<String, int>
An object containing number of reactions of each type. Key: reaction type (string), value: number of reactions (int)
getter/setter pair
reactionGroups Map<String, ReactionGroupResponse>
getter/setter pair
reactionScores Map<String, int>
An object containing scores of reactions of each type. Key: reaction type (string), value: total score of reactions (int)
getter/setter pair
replyCount int
Number of replies to this message
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shadowed bool
Whether the message was shadowed or not
getter/setter pair
showInChannel bool?
Whether thread reply should be shown in the channel as well
getter/setter pair
silent bool
Whether message is silent or not
getter/setter pair
text String
Text of the message. Should be empty if mml is provided
getter/setter pair
threadParticipants List<UserObject>
List of users who participate in thread
getter/setter pair
type MessageTypeEnum
Contains type of the message
getter/setter pair
updatedAt DateTime
Date/time of the last update
getter/setter pair
user UserObject?
Please note: This property should have been non-nullable! Since the specification file does not include a default value (using the "default:" property), however, the generated source code must fall back to having a nullable type. Consider adding a "default:" property in the specification file to hide this note.
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
override

Static Methods

fromJson(dynamic value) Message?
Returns a new Message instance and imports its values from value if it's a Map, null otherwise.
listFromJson(dynamic json, {bool growable = false}) List<Message>
mapFromJson(dynamic json) Map<String, Message>
mapListFromJson(dynamic json, {bool growable = false}) Map<String, List<Message>>

Constants

requiredKeys → const Set<String>
The list of required keys that must be present in a JSON.