Message class final

Describes a message

Inheritance
Available extensions
Annotations
  • @immutable

Constructors

Message({required int id, MessageSender? senderId, MessageSender? receiverId, required int chatId, MessageSendingState? sendingState, MessageSchedulingState? schedulingState, required bool isOutgoing, required bool isPinned, required bool isFromOffline, required bool canBeSaved, required bool hasTimestampedMedia, required bool isChannelPost, required bool isPaidStarSuggestedPost, required bool isPaidGramSuggestedPost, required bool containsUnreadMention, required bool containsUnreadPollVotes, required int date, required int editDate, MessageForwardInfo? forwardInfo, MessageImportInfo? importInfo, MessageInteractionInfo? interactionInfo, required List<UnreadReaction> unreadReactions, FactCheck? factCheck, SuggestedPostInfo? suggestedPostInfo, MessageReplyTo? replyTo, MessageTopic? topicId, MessageSelfDestructType? selfDestructType, required double selfDestructIn, required double autoDeleteIn, required int viaBotUserId, MessageSender? guestBotCallerId, required int senderBusinessBotUserId, required int senderBoostCount, required String senderTag, required int paidMessageStarCount, String? authorSignature, required int mediaAlbumId, required int effectId, RestrictionInfo? restrictionInfo, required String summaryLanguageCode, MessageContent? content, ReplyMarkup? replyMarkup, int? ephemeralMessageId})

Properties

authorSignature String?
authorSignature For channel posts and anonymous group messages, optional author signature
final
autoDeleteIn double
autoDeleteIn Time left before the message will be automatically deleted by message_auto_delete_time setting of the chat, in seconds; 0 if never
final
canBeSaved bool
canBeSaved True, if content of the message can be saved locally
final
chatId int
chatId Chat identifier
final
containsUnreadMention bool
containsUnreadMention True, if the message contains an unread mention for the current user
final
containsUnreadPollVotes bool
containsUnreadPollVotes True, if the message is a poll message with unread votes
final
content MessageContent?
content Content of the message
final
date int
date Point in time (Unix timestamp) when the message was sent; 0 for scheduled messages
final
editDate int
editDate Point in time (Unix timestamp) when the message was last edited; 0 for scheduled messages. If getOption("show_message_edit_date_by_default") is true, then the date must be shown along with the message instead of the date when the message was sent
final
effectId int
effectId Unique identifier of the effect added to the message; 0 if none
final
ephemeralMessageId int?
ephemeralMessageId Unique identifier of the ephemeral message if the message is ephemeral; for bots only
final
factCheck FactCheck?
factCheck Information about fact-check added to the message; may be null if none
final
forwardInfo MessageForwardInfo?
forwardInfo Information about the initial message sender; may be null if none or unknown
final
guestBotCallerId MessageSender?
guestBotCallerId The identifier of the user or chat which used a guest bot to send the message; may be null if none
final
hashCode int
The hash code for this object.
no setteroverride
hasTimestampedMedia bool
hasTimestampedMedia True, if media timestamp entities refers to a media in this message as opposed to a media in the replied message
final
id int
id Message identifier; unique for the chat to which the message belongs
final
importInfo MessageImportInfo?
importInfo Information about the initial message for messages created with importMessages; may be null if the message isn't imported
final
interactionInfo MessageInteractionInfo?
interactionInfo Information about interactions with the message; may be null if none
final
isChannelPost bool
isChannelPost True, if the message is a channel post. All messages to channels are channel posts, all other messages are not channel posts
final
isFromOffline bool
isFromOffline True, if the message was sent because of a scheduled action by the message sender, for example, as away, or greeting service message
final
isOutgoing bool
isOutgoing True, if the message is outgoing
final
isPaidGramSuggestedPost bool
isPaidGramSuggestedPost True, if the message is a suggested channel post which was paid in TON Grams; a warning must be shown if the message is deleted in less than getOption("suggested_post_lifetime_min") seconds after sending
final
isPaidStarSuggestedPost bool
isPaidStarSuggestedPost True, if the message is a suggested channel post which was paid in Telegram Stars; a warning must be shown if the message is deleted in less than getOption("suggested_post_lifetime_min") seconds after sending
final
isPinned bool
isPinned True, if the message is pinned
final
mediaAlbumId int
mediaAlbumId Unique identifier of an album this message belongs to; 0 if none. Only audios, documents, photos and videos can be grouped together in albums
final
paidMessageStarCount int
paidMessageStarCount The number of Telegram Stars the sender paid to send the message
final
receiverId MessageSender?
receiverId Identifier of the user or the chat which received the ephemeral message; may be null. Always null for non-ephemeral messages
final
replyMarkup ReplyMarkup?
replyMarkup Reply markup for the message; may be null if none
final
replyTo MessageReplyTo?
replyTo Information about the message or the story this message is replying to; may be null if none
final
restrictionInfo RestrictionInfo?
restrictionInfo Information about the restrictions that must be applied to the message content; may be null if none
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
schedulingState MessageSchedulingState?
schedulingState The scheduling state of the message; may be null if the message isn't scheduled
final
selfDestructIn double
selfDestructIn Time left before the message self-destruct timer expires, in seconds; 0 if self-destruction isn't scheduled yet
final
selfDestructType MessageSelfDestructType?
selfDestructType The message's self-destruct type; may be null if none
final
senderBoostCount int
senderBoostCount Number of times the sender of the message boosted the supergroup at the time the message was sent; 0 if none or unknown. For messages sent by the current user, supergroupFullInfo.my_boost_count must be used instead
final
senderBusinessBotUserId int
senderBusinessBotUserId If non-zero, the user identifier of the business bot that sent this message
final
senderId MessageSender?
senderId Identifier of the sender of the message
final
senderTag String
senderTag Tag of the sender of the message in the supergroup at the time the message was sent; may be empty if none or unknown. For messages sent in basic groups or supergroup administrators, the current custom title or tag must be used instead
final
sendingState MessageSendingState?
sendingState The sending state of the message; may be null if the message isn't being sent and didn't fail to be sent
final
suggestedPostInfo SuggestedPostInfo?
suggestedPostInfo Information about the suggested post; may be null if the message isn't a suggested post
final
summaryLanguageCode String
summaryLanguageCode IETF language tag of the message language on which it can be summarized; empty if summary isn't available for the message
final
topicId MessageTopic?
topicId Identifier of the topic within the chat to which the message belongs; may be null if none; may change when the chat is converted to a forum or back
final
unreadReactions List<UnreadReaction>
unreadReactions Information about unread reactions added to the message
final
viaBotUserId int
viaBotUserId If non-zero, the user identifier of the inline bot through which this message was sent
final

Methods

copyWith({int? id, MessageSender? senderId, MessageSender? receiverId, int? chatId, MessageSendingState? sendingState, MessageSchedulingState? schedulingState, bool? isOutgoing, bool? isPinned, bool? isFromOffline, bool? canBeSaved, bool? hasTimestampedMedia, bool? isChannelPost, bool? isPaidStarSuggestedPost, bool? isPaidGramSuggestedPost, bool? containsUnreadMention, bool? containsUnreadPollVotes, int? date, int? editDate, MessageForwardInfo? forwardInfo, MessageImportInfo? importInfo, MessageInteractionInfo? interactionInfo, List<UnreadReaction>? unreadReactions, FactCheck? factCheck, SuggestedPostInfo? suggestedPostInfo, MessageReplyTo? replyTo, MessageTopic? topicId, MessageSelfDestructType? selfDestructType, double? selfDestructIn, double? autoDeleteIn, int? viaBotUserId, MessageSender? guestBotCallerId, int? senderBusinessBotUserId, int? senderBoostCount, String? senderTag, int? paidMessageStarCount, String? authorSignature, int? mediaAlbumId, int? effectId, RestrictionInfo? restrictionInfo, String? summaryLanguageCode, MessageContent? content, ReplyMarkup? replyMarkup, int? ephemeralMessageId}) Message

Available on Message, provided by the MessageExtensions extension

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

Operators

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

Static Methods

fromJson(Map<String, dynamic>? json) Message?

Constants

constructor → const String