Message class

This object represents a message.

Constructors

Message({required int messageId, User? from, Chat? senderChat, required int date, required Chat chat, User? forwardFrom, Chat? forwardFromChat, int? forwardFromMessageId, String? forwardSignature, String? forwardSenderName, int? forwardDate, bool? isAutomaticForward, Message? replyToMessage, User? viaBot, int? editDate, bool? hasProtectedContent, String? mediaGroupId, String? authorSignature, String? text, List<MessageEntity>? entities, Animation? animation, Audio? audio, Document? document, List<PhotoSize>? photo, Sticker? sticker, Video? video, VideoNote? videoNote, Voice? voice, String? caption, List<MessageEntity>? captionEntities, Contact? contact, Dice? dice, Game? game, Poll? poll, Venue? venue, Location? location, List<User>? newChatMembers, User? leftChatMember, String? newChatTitle, List<PhotoSize>? newChatPhoto, bool? deleteChatPhoto, bool? groupChatCreated, bool? supergroupChatCreated, bool? channelChatCreated, MessageAutoDeleteTimerChanged? messageAutoDeleteTimerChanged, int? migrateToChatId, int? migrateFromChatId, Message? pinnedMessage, Invoice? invoice, SuccessfulPayment? successfulPayment, String? connectedWebsite, PassportData? passportData, ProximityAlertTriggered? proximityAlertTriggered, VideoChatScheduled? videoChatScheduled, VideoChatStarted? videoChatStarted, VideoChatEnded? videoChatEnded, VideoChatParticipantsInvited? videoChatParticipantsInvited, WebAppData? webAppData, ReplyMarkup? replyMarkup})
Basic constructor

Properties

animation Animation?
Optional. Message is an animation, information about the animation. For backward compatibility, when this field is set, the document fiel will also be set
getter/setter pair
audio Audio?
Optional. Message is an audio file, information about the file
getter/setter pair
authorSignature String?
Optional. Signature of the post author for messages in channels, or the custom title of an anonymous group administrator
getter/setter pair
caption String?
Optional. Caption for the animation, audio, document, photo, video or voice
getter/setter pair
captionEntities List<MessageEntity>?
Optional. For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption
getter/setter pair
channelChatCreated bool?
Optional. Service message: the channel has been created. This field can't be received in a message coming through updates, because bot can't be a member of a channel when it is created. It can only be found in reply_to_message if someone replies to a very first message in a channel.
getter/setter pair
chat Chat
Conversation the message belongs to
getter/setter pair
connectedWebsite String?
Optional. The domain name of the website on which the user has logged in.
getter/setter pair
contact Contact?
Optional. Message is a shared contact, information about the contact
getter/setter pair
date int
Date the message was sent in Unix time
getter/setter pair
deleteChatPhoto bool?
Optional. Service message: the chat photo was deleted
getter/setter pair
dice Dice?
Optional. Message is a dice with random value
getter/setter pair
document Document?
Optional. Message is a general file, information about the file
getter/setter pair
editDate int?
Optional. Date the message was last edited in Unix time
getter/setter pair
entities List<MessageEntity>?
Optional. For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text
getter/setter pair
forwardDate int?
Optional. For forwarded messages, date the original message was sent in Unix time
getter/setter pair
forwardFrom User?
Optional. For forwarded messages, sender of the original message
getter/setter pair
forwardFromChat Chat?
Optional. For messages forwarded from channels or from anonymous administrators, information about the original sender chat
getter/setter pair
forwardFromMessageId int?
Optional. For messages forwarded from channels, identifier of the original message in the channel
getter/setter pair
forwardSenderName String?
Optional. Sender's name for messages forwarded from users who disallow adding a link to their account in forwarded messages
getter/setter pair
forwardSignature String?
Optional. For forwarded messages that were originally sent in channels or by an anonymous chat administrator, signature of the message sender if present
getter/setter pair
from User?
Optional. Sender of the message; empty for messages sent to channels. For backward compatibility, the field contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat.
getter/setter pair
game Game?
Optional. Message is a game, information about the game.
getter/setter pair
groupChatCreated bool?
Optional. Service message: the group has been created
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
hasProtectedContent bool?
Optional. True, if the message can't be forwarded
getter/setter pair
invoice Invoice?
Optional. Message is an invoice for a payment, information about the invoice.
getter/setter pair
isAutomaticForward bool?
Optional. True, if the message is a channel post that was automatically forwarded to the connected discussion group
getter/setter pair
leftChatMember User?
Optional. A member was removed from the group, information about them (this member may be the bot itself)
getter/setter pair
location Location?
Optional. Message is a shared location, information about the location
getter/setter pair
mediaGroupId String?
Optional. The unique identifier of a media message group this message belongs to
getter/setter pair
messageAutoDeleteTimerChanged MessageAutoDeleteTimerChanged?
Optional. Service message: auto-delete timer settings changed in the chat
getter/setter pair
messageId int
Unique message identifier inside this chat
getter/setter pair
migrateFromChatId int?
Optional. The supergroup has been migrated from a group with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.
getter/setter pair
migrateToChatId int?
Optional. The group has been migrated to a supergroup with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.
getter/setter pair
newChatMembers List<User>?
Optional. New members that were added to the group or supergroup and information about them (the bot itself may be one of these members)
getter/setter pair
newChatPhoto List<PhotoSize>?
Optional. A chat photo was change to this value
getter/setter pair
newChatTitle String?
Optional. A chat title was changed to this value
getter/setter pair
passportData PassportData?
Optional. Telegram Passport data
getter/setter pair
photo List<PhotoSize>?
Optional. Message is a photo, available sizes of the photo
getter/setter pair
pinnedMessage Message?
Optional. Specified message was pinned. Note that the Message object in this field will not contain further reply_to_message fields even if it is itself a reply.
getter/setter pair
poll Poll?
Optional. Message is a native poll, information about the poll
getter/setter pair
proximityAlertTriggered ProximityAlertTriggered?
Optional. Service message. A user in the chat triggered another user's proximity alert while sharing Live Location.
getter/setter pair
replyMarkup ReplyMarkup?
Optional. Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons.
getter/setter pair
replyToMessage Message?
Optional. For replies, the original message. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
senderChat Chat?
Optional. Sender of the message, sent on behalf of a chat. For example, the channel itself for channel posts, the supergroup itself for messages from anonymous group administrators, the linked channel for messages automatically forwarded to the discussion group. For backward compatibility, the field from contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat.
getter/setter pair
sticker Sticker?
Optional. Message is a sticker, information about the sticker
getter/setter pair
successfulPayment SuccessfulPayment?
Optional. Message is a service message about a successful payment, information about the payment.
getter/setter pair
supergroupChatCreated bool?
Optional. Service message: the supergroup has been created. This field can't be received in a message coming through updates, because bot can't be a member of a supergroup when it is created. It can only be found in reply_to_message if someone replies to a very first message in a directly created supergroup.
getter/setter pair
text String?
Optional. For text messages, the actual UTF-8 text of the message
getter/setter pair
venue Venue?
Optional. Message is a venue, information about the venue. For backward compatibility, when this field is set, the location field will also be set
getter/setter pair
viaBot User?
Optional. Bot through which the message was sent
getter/setter pair
video Video?
Optional. Message is a video, information about the video
getter/setter pair
videoChatEnded VideoChatEnded?
Optional. Service message: video chat ended
getter/setter pair
videoChatParticipantsInvited VideoChatParticipantsInvited?
Optional. Service message: new participants invited to a video chat
getter/setter pair
videoChatScheduled VideoChatScheduled?
Optional. Service message: video chat scheduled
getter/setter pair
videoChatStarted VideoChatStarted?
Optional. Service message: video chat started
getter/setter pair
videoNote VideoNote?
Optional. Message is a video note, information about the video message
getter/setter pair
voice Voice?
Optional. Message is a voice message, information about the file
getter/setter pair
webAppData WebAppData?
Optional. Service message: data sent by a Web App
getter/setter pair

Methods

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

Operators

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

Static Methods

fromJson(Map<String, dynamic> json) Message
Creates a object from a json
listFromJsonArray(List array) List<Message>
Creates a list of object from a json array