Message class

The class that contains the information about a message

Implementers
Annotations

Constructors

Message({String id, String text, String type, List<Attachment> attachments, List<User> mentionedUsers, bool silent, Map<String, int> reactionCounts, Map<String, int> reactionScores, List<Reaction> latestReactions, List<Reaction> ownReactions, String parentId, int replyCount: 0, bool showInChannel, String command, DateTime createdAt, DateTime updatedAt, User user, Map<String, dynamic> extraData, DateTime deletedAt, MessageSendingStatus status: MessageSendingStatus.SENT})
Constructor used for json serialization
Message.fromJson(Map<String, dynamic> json)
Create a new instance from a json
factory

Properties

attachments List<Attachment>
The list of attachments, either provided by the user or generated from a command or as a result of URL scraping.
@JsonKey(includeIfNull: false), final
command String
A used command name.
@JsonKey(includeIfNull: false, toJson: Serialization.readOnly), final
createdAt DateTime
Reserved field indicating when the message was created.
@JsonKey(includeIfNull: false, toJson: Serialization.readOnly), final
deletedAt DateTime
Reserved field indicating when the message was deleted.
@JsonKey(includeIfNull: false, toJson: Serialization.readOnly), final
extraData Map<String, dynamic>
Message custom extraData
@JsonKey(includeIfNull: false), final
hashCode int
The hash code for this object. [...]
read-only, inherited
id String
The message ID. This is either created by Stream or set client side when the message is added.
final
isDeleted bool
True if the message has been deleted
read-only
isEphemeral bool
True if the message is ephemeral
read-only
isSystem bool
True if the message is a system info
read-only
latestReactions List<Reaction>
The latest reactions to the message created by any user.
@JsonKey(includeIfNull: false, toJson: Serialization.readOnly), final
mentionedUsers List<User>
The list of user mentioned in the message
@JsonKey(toJson: Serialization.userIds), final
ownReactions List<Reaction>
The reactions added to the message by the current user.
@JsonKey(includeIfNull: false, toJson: Serialization.readOnly), final
parentId String
The ID of the parent message, if the message is a reply.
final
reactionCounts Map<String, int>
A map describing the count of number of every reaction
@JsonKey(includeIfNull: false, toJson: Serialization.readOnly), final
reactionScores Map<String, int>
A map describing the count of score of every reaction
@JsonKey(includeIfNull: false, toJson: Serialization.readOnly), final
replyCount int
Reserved field indicating the number of replies for this message.
@JsonKey(includeIfNull: false, toJson: Serialization.readOnly), final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
showInChannel bool
Check if this message needs to show in the channel.
final
silent bool
If true the message is silent
final
status MessageSendingStatus
The status of a sending message
@JsonKey(ignore: true), final
text String
The text of this message
final
type String
The message type
@JsonKey(includeIfNull: false, toJson: Serialization.readOnly), final
updatedAt DateTime
Reserved field indicating when the message was updated last time.
@JsonKey(includeIfNull: false, toJson: Serialization.readOnly), final
user User
User who sent the message
@JsonKey(includeIfNull: false, toJson: Serialization.readOnly), final

Methods

copyWith({String id, String text, String type, List<Attachment> attachments, List<User> mentionedUsers, Map<String, int> reactionCounts, Map<String, int> reactionScores, List<Reaction> latestReactions, List<Reaction> ownReactions, String parentId, int replyCount, bool showInChannel, bool silent, String command, DateTime createdAt, DateTime updatedAt, DateTime deletedAt, User user, Map<String, dynamic> extraData, MessageSendingStatus status}) Message
Creates a copy of Message with specified attributes overridden.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toJson() Map<String, dynamic>
Serialize to json
toString() String
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) bool
The equality operator. [...]
inherited

Constants

topLevelFields → const List<String>
Known top level fields. Useful for Serialization methods.
const ['id', 'text', 'type', 'silent', 'attachments', 'latest_reactions', 'own_reactions', 'mentioned_users', 'reaction_counts',…