Layer 220
SponsoredMessage
A sponsored message.
constructor
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;
Parameters
| Name | Type | Description |
|---|---|---|
| Flags | # | Flags, see TL conditional fields |
| Recommended | flags.5?true | Whether the message needs to be labeled as "recommended" instead of "sponsored" |
| CanReport | flags.12?true | Whether this message can be reported as specified here. |
| RandomId | bytes | Message ID |
| Url | string | Contains the URL to open when the user clicks on the sponsored message. |
| Title | string | Contains the title of the sponsored message. |
| Message | string | Sponsored message |
| Entities | Vector<MessageEntity> | Message entities for styled text in message. |
| Photo | flags.6?Photo | If set, contains a custom profile photo bubble that should be displayed for the sponsored message, like for messages sent in groups. |
| Media | flags.14?MessageMedia | If set, contains some media. |
| Color | flags.13?PeerColor | If set, the sponsored message should use the message accent color specified in color. |
| ButtonText | string | Label of the sponsored message button. |
| SponsorInfo | flags.7?string | If set, contains additional information about the sponsor to be shown along with the message. |
| AdditionalInfo | flags.8?string | If set, contains additional information about the sponsored message to be shown along with the message. |
| MinDisplayDuration | flags.15?int | For sponsored messages to show on channel videos, allow the user to hide the ad only after the specified amount of seconds. |
| MaxDisplayDuration | flags.15?int | For sponsored messages to show on channel videos, autohide the ad after after the specified amount of seconds. |
Returns
SponsoredMessageGogram Example
// Creating SponsoredMessage constructor obj := &tg.SponsoredMessage{ RandomId: []byte{}, Url: "...", Title: "...", Message: "...", ButtonText: "...", // Optional fields: // Recommended: true, // CanReport: true, // Entities: []tg.MessageEntity{&tg.MessageEntityBold{Offset: 0, Length: 4}}, // Photo: &tg.Photo{}, // ... more optional fields }