Layer 220
Message
A message
constructor
message#9815cec8 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true from_scheduled:flags.18?true legacy:flags.19?true edit_hide:flags.21?true pinned:flags.24?true noforwards:flags.26?true invert_media:flags.27?true flags2:# offline:flags2.1?true video_processing_pending:flags2.4?true paid_suggested_post_stars:flags2.8?true paid_suggested_post_ton:flags2.9?true id:int from_id:flags.8?Peer from_boosts_applied:flags.29?int peer_id:Peer saved_peer_id:flags.28?Peer fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?long via_business_bot_id:flags2.0?long reply_to:flags.3?MessageReplyHeader date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector<MessageEntity> views:flags.10?int forwards:flags.10?int replies:flags.23?MessageReplies edit_date:flags.15?int post_author:flags.16?string grouped_id:flags.17?long reactions:flags.20?MessageReactions restriction_reason:flags.22?Vector<RestrictionReason> ttl_period:flags.25?int quick_reply_shortcut_id:flags.30?int effect:flags2.2?long factcheck:flags2.3?FactCheck report_delivery_until_date:flags2.5?int paid_message_stars:flags2.6?long suggested_post:flags2.7?SuggestedPost = Message;
Parameters
| Name | Type | Description |
|---|---|---|
| Flags | # | Flags, see TL conditional fields |
| Out | flags.1?true | Is this an outgoing message |
| Mentioned | flags.4?true | Whether we were mentioned in this message |
| MediaUnread | flags.5?true | Whether there are unread media attachments in this message |
| Silent | flags.13?true | Whether this is a silent message (no notification triggered) |
| Post | flags.14?true | Whether this is a channel post |
| FromScheduled | flags.18?true | Whether this is a scheduled message |
| Legacy | flags.19?true | This is a legacy message: it has to be refetched with the new layer |
| EditHide | flags.21?true | Whether the message should be shown as not modified to the user, even if an edit date is present |
| Pinned | flags.24?true | Whether this message is pinned |
| Noforwards | flags.26?true | Whether this message is protected and thus cannot be forwarded; clients should also prevent users from saving attached media (i. e. videos should only be streamed, photos should be kept in RAM, et cetera). |
| InvertMedia | flags.27?true | If set, any eventual webpage preview will be shown on top of the message instead of at the bottom. |
| Flags2 | # | Flags, see TL conditional fields |
| Offline | flags2.1?true | If set, the message was sent because of a scheduled action by the message sender, for example, as away, or a greeting service message. |
| VideoProcessingPending | flags2.4?true | The video contained in the message is currently being processed by the server (i. e. to generate alternative qualities, that will be contained in the final message Media Document. alt_document ), and will be sent once the video is processed, which will happen approximately at the specified date (i. e. messages with this flag set should be treated similarly to scheduled messages, but instead of the scheduled date, date contains the estimated conversion date). See here for more info. |
| PaidSuggestedPostStars | flags2.8?true | Set if this is a suggested channel post that was paid using Telegram Stars. |
| PaidSuggestedPostTon | flags2.9?true | Set if this is a suggested channel post that was paid using Toncoins. |
| Id | int | ID of the message |
| FromId | flags.8?Peer | ID of the sender of the message |
| FromBoostsApplied | flags.29?int | Supergroups only, contains the number of boosts this user has given the current supergroup, and should be shown in the UI in the header of the message. Only present for incoming messages from non-anonymous supergroup members that have boosted the supergroup. Note that this counter should be locally overridden for non-anonymous outgoing messages, according to the current value of channel Full. boosts_applied, to ensure the value is correct even for messages sent by the current user before a supergroup was boosted (or after a boost has expired or the number of boosts has changed); do not update this value for incoming messages from other users, even if their boosts have changed. |
| PeerId | Peer | Peer ID, the chat where this message was sent |
| SavedPeerId | flags.28?Peer | Messages from a saved messages dialog will have peer = input Peer Self and the saved_peer_id flag set to the ID of the saved dialog. Messages from a monoforum will have peer =ID of the monoforum and the saved_peer_id flag set to the ID of a topic. |
| FwdFrom | flags.2?MessageFwdHeader | Info about forwarded messages |
| ViaBotId | flags.11?long | ID of the inline bot that generated the message |
| ViaBusinessBotId | flags2.0?long | Whether the message was sent by the business bot specified in via_bot_id on behalf of the user. |
| ReplyTo | flags.3?MessageReplyHeader | Reply information |
| Date | int | Date of the message |
| Message | string | The message |
| Media | flags.9?MessageMedia | Media attachment |
| ReplyMarkup | flags.6?ReplyMarkup | Reply markup (bot/inline keyboards) |
| Entities | Vector<MessageEntity> | Message entities for styled text |
| Views | flags.10?int | View count for channel posts |
| Forwards | flags.10?int | Forward counter |
| Replies | flags.23?MessageReplies | Info about post comments (for channels) or message replies (for groups) |
| EditDate | flags.15?int | Last edit date of this message |
| PostAuthor | flags.16?string | Name of the author of this message for channel posts (with signatures enabled) |
| GroupedId | flags.17?long | Multiple media messages sent using messages. send Multi Media with the same grouped ID indicate an album or media group |
| Reactions | flags.20?MessageReactions | Reactions to this message |
| RestrictionReason | Vector<RestrictionReason> | Contains the reason why access to this message must be restricted. |
| TtlPeriod | flags.25?int | Time To Live of the message, once message. date+message. ttl_period === time(), the message will be deleted on the server, and must be deleted locally as well. |
| QuickReplyShortcutId | flags.30?int | If set, this message is a quick reply shortcut message (note that quick reply shortcut messages sent to a private chat will not have this field set). |
| Effect | flags2.2?long | A message effect that should be played as specified here. |
| Factcheck | flags2.3?FactCheck | Represents a fact-check. |
| ReportDeliveryUntilDate | flags2.5?int | Used for Telegram Gateway verification messages: if set and the current unixtime is bigger than the specified unixtime, invoke messages. report Messages Delivery passing the ID and the peer of this message as soon as it is received by the client (optionally batching requests for the same peer). |
| PaidMessageStars | flags2.6?long | The amount of stars the sender has paid to send the message, see here for more info. |
| SuggestedPost | flags2.7?SuggestedPost | Used to suggest a post to a channel, see here for more info on the full flow. |
Returns
MessageGogram Example
// Creating Message constructor obj := &tg.Message{ Offline: nil, VideoProcessingPending: nil, PaidSuggestedPostStars: nil, PaidSuggestedPostTon: nil, Id: 0, PeerId: &tg.Peer{}, // ... more required fields // Optional fields: // Out: true, // Mentioned: true, // MediaUnread: true, // Silent: true, // ... more optional fields }