SponsoredMessage

class pyrogram.raw.types.SponsoredMessage

A sponsored message.

Constructor of SponsoredMessage.

Details:
  • Layer: 227

  • ID: 7DBF8673

Parameters:
  • random_id (bytes) – Message ID

  • url (str) – Contains the URL to open when the user clicks on the sponsored message.

  • title (str) – Contains the title of the sponsored message.

  • message (str) – Sponsored message

  • button_text (str) – Label of the sponsored message button.

  • recommended (bool, optional) – Whether the message needs to be labeled as “recommended” instead of “sponsored”

  • can_report (bool, optional) – Whether this message can be reported as specified here ».

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

  • photo (Photo, optional) – If set, contains a custom profile photo bubble that should be displayed for the sponsored message, like for messages sent in groups.

  • media (MessageMedia, optional) – If set, contains some media.

  • color (PeerColor, optional) – If set, the sponsored message should use the message accent color » specified in color.

  • sponsor_info (str, optional) – If set, contains additional information about the sponsor to be shown along with the message.

  • additional_info (str, optional) – If set, contains additional information about the sponsored message to be shown along with the message.

  • min_display_duration (int 32-bit, optional) – For sponsored messages to show on channel videos », allow the user to hide the ad only after the specified amount of seconds.

  • max_display_duration (int 32-bit, optional) – For sponsored messages to show on channel videos », autohide the ad after after the specified amount of seconds.

TL Schema

sponsoredMessage#7dbf8673
flags:#
recommended:flags.5?true
can_report:flags.12?true
random_id:bytes
url:string
title:string
message:string
entities:flags.1?Vector<MessageEntity>
photo:flags.6?Photo
media:flags.14?MessageMedia
color:flags.13?PeerColor
button_text:string
sponsor_info:flags.7?string
additional_info:flags.8?string
min_display_duration:flags.15?int
max_display_duration:flags.15?int

= SponsoredMessage

Parameter Tree

SponsoredMessage
├── recommended → true (optional)
├── can_report → true (optional)
├── random_id → bytes
├── url → string
├── title → string
├── message → string
├── entities → Vector < MessageEntity > (optional)
│ ├── MessageEntityUnknown
│ │ ├── offset → int
│ │ └── length → int
│ ├── MessageEntityMention
│ │ ├── offset → int
│ │ └── length → int
│ ├── MessageEntityHashtag
│ │ ├── offset → int
│ │ └── length → int
│ │ ├── offset → int
│ │ └── length → int
│ ├── MessageEntityUrl
│ │ ├── offset → int
│ │ └── length → int
│ ├── MessageEntityEmail
│ │ ├── offset → int
│ │ └── length → int
│ ├── MessageEntityBold
│ │ ├── offset → int
│ │ └── length → int
│ ├── MessageEntityItalic
│ │ ├── offset → int
│ │ └── length → int
│ ├── MessageEntityCode
│ │ ├── offset → int
│ │ └── length → int
│ ├── MessageEntityPre
│ │ ├── offset → int
│ │ ├── length → int
│ │ └── language → string
│ ├── MessageEntityTextUrl
│ │ ├── offset → int
│ │ ├── length → int
│ │ └── url → string
│ │ ├── offset → int
│ │ ├── length → int
│ │ └── user_id → long
│ │ ├── offset → int
│ │ ├── length → int
│ │ └── user_id → InputUser
│ │ ├── InputUserEmpty
│ │ ├── InputUserSelf
│ │ ├── InputUser
│ │ └── InputUserFromMessage
│ ├── MessageEntityPhone
│ │ ├── offset → int
│ │ └── length → int
│ ├── MessageEntityCashtag
│ │ ├── offset → int
│ │ └── length → int
│ │ ├── offset → int
│ │ └── length → int
│ ├── MessageEntityStrike
│ │ ├── offset → int
│ │ └── length → int
│ ├── MessageEntityBankCard
│ │ ├── offset → int
│ │ └── length → int
│ ├── MessageEntitySpoiler
│ │ ├── offset → int
│ │ └── length → int
│ │ ├── offset → int
│ │ ├── length → int
│ │ └── document_id → long
│ │ ├── collapsed → true (optional)
│ │ ├── offset → int
│ │ └── length → int
│ │ ├── relative → true (optional)
│ │ ├── short_time → true (optional)
│ │ ├── long_time → true (optional)
│ │ ├── short_date → true (optional)
│ │ ├── long_date → true (optional)
│ │ ├── day_of_week → true (optional)
│ │ ├── offset → int
│ │ ├── length → int
│ │ └── date → int
│ │ ├── offset → int
│ │ └── length → int
│ │ ├── offset → int
│ │ ├── length → int
│ │ └── old_text → string
│ ├── offset → int
│ └── length → int
├── photo → Photo (optional)
│ ├── PhotoEmpty
│ │ └── id → long
│ └── Photo
│ ├── has_stickers → true (optional)
│ ├── id → long
│ ├── access_hash → long
│ ├── file_reference → bytes
│ ├── date → int
│ ├── sizes → Vector < PhotoSize >
│ │ ├── PhotoSizeEmpty
│ │ │ └── type → string
│ │ ├── PhotoSize
│ │ │ ├── type → string
│ │ │ ├── w → int
│ │ │ ├── h → int
│ │ │ └── size → int
│ │ ├── PhotoCachedSize
│ │ │ ├── type → string
│ │ │ ├── w → int
│ │ │ ├── h → int
│ │ │ └── bytes → bytes
│ │ ├── PhotoStrippedSize
│ │ │ ├── type → string
│ │ │ └── bytes → bytes
│ │ ├── PhotoSizeProgressive
│ │ │ ├── type → string
│ │ │ ├── w → int
│ │ │ ├── h → int
│ │ │ └── sizes → Vector < int >
│ │ └── PhotoPathSize
│ │ ├── type → string
│ │ └── bytes → bytes
│ ├── video_sizes → Vector < VideoSize > (optional)
│ │ ├── VideoSize
│ │ │ ├── type → string
│ │ │ ├── w → int
│ │ │ ├── h → int
│ │ │ ├── size → int
│ │ │ └── video_start_ts → double (optional)
│ │ ├── VideoSizeEmojiMarkup
│ │ │ ├── emoji_id → long
│ │ │ └── background_colors → Vector < int >
│ │ └── VideoSizeStickerMarkup
│ │ ├── stickerset → InputStickerSet
│ │ │ ├── InputStickerSetEmpty
│ │ │ ├── InputStickerSetID
│ │ │ ├── InputStickerSetShortName
│ │ │ ├── InputStickerSetAnimatedEmoji
│ │ │ ├── InputStickerSetDice
│ │ │ ├── InputStickerSetPremiumGifts
│ │ │ └── InputStickerSetTonGifts
│ │ ├── sticker_id → long
│ │ └── background_colors → Vector < int >
│ └── dc_id → int
├── media → MessageMedia (optional)
│ ├── MessageMediaEmpty
│ ├── MessageMediaPhoto
│ │ ├── spoiler → true (optional)
│ │ ├── live_photo → true (optional)
│ │ ├── photo → Photo (optional)
│ │ │ ├── PhotoEmpty
│ │ │ │ └── id → long
│ │ │ └── Photo
│ │ │ ├── has_stickers → true (optional)
│ │ │ ├── id → long
│ │ │ ├── access_hash → long
│ │ │ ├── file_reference → bytes
│ │ │ ├── date → int
│ │ │ ├── sizes → Vector < PhotoSize >
│ │ │ │ ├── PhotoSizeEmpty
│ │ │ │ ├── PhotoSize
│ │ │ │ ├── PhotoCachedSize
│ │ │ │ ├── PhotoStrippedSize
│ │ │ │ ├── PhotoSizeProgressive
│ │ │ │ └── PhotoPathSize
│ │ │ ├── video_sizes → Vector < VideoSize > (optional)
│ │ │ │ ├── VideoSize
│ │ │ │ ├── VideoSizeEmojiMarkup
│ │ │ │ └── VideoSizeStickerMarkup
│ │ │ └── dc_id → int
│ │ ├── ttl_seconds → int (optional)
│ │ └── video → Document (optional)
│ │ ├── DocumentEmpty
│ │ │ └── id → long
│ │ └── Document
│ │ ├── id → long
│ │ ├── access_hash → long
│ │ ├── file_reference → bytes
│ │ ├── date → int
│ │ ├── mime_type → string
│ │ ├── size → long
│ │ ├── thumbs → Vector < PhotoSize > (optional)
│ │ │ ├── PhotoSizeEmpty
│ │ │ ├── PhotoSize
│ │ │ ├── PhotoCachedSize
│ │ │ ├── PhotoStrippedSize
│ │ │ ├── PhotoSizeProgressive
│ │ │ └── PhotoPathSize
│ │ ├── video_thumbs → Vector < VideoSize > (optional)
│ │ │ ├── VideoSize
│ │ │ ├── VideoSizeEmojiMarkup
│ │ │ └── VideoSizeStickerMarkup
│ │ ├── dc_id → int
│ │ └── attributes → Vector < DocumentAttribute >
│ │ ├── DocumentAttributeImageSize
│ │ ├── DocumentAttributeAnimated
│ │ ├── DocumentAttributeSticker
│ │ ├── DocumentAttributeVideo
│ │ ├── DocumentAttributeAudio
│ │ ├── DocumentAttributeFilename
│ ├── MessageMediaGeo
│ │ └── geo → GeoPoint
│ │ ├── GeoPointEmpty
│ │ └── GeoPoint
│ │ ├── long → double
│ │ ├── lat → double
│ │ ├── access_hash → long
│ │ └── accuracy_radius → int (optional)
│ ├── MessageMediaContact
│ │ ├── phone_number → string
│ │ ├── first_name → string
│ │ ├── last_name → string
│ │ ├── vcard → string
│ │ └── user_id → long
│ ├── MessageMediaDocument
│ │ ├── nopremium → true (optional)
│ │ ├── spoiler → true (optional)
│ │ ├── video → true (optional)
│ │ ├── round → true (optional)
│ │ ├── voice → true (optional)
│ │ ├── document → Document (optional)
│ │ │ ├── DocumentEmpty
│ │ │ │ └── id → long
│ │ │ └── Document
│ │ │ ├── id → long
│ │ │ ├── access_hash → long
│ │ │ ├── file_reference → bytes
│ │ │ ├── date → int
│ │ │ ├── mime_type → string
│ │ │ ├── size → long
│ │ │ ├── thumbs → Vector < PhotoSize > (optional)
│ │ │ │ ├── PhotoSizeEmpty
│ │ │ │ ├── PhotoSize
│ │ │ │ ├── PhotoCachedSize
│ │ │ │ ├── PhotoStrippedSize
│ │ │ │ ├── PhotoSizeProgressive
│ │ │ │ └── PhotoPathSize
│ │ │ ├── video_thumbs → Vector < VideoSize > (optional)
│ │ │ │ ├── VideoSize
│ │ │ │ ├── VideoSizeEmojiMarkup
│ │ │ │ └── VideoSizeStickerMarkup
│ │ │ ├── dc_id → int
│ │ │ └── attributes → Vector < DocumentAttribute >
│ │ │ ├── DocumentAttributeImageSize
│ │ │ ├── DocumentAttributeAnimated
│ │ │ ├── DocumentAttributeSticker
│ │ │ ├── DocumentAttributeVideo
│ │ │ ├── DocumentAttributeAudio
│ │ │ ├── DocumentAttributeFilename
│ │ │ ├── DocumentAttributeHasStickers
│ │ │ └── DocumentAttributeCustomEmoji
│ │ ├── alt_documents → Vector < Document > (optional)
│ │ │ ├── DocumentEmpty
│ │ │ │ └── id → long
│ │ │ └── Document
│ │ │ ├── id → long
│ │ │ ├── access_hash → long
│ │ │ ├── file_reference → bytes
│ │ │ ├── date → int
│ │ │ ├── mime_type → string
│ │ │ ├── size → long
│ │ │ ├── thumbs → Vector < PhotoSize > (optional)
│ │ │ │ ├── PhotoSizeEmpty
│ │ │ │ ├── PhotoSize
│ │ │ │ ├── PhotoCachedSize
│ │ │ │ ├── PhotoStrippedSize
│ │ │ │ ├── PhotoSizeProgressive
│ │ │ │ └── PhotoPathSize
│ │ │ ├── video_thumbs → Vector < VideoSize > (optional)
│ │ │ │ ├── VideoSize
│ │ │ │ ├── VideoSizeEmojiMarkup
│ │ │ │ └── VideoSizeStickerMarkup
│ │ │ ├── dc_id → int
│ │ │ └── attributes → Vector < DocumentAttribute >
│ │ │ ├── DocumentAttributeImageSize
│ │ │ ├── DocumentAttributeAnimated
│ │ │ ├── DocumentAttributeSticker
│ │ │ ├── DocumentAttributeVideo
│ │ │ ├── DocumentAttributeAudio
│ │ │ ├── DocumentAttributeFilename
│ │ │ ├── DocumentAttributeHasStickers
│ │ │ └── DocumentAttributeCustomEmoji
│ │ ├── video_cover → Photo (optional)
│ │ │ ├── PhotoEmpty
│ │ │ │ └── id → long
│ │ │ └── Photo
│ │ │ ├── has_stickers → true (optional)
│ │ │ ├── id → long
│ │ │ ├── access_hash → long
│ │ │ ├── file_reference → bytes
│ │ │ ├── date → int
│ │ │ ├── sizes → Vector < PhotoSize >
│ │ │ │ ├── PhotoSizeEmpty
│ │ │ │ ├── PhotoSize
│ │ │ │ ├── PhotoCachedSize
│ │ │ │ ├── PhotoStrippedSize
│ │ │ │ ├── PhotoSizeProgressive
│ │ │ │ └── PhotoPathSize
│ │ │ ├── video_sizes → Vector < VideoSize > (optional)
│ │ │ │ ├── VideoSize
│ │ │ │ ├── VideoSizeEmojiMarkup
│ │ │ │ └── VideoSizeStickerMarkup
│ │ │ └── dc_id → int
│ │ ├── video_timestamp → int (optional)
│ │ └── ttl_seconds → int (optional)
│ ├── MessageMediaWebPage
│ │ ├── force_large_media → true (optional)
│ │ ├── force_small_media → true (optional)
│ │ ├── manual → true (optional)
│ │ ├── safe → true (optional)
│ │ └── webpage → WebPage
│ │ ├── WebPageEmpty
│ │ │ ├── id → long
│ │ │ └── url → string (optional)
│ │ ├── WebPagePending
│ │ │ ├── id → long
│ │ │ ├── url → string (optional)
│ │ │ └── date → int
│ │ ├── WebPage
│ │ │ ├── has_large_media → true (optional)
│ │ │ ├── video_cover_photo → true (optional)
│ │ │ ├── id → long
│ │ │ ├── url → string
│ │ │ ├── display_url → string
│ │ │ ├── hash → int
│ │ │ ├── type → string (optional)
│ │ │ ├── site_name → string (optional)
│ │ │ ├── title → string (optional)
│ │ │ ├── description → string (optional)
│ │ │ ├── photo → Photo (optional)
│ │ │ │ ├── PhotoEmpty
│ │ │ │ └── Photo
│ │ │ ├── embed_url → string (optional)
│ │ │ ├── embed_type → string (optional)
│ │ │ ├── embed_width → int (optional)
│ │ │ ├── embed_height → int (optional)
│ │ │ ├── duration → int (optional)
│ │ │ ├── author → string (optional)
│ │ │ ├── document → Document (optional)
│ │ │ │ ├── DocumentEmpty
│ │ │ │ └── Document
│ │ │ ├── cached_page → Page (optional)
│ │ │ │ └── Page
│ │ │ └── attributes → Vector < WebPageAttribute > (optional)
│ │ │ ├── WebPageAttributeTheme
│ │ │ ├── WebPageAttributeStory
│ │ │ ├── WebPageAttributeStickerSet
│ │ │ ├── WebPageAttributeUniqueStarGift
│ │ │ ├── WebPageAttributeStarGiftAuction
│ │ │ └── WebPageAttributeAiComposeTone
│ │ └── WebPageNotModified
│ │ └── cached_page_views → int (optional)
│ ├── MessageMediaVenue
│ │ ├── geo → GeoPoint
│ │ │ ├── GeoPointEmpty
│ │ │ └── GeoPoint
│ │ │ ├── long → double
│ │ │ ├── lat → double
│ │ │ ├── access_hash → long
│ │ │ └── accuracy_radius → int (optional)
│ │ ├── title → string
│ │ ├── address → string
│ │ ├── provider → string
│ │ ├── venue_id → string
│ │ └── venue_type → string
│ ├── MessageMediaGame
│ │ └── game → Game
│ │ └── Game
│ │ ├── id → long
│ │ ├── access_hash → long
│ │ ├── short_name → string
│ │ ├── title → string
│ │ ├── description → string
│ │ ├── photo → Photo
│ │ │ ├── PhotoEmpty
│ │ │ └── Photo
│ │ └── document → Document (optional)
│ │ ├── DocumentEmpty
│ │ └── Document
│ ├── MessageMediaInvoice
│ │ ├── shipping_address_requested → true (optional)
│ │ ├── test → true (optional)
│ │ ├── title → string
│ │ ├── description → string
│ │ ├── photo → WebDocument (optional)
│ │ │ ├── WebDocument
│ │ │ │ ├── url → string
│ │ │ │ ├── access_hash → long
│ │ │ │ ├── size → int
│ │ │ │ ├── mime_type → string
│ │ │ │ └── attributes → Vector < DocumentAttribute >
│ │ │ │ ├── DocumentAttributeImageSize
│ │ │ │ ├── DocumentAttributeAnimated
│ │ │ │ ├── DocumentAttributeSticker
│ │ │ │ ├── DocumentAttributeVideo
│ │ │ │ ├── DocumentAttributeAudio
│ │ │ │ ├── DocumentAttributeFilename
│ │ │ │ ├── DocumentAttributeHasStickers
│ │ │ │ └── DocumentAttributeCustomEmoji
│ │ │ └── WebDocumentNoProxy
│ │ │ ├── url → string
│ │ │ ├── size → int
│ │ │ ├── mime_type → string
│ │ │ └── attributes → Vector < DocumentAttribute >
│ │ │ ├── DocumentAttributeImageSize
│ │ │ ├── DocumentAttributeAnimated
│ │ │ ├── DocumentAttributeSticker
│ │ │ ├── DocumentAttributeVideo
│ │ │ ├── DocumentAttributeAudio
│ │ │ ├── DocumentAttributeFilename
│ │ │ ├── DocumentAttributeHasStickers
│ │ │ └── DocumentAttributeCustomEmoji
│ │ ├── receipt_msg_id → int (optional)
│ │ ├── currency → string
│ │ ├── total_amount → long
│ │ ├── start_param → string
│ │ └── extended_media → MessageExtendedMedia (optional)
│ │ ├── MessageExtendedMediaPreview
│ │ │ ├── w → int (optional)
│ │ │ ├── h → int (optional)
│ │ │ ├── thumb → PhotoSize (optional)
│ │ │ │ ├── PhotoSizeEmpty
│ │ │ │ ├── PhotoSize
│ │ │ │ ├── PhotoCachedSize
│ │ │ │ ├── PhotoStrippedSize
│ │ │ │ ├── PhotoSizeProgressive
│ │ │ │ └── PhotoPathSize
│ │ │ └── video_duration → int (optional)
│ │ └── MessageExtendedMedia
│ │ └── media → MessageMedia
│ │ ├── MessageMediaEmpty
│ │ ├── MessageMediaPhoto
│ │ ├── MessageMediaGeo
│ │ ├── MessageMediaContact
│ │ ├── MessageMediaUnsupported
│ │ ├── MessageMediaDocument
│ │ ├── MessageMediaWebPage
│ │ ├── MessageMediaVenue
│ │ ├── MessageMediaGame
│ │ ├── MessageMediaInvoice
│ │ ├── MessageMediaGeoLive
│ │ ├── MessageMediaPoll
│ │ ├── MessageMediaDice
│ │ ├── MessageMediaStory
│ │ ├── MessageMediaGiveaway
│ │ ├── MessageMediaGiveawayResults
│ │ ├── MessageMediaPaidMedia
│ │ ├── MessageMediaToDo
│ │ └── MessageMediaVideoStream
│ ├── MessageMediaGeoLive
│ │ ├── geo → GeoPoint
│ │ │ ├── GeoPointEmpty
│ │ │ └── GeoPoint
│ │ │ ├── long → double
│ │ │ ├── lat → double
│ │ │ ├── access_hash → long
│ │ │ └── accuracy_radius → int (optional)
│ │ ├── heading → int (optional)
│ │ ├── period → int
│ │ └── proximity_notification_radius → int (optional)
│ ├── MessageMediaPoll
│ │ ├── poll → Poll
│ │ │ └── Poll
│ │ │ ├── id → long
│ │ │ ├── closed → true (optional)
│ │ │ ├── public_voters → true (optional)
│ │ │ ├── multiple_choice → true (optional)
│ │ │ ├── quiz → true (optional)
│ │ │ ├── open_answers → true (optional)
│ │ │ ├── revoting_disabled → true (optional)
│ │ │ ├── shuffle_answers → true (optional)
│ │ │ ├── hide_results_until_close → true (optional)
│ │ │ ├── creator → true (optional)
│ │ │ ├── subscribers_only → true (optional)
│ │ │ ├── question → TextWithEntities
│ │ │ │ └── TextWithEntities
│ │ │ ├── answers → Vector < PollAnswer >
│ │ │ │ ├── PollAnswer
│ │ │ │ └── InputPollAnswer
│ │ │ ├── close_period → int (optional)
│ │ │ ├── close_date → int (optional)
│ │ │ ├── countries_iso2 → Vector < string > (optional)
│ │ │ └── hash → long
│ │ ├── results → PollResults
│ │ │ └── PollResults
│ │ │ ├── min → true (optional)
│ │ │ ├── has_unread_votes → true (optional)
│ │ │ ├── can_view_stats → true (optional)
│ │ │ ├── results → Vector < PollAnswerVoters > (optional)
│ │ │ │ └── PollAnswerVoters
│ │ │ ├── total_voters → int (optional)
│ │ │ ├── recent_voters → Vector < Peer > (optional)
│ │ │ │ ├── PeerUser
│ │ │ │ ├── PeerChat
│ │ │ │ └── PeerChannel
│ │ │ ├── solution → string (optional)
│ │ │ ├── solution_entities → Vector < MessageEntity > (optional)
│ │ │ │ ├── MessageEntityUnknown
│ │ │ │ ├── MessageEntityMention
│ │ │ │ ├── MessageEntityHashtag
│ │ │ │ ├── MessageEntityBotCommand
│ │ │ │ ├── MessageEntityUrl
│ │ │ │ ├── MessageEntityEmail
│ │ │ │ ├── MessageEntityBold
│ │ │ │ ├── MessageEntityItalic
│ │ │ │ ├── MessageEntityCode
│ │ │ │ ├── MessageEntityPre
│ │ │ │ ├── MessageEntityTextUrl
│ │ │ │ ├── MessageEntityMentionName
│ │ │ │ ├── InputMessageEntityMentionName
│ │ │ │ ├── MessageEntityPhone
│ │ │ │ ├── MessageEntityCashtag
│ │ │ │ ├── MessageEntityUnderline
│ │ │ │ ├── MessageEntityStrike
│ │ │ │ ├── MessageEntityBankCard
│ │ │ │ ├── MessageEntitySpoiler
│ │ │ │ ├── MessageEntityCustomEmoji
│ │ │ │ ├── MessageEntityBlockquote
│ │ │ │ ├── MessageEntityFormattedDate
│ │ │ │ ├── MessageEntityDiffInsert
│ │ │ │ ├── MessageEntityDiffReplace
│ │ │ │ └── MessageEntityDiffDelete
│ │ │ └── solution_media → MessageMedia (optional)
│ │ │ ├── MessageMediaEmpty
│ │ │ ├── MessageMediaPhoto
│ │ │ ├── MessageMediaGeo
│ │ │ ├── MessageMediaContact
│ │ │ ├── MessageMediaUnsupported
│ │ │ ├── MessageMediaDocument
│ │ │ ├── MessageMediaWebPage
│ │ │ ├── MessageMediaVenue
│ │ │ ├── MessageMediaGame
│ │ │ ├── MessageMediaInvoice
│ │ │ ├── MessageMediaGeoLive
│ │ │ ├── MessageMediaPoll
│ │ │ ├── MessageMediaDice
│ │ │ ├── MessageMediaStory
│ │ │ ├── MessageMediaGiveaway
│ │ │ ├── MessageMediaGiveawayResults
│ │ │ ├── MessageMediaPaidMedia
│ │ │ ├── MessageMediaToDo
│ │ │ └── MessageMediaVideoStream
│ │ └── attached_media → MessageMedia (optional)
│ │ ├── MessageMediaEmpty
│ │ ├── MessageMediaPhoto
│ │ │ ├── spoiler → true (optional)
│ │ │ ├── live_photo → true (optional)
│ │ │ ├── photo → Photo (optional)
│ │ │ │ ├── PhotoEmpty
│ │ │ │ └── Photo
│ │ │ ├── ttl_seconds → int (optional)
│ │ │ └── video → Document (optional)
│ │ │ ├── DocumentEmpty
│ │ │ └── Document
│ │ ├── MessageMediaGeo
│ │ │ └── geo → GeoPoint
│ │ │ ├── GeoPointEmpty
│ │ │ └── GeoPoint
│ │ ├── MessageMediaContact
│ │ │ ├── phone_number → string
│ │ │ ├── first_name → string
│ │ │ ├── last_name → string
│ │ │ ├── vcard → string
│ │ │ └── user_id → long
│ │ ├── MessageMediaUnsupported
│ │ ├── MessageMediaDocument
│ │ │ ├── nopremium → true (optional)
│ │ │ ├── spoiler → true (optional)
│ │ │ ├── video → true (optional)
│ │ │ ├── round → true (optional)
│ │ │ ├── voice → true (optional)
│ │ │ ├── document → Document (optional)
│ │ │ │ ├── DocumentEmpty
│ │ │ │ └── Document
│ │ │ ├── alt_documents → Vector < Document > (optional)
│ │ │ │ ├── DocumentEmpty
│ │ │ │ └── Document
│ │ │ ├── video_cover → Photo (optional)
│ │ │ │ ├── PhotoEmpty
│ │ │ │ └── Photo
│ │ │ ├── video_timestamp → int (optional)
│ │ │ └── ttl_seconds → int (optional)
│ │ ├── MessageMediaWebPage
│ │ │ ├── force_large_media → true (optional)
│ │ │ ├── force_small_media → true (optional)
│ │ │ ├── manual → true (optional)
│ │ │ ├── safe → true (optional)
│ │ │ └── webpage → WebPage
│ │ │ ├── WebPageEmpty
│ │ │ ├── WebPagePending
│ │ │ ├── WebPage
│ │ │ └── WebPageNotModified
│ │ ├── MessageMediaVenue
│ │ │ ├── geo → GeoPoint
│ │ │ │ ├── GeoPointEmpty
│ │ │ │ └── GeoPoint
│ │ │ ├── title → string
│ │ │ ├── address → string
│ │ │ ├── provider → string
│ │ │ ├── venue_id → string
│ │ │ └── venue_type → string
│ │ ├── MessageMediaGame
│ │ │ └── game → Game
│ │ │ └── Game
│ │ ├── MessageMediaInvoice
│ │ │ ├── shipping_address_requested → true (optional)
│ │ │ ├── test → true (optional)
│ │ │ ├── title → string
│ │ │ ├── description → string
│ │ │ ├── photo → WebDocument (optional)
│ │ │ │ ├── WebDocument
│ │ │ │ └── WebDocumentNoProxy
│ │ │ ├── receipt_msg_id → int (optional)
│ │ │ ├── currency → string
│ │ │ ├── total_amount → long
│ │ │ ├── start_param → string
│ │ │ └── extended_media → MessageExtendedMedia (optional)
│ │ │ ├── MessageExtendedMediaPreview
│ │ │ └── MessageExtendedMedia
│ │ ├── MessageMediaGeoLive
│ │ │ ├── geo → GeoPoint
│ │ │ │ ├── GeoPointEmpty
│ │ │ │ └── GeoPoint
│ │ │ ├── heading → int (optional)
│ │ │ ├── period → int
│ │ │ └── proximity_notification_radius → int (optional)
│ │ ├── MessageMediaPoll
│ │ │ ├── poll → Poll
│ │ │ │ └── Poll
│ │ │ ├── results → PollResults
│ │ │ │ └── PollResults
│ │ │ └── attached_media → MessageMedia (optional)
│ │ │ ├── MessageMediaEmpty
│ │ │ ├── MessageMediaPhoto
│ │ │ ├── MessageMediaGeo
│ │ │ ├── MessageMediaContact
│ │ │ ├── MessageMediaUnsupported
│ │ │ ├── MessageMediaDocument
│ │ │ ├── MessageMediaWebPage
│ │ │ ├── MessageMediaVenue
│ │ │ ├── MessageMediaGame
│ │ │ ├── MessageMediaInvoice
│ │ │ ├── MessageMediaGeoLive
│ │ │ ├── MessageMediaPoll
│ │ │ ├── MessageMediaDice
│ │ │ ├── MessageMediaStory
│ │ │ ├── MessageMediaGiveaway
│ │ │ ├── MessageMediaGiveawayResults
│ │ │ ├── MessageMediaPaidMedia
│ │ │ ├── MessageMediaToDo
│ │ │ └── MessageMediaVideoStream
│ │ ├── MessageMediaDice
│ │ │ ├── value → int
│ │ │ ├── emoticon → string
│ │ │ └── game_outcome → messages.EmojiGameOutcome (optional)
│ │ │ └── messages.EmojiGameOutcome
│ │ ├── MessageMediaStory
│ │ │ ├── via_mention → true (optional)
│ │ │ ├── peer → Peer
│ │ │ │ ├── PeerUser
│ │ │ │ ├── PeerChat
│ │ │ │ └── PeerChannel
│ │ │ ├── id → int
│ │ │ └── story → StoryItem (optional)
│ │ │ ├── StoryItemDeleted
│ │ │ ├── StoryItemSkipped
│ │ │ └── StoryItem
│ │ ├── MessageMediaGiveaway
│ │ │ ├── only_new_subscribers → true (optional)
│ │ │ ├── winners_are_visible → true (optional)
│ │ │ ├── channels → Vector < long >
│ │ │ ├── countries_iso2 → Vector < string > (optional)
│ │ │ ├── prize_description → string (optional)
│ │ │ ├── quantity → int
│ │ │ ├── months → int (optional)
│ │ │ ├── stars → long (optional)
│ │ │ └── until_date → int
│ │ ├── MessageMediaGiveawayResults
│ │ │ ├── only_new_subscribers → true (optional)
│ │ │ ├── refunded → true (optional)
│ │ │ ├── channel_id → long
│ │ │ ├── additional_peers_count → int (optional)
│ │ │ ├── launch_msg_id → int
│ │ │ ├── winners_count → int
│ │ │ ├── unclaimed_count → int
│ │ │ ├── winners → Vector < long >
│ │ │ ├── months → int (optional)
│ │ │ ├── stars → long (optional)
│ │ │ ├── prize_description → string (optional)
│ │ │ └── until_date → int
│ │ ├── MessageMediaPaidMedia
│ │ │ ├── stars_amount → long
│ │ │ └── extended_media → Vector < MessageExtendedMedia >
│ │ │ ├── MessageExtendedMediaPreview
│ │ │ └── MessageExtendedMedia
│ │ ├── MessageMediaToDo
│ │ │ ├── todo → TodoList
│ │ │ │ └── TodoList
│ │ │ └── completions → Vector < TodoCompletion > (optional)
│ │ │ └── TodoCompletion
│ │ └── MessageMediaVideoStream
│ │ ├── rtmp_stream → true (optional)
│ │ └── call → InputGroupCall
│ │ ├── InputGroupCall
│ │ ├── InputGroupCallSlug
│ │ └── InputGroupCallInviteMessage
│ ├── MessageMediaDice
│ │ ├── value → int
│ │ ├── emoticon → string
│ │ └── game_outcome → messages.EmojiGameOutcome (optional)
│ │ └── messages.EmojiGameOutcome
│ │ ├── seed → bytes
│ │ ├── stake_ton_amount → long
│ │ └── ton_amount → long
│ ├── MessageMediaStory
│ │ ├── via_mention → true (optional)
│ │ ├── peer → Peer
│ │ │ ├── PeerUser
│ │ │ │ └── user_id → long
│ │ │ ├── PeerChat
│ │ │ │ └── chat_id → long
│ │ │ └── PeerChannel
│ │ │ └── channel_id → long
│ │ ├── id → int
│ │ └── story → StoryItem (optional)
│ │ ├── StoryItemDeleted
│ │ │ └── id → int
│ │ ├── StoryItemSkipped
│ │ │ ├── close_friends → true (optional)
│ │ │ ├── live → true (optional)
│ │ │ ├── id → int
│ │ │ ├── date → int
│ │ │ └── expire_date → int
│ │ └── StoryItem
│ │ ├── pinned → true (optional)
│ │ ├── public → true (optional)
│ │ ├── close_friends → true (optional)
│ │ ├── min → true (optional)
│ │ ├── noforwards → true (optional)
│ │ ├── edited → true (optional)
│ │ ├── contacts → true (optional)
│ │ ├── selected_contacts → true (optional)
│ │ ├── out → true (optional)
│ │ ├── id → int
│ │ ├── date → int
│ │ ├── from_id → Peer (optional)
│ │ │ ├── PeerUser
│ │ │ ├── PeerChat
│ │ │ └── PeerChannel
│ │ ├── fwd_from → StoryFwdHeader (optional)
│ │ │ └── StoryFwdHeader
│ │ ├── expire_date → int
│ │ ├── caption → string (optional)
│ │ ├── entities → Vector < MessageEntity > (optional)
│ │ │ ├── MessageEntityUnknown
│ │ │ ├── MessageEntityMention
│ │ │ ├── MessageEntityHashtag
│ │ │ ├── MessageEntityBotCommand
│ │ │ ├── MessageEntityUrl
│ │ │ ├── MessageEntityEmail
│ │ │ ├── MessageEntityBold
│ │ │ ├── MessageEntityItalic
│ │ │ ├── MessageEntityCode
│ │ │ ├── MessageEntityPre
│ │ │ ├── MessageEntityTextUrl
│ │ │ ├── MessageEntityMentionName
│ │ │ ├── InputMessageEntityMentionName
│ │ │ ├── MessageEntityPhone
│ │ │ ├── MessageEntityCashtag
│ │ │ ├── MessageEntityUnderline
│ │ │ ├── MessageEntityStrike
│ │ │ ├── MessageEntityBankCard
│ │ │ ├── MessageEntitySpoiler
│ │ │ ├── MessageEntityCustomEmoji
│ │ │ ├── MessageEntityBlockquote
│ │ │ ├── MessageEntityFormattedDate
│ │ │ ├── MessageEntityDiffInsert
│ │ │ ├── MessageEntityDiffReplace
│ │ │ └── MessageEntityDiffDelete
│ │ ├── media → MessageMedia
│ │ │ ├── MessageMediaEmpty
│ │ │ ├── MessageMediaPhoto
│ │ │ ├── MessageMediaGeo
│ │ │ ├── MessageMediaContact
│ │ │ ├── MessageMediaUnsupported
│ │ │ ├── MessageMediaDocument
│ │ │ ├── MessageMediaWebPage
│ │ │ ├── MessageMediaVenue
│ │ │ ├── MessageMediaGame
│ │ │ ├── MessageMediaInvoice
│ │ │ ├── MessageMediaGeoLive
│ │ │ ├── MessageMediaPoll
│ │ │ ├── MessageMediaDice
│ │ │ ├── MessageMediaStory
│ │ │ ├── MessageMediaGiveaway
│ │ │ ├── MessageMediaGiveawayResults
│ │ │ ├── MessageMediaPaidMedia
│ │ │ ├── MessageMediaToDo
│ │ │ └── MessageMediaVideoStream
│ │ ├── media_areas → Vector < MediaArea > (optional)
│ │ │ ├── MediaAreaVenue
│ │ │ ├── InputMediaAreaVenue
│ │ │ ├── MediaAreaGeoPoint
│ │ │ ├── MediaAreaSuggestedReaction
│ │ │ ├── MediaAreaChannelPost
│ │ │ ├── InputMediaAreaChannelPost
│ │ │ ├── MediaAreaUrl
│ │ │ ├── MediaAreaWeather
│ │ │ └── MediaAreaStarGift
│ │ ├── privacy → Vector < PrivacyRule > (optional)
│ │ │ ├── PrivacyValueAllowContacts
│ │ │ ├── PrivacyValueAllowAll
│ │ │ ├── PrivacyValueAllowUsers
│ │ │ ├── PrivacyValueDisallowContacts
│ │ │ ├── PrivacyValueDisallowAll
│ │ │ ├── PrivacyValueDisallowUsers
│ │ │ ├── PrivacyValueAllowChatParticipants
│ │ │ ├── PrivacyValueAllowCloseFriends
│ │ │ ├── PrivacyValueAllowPremium
│ │ │ ├── PrivacyValueAllowBots
│ │ │ └── PrivacyValueDisallowBots
│ │ ├── views → StoryViews (optional)
│ │ │ └── StoryViews
│ │ ├── sent_reaction → Reaction (optional)
│ │ │ ├── ReactionEmpty
│ │ │ ├── ReactionEmoji
│ │ │ ├── ReactionCustomEmoji
│ │ │ └── ReactionPaid
│ │ ├── albums → Vector < int > (optional)
│ │ └── music → Document (optional)
│ │ ├── DocumentEmpty
│ │ └── Document
│ ├── MessageMediaGiveaway
│ │ ├── only_new_subscribers → true (optional)
│ │ ├── winners_are_visible → true (optional)
│ │ ├── channels → Vector < long >
│ │ ├── countries_iso2 → Vector < string > (optional)
│ │ ├── prize_description → string (optional)
│ │ ├── quantity → int
│ │ ├── months → int (optional)
│ │ ├── stars → long (optional)
│ │ └── until_date → int
│ │ ├── only_new_subscribers → true (optional)
│ │ ├── refunded → true (optional)
│ │ ├── channel_id → long
│ │ ├── additional_peers_count → int (optional)
│ │ ├── launch_msg_id → int
│ │ ├── winners_count → int
│ │ ├── unclaimed_count → int
│ │ ├── winners → Vector < long >
│ │ ├── months → int (optional)
│ │ ├── stars → long (optional)
│ │ ├── prize_description → string (optional)
│ │ └── until_date → int
│ ├── MessageMediaPaidMedia
│ │ ├── stars_amount → long
│ │ └── extended_media → Vector < MessageExtendedMedia >
│ │ ├── MessageExtendedMediaPreview
│ │ │ ├── w → int (optional)
│ │ │ ├── h → int (optional)
│ │ │ ├── thumb → PhotoSize (optional)
│ │ │ │ ├── PhotoSizeEmpty
│ │ │ │ ├── PhotoSize
│ │ │ │ ├── PhotoCachedSize
│ │ │ │ ├── PhotoStrippedSize
│ │ │ │ ├── PhotoSizeProgressive
│ │ │ │ └── PhotoPathSize
│ │ │ └── video_duration → int (optional)
│ │ └── MessageExtendedMedia
│ │ └── media → MessageMedia
│ │ ├── MessageMediaEmpty
│ │ ├── MessageMediaPhoto
│ │ ├── MessageMediaGeo
│ │ ├── MessageMediaContact
│ │ ├── MessageMediaUnsupported
│ │ ├── MessageMediaDocument
│ │ ├── MessageMediaWebPage
│ │ ├── MessageMediaVenue
│ │ ├── MessageMediaGame
│ │ ├── MessageMediaInvoice
│ │ ├── MessageMediaGeoLive
│ │ ├── MessageMediaPoll
│ │ ├── MessageMediaDice
│ │ ├── MessageMediaStory
│ │ ├── MessageMediaGiveaway
│ │ ├── MessageMediaGiveawayResults
│ │ ├── MessageMediaPaidMedia
│ │ ├── MessageMediaToDo
│ │ └── MessageMediaVideoStream
│ ├── MessageMediaToDo
│ │ ├── todo → TodoList
│ │ │ └── TodoList
│ │ │ ├── others_can_append → true (optional)
│ │ │ ├── others_can_complete → true (optional)
│ │ │ ├── title → TextWithEntities
│ │ │ │ └── TextWithEntities
│ │ │ └── list → Vector < TodoItem >
│ │ │ └── TodoItem
│ │ └── completions → Vector < TodoCompletion > (optional)
│ │ └── TodoCompletion
│ │ ├── id → int
│ │ ├── completed_by → Peer
│ │ │ ├── PeerUser
│ │ │ ├── PeerChat
│ │ │ └── PeerChannel
│ │ └── date → int
│ ├── rtmp_stream → true (optional)
│ └── call → InputGroupCall
│ ├── InputGroupCall
│ │ ├── id → long
│ │ └── access_hash → long
│ ├── InputGroupCallSlug
│ │ └── slug → string
│ └── msg_id → int
├── color → PeerColor (optional)
│ ├── PeerColor
│ │ ├── color → int (optional)
│ │ └── background_emoji_id → long (optional)
│ ├── PeerColorCollectible
│ │ ├── collectible_id → long
│ │ ├── gift_emoji_id → long
│ │ ├── background_emoji_id → long
│ │ ├── accent_color → int
│ │ ├── colors → Vector < int >
│ │ ├── dark_accent_color → int (optional)
│ │ └── dark_colors → Vector < int > (optional)
│ └── collectible_id → long
├── button_text → string
├── sponsor_info → string (optional)
├── additional_info → string (optional)
├── min_display_duration → int (optional)
└── max_display_duration → int (optional)

Example

SponsoredMessage(
    random_id=b"data",
    url="https://google.com",
    title="text",
    message="Hello",
    button_text="text",
)