Related TL schema:
sponsoredMessage flags:# random_id:bytes from_id:Peer channel_post:flags.2?int start_param:flags.0?string message:string entities:flags.1?Vector<MessageEntity> = SponsoredMessage; messages.sponsoredMessages messages:Vector<SponsoredMessage> chats:Vector<Chat> users:Vector<User> = messages.SponsoredMessages; ---functions--- channels.getSponsoredMessages channel:InputChannel = messages.SponsoredMessages; channels.viewSponsoredMessage channel:InputChannel random_id:bytes = Bool;
Each time the user opens a channel,
channels.getSponsoredMessages should be called to receive sponsored messages available for this channel. The result should be cached for 5 minutes.
Sponsored messages should be displayed below all other posts in the channel, after the user scrolls futher down, past the last message. The promoted channel or bot specified in the
from_id field must be displayed as the author of the message. The message should also contain one of the following buttons at the bottom:
start_paramis specified, the app should use the deep linking mechanism to open the bot.
channel_postis specified. Tapping the button should open the particular channel post.
Once the entire text is shown on the screen (excluding the button),
channels.viewSponsoredMessage should be called with the
random_id of this sponsored message.
For the channel https://t.me/SecretAdTestChannel the system will always return a sponsored message: promoting either a channel, a particular message in a channel, or a bot with a start parameter.
Telegram continues to grow worldwide, in part thanks to third-party apps using the Telegram API. To cover the increasing costs that come with this growth, Telegram added sponsored messages – a paid privacy-friendly way to promote bots and channels.
If their app allows its users to access content from Telegram channels, third-party developers using the Telegam API are required to support and properly display official sponsored messages in their apps by January 1, 2022. Unfortunately, Telegram cannot financially sustain third-party apps that do not display sponsored messages and they will have to be disconnected.
Telegram's API usage will continue to be free of charge for all developers. The rules regarding monetization in third-party apps remain the same: developers are allowed to monetize their coding efforts through advertising of their own or other legitimate means, provided that all the methods of monetization used in their apps are prominently mentioned in their app store descriptions.