Message#

class pyrogram.raw.types.Message#

A message

Constructor of Message.

Details:
  • Layer: 187

  • ID: 94345242

Parameters:
  • id (int 32-bit) – ID of the message

  • peer_id (Peer) – Peer ID, the chat where this message was sent

  • date (int 32-bit) – Date of the message

  • message (str) – The message

  • out (bool, optional) – Is this an outgoing message

  • mentioned (bool, optional) – Whether we were mentioned in this message

  • media_unread (bool, optional) – Whether there are unread media attachments in this message

  • silent (bool, optional) – Whether this is a silent message (no notification triggered)

  • post (bool, optional) – Whether this is a channel post

  • from_scheduled (bool, optional) – Whether this is a scheduled message

  • legacy (bool, optional) – This is a legacy message: it has to be refetched with the new layer

  • edit_hide (bool, optional) – Whether the message should be shown as not modified to the user, even if an edit date is present

  • pinned (bool, optional) – Whether this message is pinned

  • noforwards (bool, optional) – 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).

  • invert_media (bool, optional) – If set, any eventual webpage preview will be shown on top of the message instead of at the bottom.

  • offline (bool, optional) – If set, the message was sent because of a scheduled action by the message sender, for example, as away, or a greeting service message.

  • from_id (Peer, optional) – ID of the sender of the message

  • from_boosts_applied (int 32-bit, optional) – 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 channelFull.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.

  • saved_peer_id (Peer, optional) – Messages fetched from a saved messages dialog » will have peer=inputPeerSelf and the saved_peer_id flag set to the ID of the saved dialog.

  • fwd_from (MessageFwdHeader, optional) – Info about forwarded messages

  • via_bot_id (int 64-bit, optional) – ID of the inline bot that generated the message

  • via_business_bot_id (int 64-bit, optional) – Whether the message was sent by the business bot specified in via_bot_id on behalf of the user.

  • reply_to (MessageReplyHeader, optional) – Reply information

  • media (MessageMedia, optional) – Media attachment

  • reply_markup (ReplyMarkup, optional) – Reply markup (bot/inline keyboards)

  • entities (List of MessageEntity, optional) – Message entities for styled text

  • views (int 32-bit, optional) – View count for channel posts

  • forwards (int 32-bit, optional) – Forward counter

  • replies (MessageReplies, optional) – Info about post comments (for channels) or message replies (for groups)

  • edit_date (int 32-bit, optional) – Last edit date of this message

  • post_author (str, optional) – Name of the author of this message for channel posts (with signatures enabled)

  • grouped_id (int 64-bit, optional) – Multiple media messages sent using messages.sendMultiMedia with the same grouped ID indicate an album or media group

  • reactions (MessageReactions, optional) – Reactions to this message

  • restriction_reason (List of RestrictionReason, optional) – Contains the reason why access to this message must be restricted.

  • ttl_period (int 32-bit, optional) – 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.

  • quick_reply_shortcut_id (int 32-bit, optional) – 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 (int 64-bit, optional) – A message effect that should be played as specified here ».

  • factcheck (FactCheck, optional) – Represents a fact-check ».