Message constructor
Message({
- String? id,
- String? text,
- String type = 'regular',
- List<
Attachment> attachments = const [], - List<
User> mentionedUsers = const [], - bool silent = false,
- bool shadowed = false,
- Map<
String, int> ? reactionCounts, - Map<
String, int> ? reactionScores, - List<
Reaction> ? latestReactions, - List<
Reaction> ? ownReactions, - String? parentId,
- Message? quotedMessage,
- String? quotedMessageId,
- int? replyCount = 0,
- List<
User> ? threadParticipants, - bool? showInChannel,
- String? command,
- DateTime? createdAt,
- DateTime? updatedAt,
- DateTime? deletedAt,
- User? user,
- bool pinned = false,
- DateTime? pinnedAt,
- DateTime? pinExpires,
- User? pinnedBy,
- Map<
String, Object?> extraData = const {}, - MessageSendingStatus status = MessageSendingStatus.sending,
- Map<
String, String> ? i18n,
Constructor used for json serialization.
Implementation
Message({
String? id,
this.text,
this.type = 'regular',
this.attachments = const [],
this.mentionedUsers = const [],
this.silent = false,
this.shadowed = false,
this.reactionCounts,
this.reactionScores,
this.latestReactions,
this.ownReactions,
this.parentId,
this.quotedMessage,
String? quotedMessageId,
this.replyCount = 0,
this.threadParticipants,
this.showInChannel,
this.command,
DateTime? createdAt,
DateTime? updatedAt,
this.deletedAt,
this.user,
this.pinned = false,
this.pinnedAt,
DateTime? pinExpires,
this.pinnedBy,
this.extraData = const {},
this.status = MessageSendingStatus.sending,
this.i18n,
}) : id = id ?? const Uuid().v4(),
pinExpires = pinExpires?.toUtc(),
_createdAt = createdAt,
_updatedAt = updatedAt,
_quotedMessageId = quotedMessageId;