telegram-crawler/data/web/blogfork.telegram.org/api/stickers.html
2024-02-15 03:52:06 +00:00

501 lines
65 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html class="">
<head>
<meta charset="utf-8">
<title>Stickers</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="Telegram clients support displaying static and animated stickers.">
<meta property="og:title" content="Stickers">
<meta property="og:image" content="">
<meta property="og:description" content="Telegram clients support displaying static and animated stickers.">
<link rel="icon" type="image/svg+xml" href="/img/website_icon.svg?4">
<link rel="apple-touch-icon" sizes="180x180" href="/img/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/img/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/img/favicon-16x16.png">
<link rel="alternate icon" href="/img/favicon.ico" type="image/x-icon" />
<link href="/css/bootstrap.min.css?3" rel="stylesheet">
<link href="/css/telegram.css?236" rel="stylesheet" media="screen">
<style>
</style>
</head>
<body class="preload">
<div class="dev_page_wrap">
<div class="dev_page_head navbar navbar-static-top navbar-tg">
<div class="navbar-inner">
<div class="container clearfix">
<ul class="nav navbar-nav navbar-right hidden-xs"><li class="navbar-twitter"><a href="https://twitter.com/telegram" target="_blank" data-track="Follow/Twitter" onclick="trackDlClick(this, event)"><i class="icon icon-twitter"></i><span> Twitter</span></a></li></ul>
<ul class="nav navbar-nav">
<li><a href="//telegram.org/">Home</a></li>
<li class="hidden-xs"><a href="//telegram.org/faq">FAQ</a></li>
<li class="hidden-xs"><a href="//telegram.org/apps">Apps</a></li>
<li class="active"><a href="/api">API</a></li>
<li class=""><a href="/mtproto">Protocol</a></li>
<li class=""><a href="/schema">Schema</a></li>
</ul>
</div>
</div>
</div>
<div class="container clearfix">
<div class="dev_page">
<div id="dev_page_content_wrap" class=" ">
<div class="dev_page_bread_crumbs"><ul class="breadcrumb clearfix"><li><a href="/api" >API</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/api/stickers" >Stickers</a></li></ul></div>
<h1 id="dev_page_title">Stickers</h1>
<div id="dev_page_content"><!-- scroll_nav -->
<p>Telegram clients support displaying static and animated stickers.</p>
<h3><a class="anchor" href="#displaying-stickers" id="displaying-stickers" name="displaying-stickers"><i class="anchor-icon"></i></a>Displaying stickers</h3>
<pre><code><a href='/constructor/document'>document</a>#8fd4c4d8 flags:<a href='/type/%23'>#</a> id:<a href='/type/long'>long</a> access_hash:<a href='/type/long'>long</a> file_reference:<a href='/type/bytes'>bytes</a> date:<a href='/type/int'>int</a> mime_type:<a href='/type/string'>string</a> size:<a href='/type/long'>long</a> thumbs:flags.0?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/PhotoSize'>PhotoSize</a>&gt; video_thumbs:flags.1?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/VideoSize'>VideoSize</a>&gt; dc_id:<a href='/type/int'>int</a> attributes:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/DocumentAttribute'>DocumentAttribute</a>&gt; = <a href='/type/Document'>Document</a>;
<a href='/constructor/documentAttributeSticker'>documentAttributeSticker</a>#6319d612 flags:<a href='/type/%23'>#</a> mask:flags.1?<a href='/constructor/true'>true</a> alt:<a href='/type/string'>string</a> stickerset:<a href='/type/InputStickerSet'>InputStickerSet</a> mask_coords:flags.0?<a href='/type/MaskCoords'>MaskCoords</a> = <a href='/type/DocumentAttribute'>DocumentAttribute</a>;
<a href='/constructor/inputStickerSetEmpty'>inputStickerSetEmpty</a>#ffb62b95 = <a href='/type/InputStickerSet'>InputStickerSet</a>;
<a href='/constructor/inputStickerSetID'>inputStickerSetID</a>#9de7a269 id:<a href='/type/long'>long</a> access_hash:<a href='/type/long'>long</a> = <a href='/type/InputStickerSet'>InputStickerSet</a>;
<a href='/constructor/inputStickerSetShortName'>inputStickerSetShortName</a>#861cc8a0 short_name:<a href='/type/string'>string</a> = <a href='/type/InputStickerSet'>InputStickerSet</a>;
<a href='/constructor/inputStickerSetAnimatedEmoji'>inputStickerSetAnimatedEmoji</a>#28703c8 = <a href='/type/InputStickerSet'>InputStickerSet</a>;
<a href='/constructor/inputStickerSetDice'>inputStickerSetDice</a>#e67f520e emoticon:<a href='/type/string'>string</a> = <a href='/type/InputStickerSet'>InputStickerSet</a>;
<a href='/constructor/inputStickerSetAnimatedEmojiAnimations'>inputStickerSetAnimatedEmojiAnimations</a>#cde3739 = <a href='/type/InputStickerSet'>InputStickerSet</a>;
<a href='/constructor/inputStickerSetPremiumGifts'>inputStickerSetPremiumGifts</a>#c88b3b02 = <a href='/type/InputStickerSet'>InputStickerSet</a>;
<a href='/constructor/inputStickerSetEmojiGenericAnimations'>inputStickerSetEmojiGenericAnimations</a>#04c4d4ce = <a href='/type/InputStickerSet'>InputStickerSet</a>;
<a href='/constructor/inputStickerSetEmojiDefaultStatuses'>inputStickerSetEmojiDefaultStatuses</a>#29d0f5ee = <a href='/type/InputStickerSet'>InputStickerSet</a>;</code></pre>
<p>Stickers can be contained in <a href="/constructor/document">document</a> constructors attached to <a href="/constructor/message">messages</a>, and always have an attribute of type <a href="/constructor/documentAttributeSticker">documentAttributeSticker</a>. </p>
<p>The <a href="/constructor/documentAttributeSticker">documentAttributeSticker</a> attribute contains information about the associated <a href="#stickersets">stickerset</a>, the emoji that represents the sticker, and more. </p>
<p>There are multiple available sticker types:</p>
<ul>
<li><a href="#static-stickers">Static stickers »</a></li>
<li><a href="#animated-stickers">Animated stickers »</a></li>
<li><a href="#video-stickers">Video stickers »</a></li>
</ul>
<p>Like all files, stickers have a set of previews that should be handled as described <a href="/api/files#image-thumbnail-types">here »</a>.</p>
<p>Stickers are organized in <a href="#stickersets">stickersets »</a>, and are also used in the following contexts:</p>
<ul>
<li><a href="/api/dice">Dice »</a></li>
<li><a href="/api/animated-emojis">Animated emojis »</a></li>
<li><a href="/api/custom-emoji">Custom emojis »</a></li>
<li><a href="/api/reactions">Reactions »</a></li>
<li><a href="#mask-stickers">Mask stickers »</a></li>
</ul>
<h4><a class="anchor" href="#static-stickers" id="static-stickers" name="static-stickers"><i class="anchor-icon"></i></a>Static stickers</h4>
<p>Static stickers are <a href="https://en.wikipedia.org/wiki/WebP">WebP</a> images with the following specs:</p>
<ul>
<li>For stickers, either width or height must be equal to 512 pixels.</li>
<li>For <a href="/api/custom-emoji">custom emojis</a>, the resolution must be equal to 100x100 pixels.</li>
<li>Transparency is supported.</li>
</ul>
<p>They're identified by <code>mime_type</code> field of the associated <a href="/constructor/document">document</a>, always equal to <code>image/webp</code>.</p>
<p>See <a href="/stickers#static-stickers-and-emoji">here »</a> for tips on how to create the perfect static sticker, and <a href="#creating-stickersets">here »</a> for info on how to upload it using the API.</p>
<h4><a class="anchor" href="#animated-stickers" id="animated-stickers" name="animated-stickers"><i class="anchor-icon"></i></a>Animated stickers</h4>
<p>Animated stickers are <a href="https://en.wikipedia.org/wiki/Lottie_(file_format)">Lottie vector animations »</a>. </p>
<p>Telegram uses a special <code>.tgs</code> file format for lottie animations, which consists in a gzipped bodymovin JSON file, playable using the <a href="https://github.com/Samsung/rlottie">rlottie</a> library. </p>
<p>Lottie animation specs:</p>
<ul>
<li>The canvas size must be 512х512 pixels.</li>
<li>Objects must not leave the canvas.</li>
<li>Animation length must not exceed 3 seconds.</li>
<li>All animations must be looped.</li>
<li>All animations must run at 60 Frames Per Second.</li>
</ul>
<p>They're identified by <code>mime_type</code> field of the associated <a href="/constructor/document">document</a>, always equal to <code>application/x-tgsticker</code>.</p>
<p>See <a href="/stickers#creating-animations">here »</a> for tips on how to create the perfect animated sticker, and <a href="#creating-stickersets">here »</a> for info on how to upload it using the API.</p>
<h4><a class="anchor" href="#video-stickers" id="video-stickers" name="video-stickers"><i class="anchor-icon"></i></a>Video stickers</h4>
<p>Video stickers are <a href="https://en.wikipedia.org/wiki/VP9">VP9</a> videos with the following specs:</p>
<ul>
<li>The video must be encoded using <a href="https://en.wikipedia.org/wiki/VP9">VP9</a>, in a <a href="https://en.wikipedia.org/wiki/WebM">WebM</a> container.</li>
<li>The <a href="https://en.wikipedia.org/wiki/WebM">WebM</a> container must have <strong>no audio stream</strong>.</li>
<li>For stickers, either width or height must be equal to 512 pixels.</li>
<li>For <a href="/api/custom-emoji">custom emojis</a>, the resolution must be equal to 100x100 pixels.</li>
<li>Maximum duration: 3 seconds.</li>
<li>Frame rate: up to 30 FPS.</li>
<li>Transparency is supported.</li>
<li>The video should be looped for optimal user experience.</li>
</ul>
<p>They're identified by <code>mime_type</code> field of the associated <a href="/constructor/document">document</a>, always equal to <code>video/webm</code>.</p>
<p>See <a href="/stickers#video-stickers-and-emoji">here »</a> for tips on how to create the perfect video sticker, and <a href="#creating-stickersets">here »</a> for info on how to upload it using the API.</p>
<h3><a class="anchor" href="#stickersets" id="stickersets" name="stickersets"><i class="anchor-icon"></i></a>Stickersets</h3>
<pre><code><a href='/constructor/inputStickerSetID'>inputStickerSetID</a>#9de7a269 id:<a href='/type/long'>long</a> access_hash:<a href='/type/long'>long</a> = <a href='/type/InputStickerSet'>InputStickerSet</a>;
<a href='/constructor/inputStickerSetShortName'>inputStickerSetShortName</a>#861cc8a0 short_name:<a href='/type/string'>string</a> = <a href='/type/InputStickerSet'>InputStickerSet</a>;
<a href='/constructor/inputStickerSetAnimatedEmoji'>inputStickerSetAnimatedEmoji</a>#28703c8 = <a href='/type/InputStickerSet'>InputStickerSet</a>;
<a href='/constructor/inputStickerSetAnimatedEmojiAnimations'>inputStickerSetAnimatedEmojiAnimations</a>#cde3739 = <a href='/type/InputStickerSet'>InputStickerSet</a>;
<a href='/constructor/inputStickerSetDice'>inputStickerSetDice</a>#e67f520e emoticon:<a href='/type/string'>string</a> = <a href='/type/InputStickerSet'>InputStickerSet</a>;
<a href='/constructor/inputStickerSetPremiumGifts'>inputStickerSetPremiumGifts</a>#c88b3b02 = <a href='/type/InputStickerSet'>InputStickerSet</a>;
<a href='/constructor/inputStickerSetEmojiGenericAnimations'>inputStickerSetEmojiGenericAnimations</a>#04c4d4ce = <a href='/type/InputStickerSet'>InputStickerSet</a>;
<a href='/constructor/inputStickerSetEmojiDefaultStatuses'>inputStickerSetEmojiDefaultStatuses</a>#29d0f5ee = <a href='/type/InputStickerSet'>InputStickerSet</a>;
<a href='/constructor/messages.stickerSet'>messages.stickerSet</a>#6e153f16 set:<a href='/type/StickerSet'>StickerSet</a> packs:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/StickerPack'>StickerPack</a>&gt; keywords:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/StickerKeyword'>StickerKeyword</a>&gt; documents:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/Document'>Document</a>&gt; = <a href='/type/messages.StickerSet'>messages.StickerSet</a>;
<a href='/constructor/messages.stickerSetNotModified'>messages.stickerSetNotModified</a>#d3f924eb = <a href='/type/messages.StickerSet'>messages.StickerSet</a>;
<a href='/constructor/stickerSet'>stickerSet</a>#2dd14edc flags:<a href='/type/%23'>#</a> archived:flags.1?<a href='/constructor/true'>true</a> official:flags.2?<a href='/constructor/true'>true</a> masks:flags.3?<a href='/constructor/true'>true</a> animated:flags.5?<a href='/constructor/true'>true</a> videos:flags.6?<a href='/constructor/true'>true</a> emojis:flags.7?<a href='/constructor/true'>true</a> text_color:flags.9?<a href='/constructor/true'>true</a> channel_emoji_status:flags.10?<a href='/constructor/true'>true</a> installed_date:flags.0?<a href='/type/int'>int</a> id:<a href='/type/long'>long</a> access_hash:<a href='/type/long'>long</a> title:<a href='/type/string'>string</a> short_name:<a href='/type/string'>string</a> thumbs:flags.4?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/PhotoSize'>PhotoSize</a>&gt; thumb_dc_id:flags.4?<a href='/type/int'>int</a> thumb_version:flags.4?<a href='/type/int'>int</a> thumb_document_id:flags.8?<a href='/type/long'>long</a> count:<a href='/type/int'>int</a> hash:<a href='/type/int'>int</a> = <a href='/type/StickerSet'>StickerSet</a>;
<a href='/constructor/stickerPack'>stickerPack</a>#12b299d4 emoticon:<a href='/type/string'>string</a> documents:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/long'>long</a>&gt; = <a href='/type/StickerPack'>StickerPack</a>;
---functions---
<a href='/method/messages.getStickerSet'>messages.getStickerSet</a>#c8a0ec74 stickerset:<a href='/type/InputStickerSet'>InputStickerSet</a> hash:<a href='/type/int'>int</a> = <a href='/type/messages.StickerSet'>messages.StickerSet</a>;</code></pre>
<p>Stickers are grouped together in so-called sticker packs: however, in the API they're referred to as "sticker sets", and the name "sticker pack" is reserved for something else, read on for more info. </p>
<p>Use <a href="/method/messages.getStickerSet">messages.getStickerSet</a> to fetch information about the stickerset, providing the following parameters:</p>
<ul>
<li><code>stickerset</code> - One of the following constructors:<ul>
<li><a href="/constructor/inputStickerSetID">inputStickerSetID</a> - For stickersets contained in received messages</li>
<li><a href="/constructor/inputStickerSetShortName">inputStickerSetShortName</a> - For stickersets contained in <a href="/api/links#stickerset-links">sticker deep links »</a></li>
<li><a href="/constructor/inputStickerSetAnimatedEmoji">inputStickerSetAnimatedEmoji</a> - For <a href="/api/animated-emojis">animated emoji »</a> stickers.</li>
<li><a href="/constructor/inputStickerSetAnimatedEmojiAnimations">inputStickerSetAnimatedEmojiAnimations</a> - For <a href="/api/animated-emojis#emoji-reactions">animated emoji reaction »</a> stickers.</li>
<li><a href="/constructor/inputStickerSetDice">inputStickerSetDice</a> - For <a href="/api/dice">dice »</a> stickersets.</li>
<li><a href="/constructor/inputStickerSetPremiumGifts">inputStickerSetPremiumGifts</a> - For <a href="/api/premium">premium gift animation »</a> stickers.</li>
<li><a href="/constructor/inputStickerSetEmojiGenericAnimations">inputStickerSetEmojiGenericAnimations</a> - For <a href="/api/reactions#animated-normal-emojis">generic emoji reaction animations</a>.</li>
<li><a href="/constructor/inputStickerSetEmojiDefaultStatuses">inputStickerSetEmojiDefaultStatuses</a> - Standard <a href="/api/emoji-status">emoji status</a> stickerset.</li>
</ul>
</li>
<li><code>hash</code> - Initially 0, afterwards should contain the <code>hash</code> field from the returned <a href="/constructor/stickerSet">stickerSet</a>.</li>
</ul>
<p>The method will return a <a href="/constructor/messages.stickerSetNotModified">messages.stickerSetNotModified</a> if a non-zero <code>hash</code> is provided and the stickerset wasn't modified since the last time we fetched it.<br>
Otherwise, a <a href="/constructor/messages.stickerSet">messages.stickerSet</a> will be returned, containing:</p>
<ul>
<li>A <a href="/constructor/stickerSet">stickerSet</a> constructor with info about the stickerset</li>
<li>A vector of <a href="/constructor/document">document</a> constructors, containing all the stickers.<br>
Note that even if we provided an old <code>hash</code> and just a few stickers were modified/reordered, all stickers will be returned anyway. </li>
<li>A vector of <a href="/constructor/stickerPack">stickerPack</a> constructors, containing all the stickers IDs in the stickerpack, grouped by emoji.<br>
The main emoji to use when previewing stickers in the chat list is present in the <code>alt</code> field of the <a href="/constructor/document">document</a>.<br>
This field is actually used to allow associating more than one emoji to a sticker: this means that the same document ID may be present in multiple <a href="/constructor/stickerPack">stickerPacks</a>.</li>
</ul>
<h3><a class="anchor" href="#stickerset-previews" id="stickerset-previews" name="stickerset-previews"><i class="anchor-icon"></i></a>Stickerset previews</h3>
<pre><code><a href='/constructor/stickerSetCovered'>stickerSetCovered</a>#6410a5d2 set:<a href='/type/StickerSet'>StickerSet</a> cover:<a href='/type/Document'>Document</a> = <a href='/type/StickerSetCovered'>StickerSetCovered</a>;
<a href='/constructor/stickerSetMultiCovered'>stickerSetMultiCovered</a>#3407e51b set:<a href='/type/StickerSet'>StickerSet</a> covers:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/Document'>Document</a>&gt; = <a href='/type/StickerSetCovered'>StickerSetCovered</a>;
<a href='/constructor/stickerSetFullCovered'>stickerSetFullCovered</a>#40d13c0e set:<a href='/type/StickerSet'>StickerSet</a> packs:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/StickerPack'>StickerPack</a>&gt; keywords:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/StickerKeyword'>StickerKeyword</a>&gt; documents:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/Document'>Document</a>&gt; = <a href='/type/StickerSetCovered'>StickerSetCovered</a>;</code></pre>
<p>Certain parts of the API may return partial <a href="/type/StickerSetCovered">StickerSetCovered</a> constructors instead of full <a href="/constructor/document">document</a> constructors for every sticker in the set:</p>
<ul>
<li><a href="/constructor/stickerSetCovered">stickerSetCovered</a> - Contains generic info about a stickerset and one preview sticker: use <a href="/method/messages.getStickerSet">messages.getStickerSet</a> to fetch all the stickers in the stickerset.</li>
<li><a href="/constructor/stickerSetMultiCovered">stickerSetMultiCovered</a> - Contains generic info about a stickerset and multiple preview stickers: use <a href="/method/messages.getStickerSet">messages.getStickerSet</a> to fetch all the stickers in the stickerset.</li>
<li><a href="/constructor/stickerSetFullCovered">stickerSetFullCovered</a> - Contains generic info about a stickerset and all stickers in the set (not just a preview): currently only used for <a href="/api/custom-emoji">custom emoji stickersets</a>, to avoid a further call to <a href="/method/messages.getStickerSet">messages.getStickerSet</a>.</li>
</ul>
<p>Also, like all files, sticker <a href="/constructor/document">documents</a> have a set of previews that should be handled as described <a href="/api/files#image-thumbnail-types">here »</a>.</p>
<h3><a class="anchor" href="#installing-stickersets" id="installing-stickersets" name="installing-stickersets"><i class="anchor-icon"></i></a>Installing stickersets</h3>
<pre><code><a href='/constructor/inputStickerSetID'>inputStickerSetID</a>#9de7a269 id:<a href='/type/long'>long</a> access_hash:<a href='/type/long'>long</a> = <a href='/type/InputStickerSet'>InputStickerSet</a>;
<a href='/constructor/inputStickerSetShortName'>inputStickerSetShortName</a>#861cc8a0 short_name:<a href='/type/string'>string</a> = <a href='/type/InputStickerSet'>InputStickerSet</a>;
<a href='/constructor/inputStickerSetAnimatedEmoji'>inputStickerSetAnimatedEmoji</a>#28703c8 = <a href='/type/InputStickerSet'>InputStickerSet</a>;
<a href='/constructor/inputStickerSetAnimatedEmojiAnimations'>inputStickerSetAnimatedEmojiAnimations</a>#cde3739 = <a href='/type/InputStickerSet'>InputStickerSet</a>;
<a href='/constructor/inputStickerSetDice'>inputStickerSetDice</a>#e67f520e emoticon:<a href='/type/string'>string</a> = <a href='/type/InputStickerSet'>InputStickerSet</a>;
<a href='/constructor/inputStickerSetPremiumGifts'>inputStickerSetPremiumGifts</a>#c88b3b02 = <a href='/type/InputStickerSet'>InputStickerSet</a>;
<a href='/constructor/inputStickerSetEmojiGenericAnimations'>inputStickerSetEmojiGenericAnimations</a>#04c4d4ce = <a href='/type/InputStickerSet'>InputStickerSet</a>;
<a href='/constructor/inputStickerSetEmojiDefaultStatuses'>inputStickerSetEmojiDefaultStatuses</a>#29d0f5ee = <a href='/type/InputStickerSet'>InputStickerSet</a>;
<a href='/constructor/messages.stickerSetInstallResultSuccess'>messages.stickerSetInstallResultSuccess</a>#38641628 = <a href='/type/messages.StickerSetInstallResult'>messages.StickerSetInstallResult</a>;
<a href='/constructor/messages.stickerSetInstallResultArchive'>messages.stickerSetInstallResultArchive</a>#35e410a8 sets:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/StickerSetCovered'>StickerSetCovered</a>&gt; = <a href='/type/messages.StickerSetInstallResult'>messages.StickerSetInstallResult</a>;
<a href='/constructor/messages.allStickersNotModified'>messages.allStickersNotModified</a>#e86602c3 = <a href='/type/messages.AllStickers'>messages.AllStickers</a>;
<a href='/constructor/messages.allStickers'>messages.allStickers</a>#cdbbcebb hash:<a href='/type/long'>long</a> sets:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/StickerSet'>StickerSet</a>&gt; = <a href='/type/messages.AllStickers'>messages.AllStickers</a>;
<a href='/constructor/updateNewStickerSet'>updateNewStickerSet</a>#688a30aa stickerset:<a href='/type/messages.StickerSet'>messages.StickerSet</a> = <a href='/type/Update'>Update</a>;
<a href='/constructor/updateStickerSetsOrder'>updateStickerSetsOrder</a>#bb2d201 flags:<a href='/type/%23'>#</a> masks:flags.0?<a href='/constructor/true'>true</a> emojis:flags.1?<a href='/constructor/true'>true</a> order:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/long'>long</a>&gt; = <a href='/type/Update'>Update</a>;
<a href='/constructor/updateStickerSets'>updateStickerSets</a>#31c24808 flags:<a href='/type/%23'>#</a> masks:flags.0?<a href='/constructor/true'>true</a> emojis:flags.1?<a href='/constructor/true'>true</a> = <a href='/type/Update'>Update</a>;
---functions---
<a href='/method/messages.installStickerSet'>messages.installStickerSet</a>#c78fe460 stickerset:<a href='/type/InputStickerSet'>InputStickerSet</a> archived:<a href='/type/Bool'>Bool</a> = <a href='/type/messages.StickerSetInstallResult'>messages.StickerSetInstallResult</a>;
<a href='/method/messages.uninstallStickerSet'>messages.uninstallStickerSet</a>#f96e55de stickerset:<a href='/type/InputStickerSet'>InputStickerSet</a> = <a href='/type/Bool'>Bool</a>;
<a href='/method/messages.toggleStickerSets'>messages.toggleStickerSets</a>#b5052fea flags:<a href='/type/%23'>#</a> uninstall:flags.0?<a href='/constructor/true'>true</a> archive:flags.1?<a href='/constructor/true'>true</a> unarchive:flags.2?<a href='/constructor/true'>true</a> stickersets:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/InputStickerSet'>InputStickerSet</a>&gt; = <a href='/type/Bool'>Bool</a>;
<a href='/method/messages.reorderStickerSets'>messages.reorderStickerSets</a>#78337739 flags:<a href='/type/%23'>#</a> masks:flags.0?<a href='/constructor/true'>true</a> emojis:flags.1?<a href='/constructor/true'>true</a> order:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/long'>long</a>&gt; = <a href='/type/Bool'>Bool</a>;
<a href='/method/messages.getAllStickers'>messages.getAllStickers</a>#b8a0a1a8 hash:<a href='/type/long'>long</a> = <a href='/type/messages.AllStickers'>messages.AllStickers</a>;
<a href='/method/messages.getMaskStickers'>messages.getMaskStickers</a>#640f82b8 hash:<a href='/type/long'>long</a> = <a href='/type/messages.AllStickers'>messages.AllStickers</a>;
<a href='/method/messages.getEmojiStickers'>messages.getEmojiStickers</a>#fbfca18f hash:<a href='/type/long'>long</a> = <a href='/type/messages.AllStickers'>messages.AllStickers</a>;</code></pre>
<p>A <a href="#stickersets">stickerset</a> can be installed using <a href="/method/messages.installStickerSet">messages.installStickerSet</a>, <code>archived=false</code>, with possible return values: </p>
<ul>
<li><a href="/constructor/messages.stickerSetInstallResultSuccess">messages.stickerSetInstallResultSuccess</a> - The stickerset was successfully installed</li>
<li><a href="/constructor/messages.stickerSetInstallResultArchive">messages.stickerSetInstallResultArchive</a> - The stickerset was successfully installed, displacing some older unused stickersets specified in the <code>sets</code> field by <a href="#archived-stickersets">archiving them</a>. </li>
</ul>
<p>Use <a href="/method/messages.uninstallStickerSet">messages.uninstallStickerSet</a> or <a href="/method/messages.toggleStickerSets">messages.toggleStickerSets</a> with the <code>uninstall</code> flag to uninstall one or more stickersets. </p>
<p>An <a href="/constructor/updateNewStickerSet">updateNewStickerSet</a> update will be emitted to the other logged-in sessions when installing stickersets. </p>
<p>An <a href="/constructor/updateStickerSets">updateStickerSets</a> update will be emitted to the other logged-in sessions when uninstalling or archiving stickersets.<br>
This update should trigger a call to the following methods: </p>
<ul>
<li>If <code>masks</code> is set, call <a href="/method/messages.getMaskStickers">messages.getMaskStickers</a>. </li>
<li>If <code>emoji</code> is set, call <a href="/method/messages.getEmojiStickers">messages.getEmojiStickers</a>. </li>
<li>Otherwise, call <a href="/method/messages.getAllStickers">messages.getAllStickers</a> and <a href="/method/messages.getArchivedStickers">messages.getArchivedStickers</a>.</li>
</ul>
<p>Use <a href="/method/messages.reorderStickerSets">messages.reorderStickerSets</a> to reorder installed stickersets by the <a href="/constructor/stickerSet">stickerSet</a> ID: notice that normal, <a href="#mask-stickers">mask</a> and <a href="/api/custom-emoji">custom emoji</a> stickersets are ordered independently, use the appropriate flags to sort the correct type of stickerset.</p>
<p>An <a href="/constructor/updateStickerSetsOrder">updateStickerSetsOrder</a> update will be emitted to the other logged-in sessions when reordering stickersets.<br>
This update should trigger a call to <a href="/method/messages.getAllStickers">messages.getAllStickers</a>, <a href="/method/messages.getArchivedStickers">messages.getArchivedStickers</a>, <a href="/method/messages.getEmojiStickers">messages.getEmojiStickers</a>. </p>
<p>Use <a href="/method/messages.getAllStickers">messages.getAllStickers</a> to fetch all installed and non-archived stickersets.<br>
Use <a href="/method/messages.getEmojiStickers">messages.getEmojiStickers</a> to fetch all installed and non-archived <a href="/api/custom-emoji">custom emoji</a> stickersets. </p>
<h3><a class="anchor" href="#creating-stickersets" id="creating-stickersets" name="creating-stickersets"><i class="anchor-icon"></i></a>Creating stickersets</h3>
<pre><code><a href='/constructor/inputStickerSetItem'>inputStickerSetItem</a>#32da9e9c flags:<a href='/type/%23'>#</a> document:<a href='/type/InputDocument'>InputDocument</a> emoji:<a href='/type/string'>string</a> mask_coords:flags.0?<a href='/type/MaskCoords'>MaskCoords</a> keywords:flags.1?<a href='/type/string'>string</a> = <a href='/type/InputStickerSetItem'>InputStickerSetItem</a>;
<a href='/constructor/messages.stickerSet'>messages.stickerSet</a>#6e153f16 set:<a href='/type/StickerSet'>StickerSet</a> packs:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/StickerPack'>StickerPack</a>&gt; keywords:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/StickerKeyword'>StickerKeyword</a>&gt; documents:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/Document'>Document</a>&gt; = <a href='/type/messages.StickerSet'>messages.StickerSet</a>;
<a href='/constructor/messages.stickerSetNotModified'>messages.stickerSetNotModified</a>#d3f924eb = <a href='/type/messages.StickerSet'>messages.StickerSet</a>;
<a href='/constructor/stickers.suggestedShortName'>stickers.suggestedShortName</a>#85fea03f short_name:<a href='/type/string'>string</a> = <a href='/type/stickers.SuggestedShortName'>stickers.SuggestedShortName</a>;
---functions---
<a href='/method/messages.uploadMedia'>messages.uploadMedia</a>#519bc2b1 peer:<a href='/type/InputPeer'>InputPeer</a> media:<a href='/type/InputMedia'>InputMedia</a> = <a href='/type/MessageMedia'>MessageMedia</a>;
<a href='/method/stickers.checkShortName'>stickers.checkShortName</a>#284b3639 short_name:<a href='/type/string'>string</a> = <a href='/type/Bool'>Bool</a>;
<a href='/method/stickers.suggestShortName'>stickers.suggestShortName</a>#4dafc503 title:<a href='/type/string'>string</a> = <a href='/type/stickers.SuggestedShortName'>stickers.SuggestedShortName</a>;
<a href='/method/stickers.createStickerSet'>stickers.createStickerSet</a>#9021ab67 flags:<a href='/type/%23'>#</a> masks:flags.0?<a href='/constructor/true'>true</a> animated:flags.1?<a href='/constructor/true'>true</a> videos:flags.4?<a href='/constructor/true'>true</a> emojis:flags.5?<a href='/constructor/true'>true</a> text_color:flags.6?<a href='/constructor/true'>true</a> user_id:<a href='/type/InputUser'>InputUser</a> title:<a href='/type/string'>string</a> short_name:<a href='/type/string'>string</a> thumb:flags.2?<a href='/type/InputDocument'>InputDocument</a> stickers:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/InputStickerSetItem'>InputStickerSetItem</a>&gt; software:flags.3?<a href='/type/string'>string</a> = <a href='/type/messages.StickerSet'>messages.StickerSet</a>;
<a href='/method/stickers.addStickerToSet'>stickers.addStickerToSet</a>#8653febe stickerset:<a href='/type/InputStickerSet'>InputStickerSet</a> sticker:<a href='/type/InputStickerSetItem'>InputStickerSetItem</a> = <a href='/type/messages.StickerSet'>messages.StickerSet</a>;
<a href='/method/stickers.removeStickerFromSet'>stickers.removeStickerFromSet</a>#f7760f51 sticker:<a href='/type/InputDocument'>InputDocument</a> = <a href='/type/messages.StickerSet'>messages.StickerSet</a>;
<a href='/method/stickers.changeStickerPosition'>stickers.changeStickerPosition</a>#ffb6d4ca sticker:<a href='/type/InputDocument'>InputDocument</a> position:<a href='/type/int'>int</a> = <a href='/type/messages.StickerSet'>messages.StickerSet</a>;
<a href='/method/stickers.setStickerSetThumb'>stickers.setStickerSetThumb</a>#a76a5392 flags:<a href='/type/%23'>#</a> stickerset:<a href='/type/InputStickerSet'>InputStickerSet</a> thumb:flags.0?<a href='/type/InputDocument'>InputDocument</a> thumb_document_id:flags.1?<a href='/type/long'>long</a> = <a href='/type/messages.StickerSet'>messages.StickerSet</a>;</code></pre>
<p>Bots and users can create stickersets by using the following methods.<br>
Users can also create stickersets by interacting with the official <a href="https://t.me/stickers">@stickers</a> bot. </p>
<p>Note that unofficial bots <strong>must</strong> append a <code>"_by_&lt;bot_username&gt;"</code> prefix to the stickerset short name when creating stickersets.
Also note that users can't directly modify stickersets created using <a href="/method/stickers.createStickerSet">stickers.createStickerSet</a>, and must use the <a href="https://t.me/stickers">@stickers</a> bot, instead: only the sticker creation+shortname methods are available directly to users to allow <a href="/import-stickers">importing stickers using the stickers SDK</a>. </p>
<p>Use <a href="/method/messages.uploadMedia">messages.uploadMedia</a> to upload stickers and thumbnails, if you don't already have access to a previously uploaded <a href="/constructor/document">document</a>. </p>
<p>Use <a href="/method/stickers.checkShortName">stickers.checkShortName</a> to check if a given short name is available, and <a href="/method/stickers.suggestShortName">stickers.suggestShortName</a> to let the server suggest a short name, given the stickerset title.</p>
<p>Use <a href="/method/stickers.createStickerSet">stickers.createStickerSet</a> to create normal, <a href="#animated-stickers">animated</a>, <a href="#video-stickers">video</a> or <a href="#mask-stickers">mask</a> stickersets.<br>
<a href="/api/custom-emoji">Custom emoji</a> stickersets can only be created using the <a href="https://t.me/stickers">@stickers</a> bot for now. </p>
<p>Use <a href="/method/stickers.addStickerToSet">stickers.addStickerToSet</a> to add stickers to the stickerset.<br>
Use <a href="/method/stickers.addStickerToSet">stickers.setStickerSetThumb</a> to edit the stickerset thumbnail after creation.<br>
Use <a href="/method/stickers.removeStickerFromSet">stickers.removeStickerFromSet</a> to remove stickers from a stickerset, and <a href="/method/stickers.changeStickerPosition">stickers.changeStickerPosition</a> to move stickers in a stickerset (simply providing the sticker document is enough). </p>
<h3><a class="anchor" href="#searching-stickersets" id="searching-stickersets" name="searching-stickersets"><i class="anchor-icon"></i></a>Searching stickersets</h3>
<pre><code><a href='/constructor/messages.foundStickerSetsNotModified'>messages.foundStickerSetsNotModified</a>#d54b65d = <a href='/type/messages.FoundStickerSets'>messages.FoundStickerSets</a>;
<a href='/constructor/messages.foundStickerSets'>messages.foundStickerSets</a>#8af09dd2 hash:<a href='/type/long'>long</a> sets:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/StickerSetCovered'>StickerSetCovered</a>&gt; = <a href='/type/messages.FoundStickerSets'>messages.FoundStickerSets</a>;
---functions---
<a href='/method/messages.searchStickerSets'>messages.searchStickerSets</a>#35705b8a flags:<a href='/type/%23'>#</a> exclude_featured:flags.0?<a href='/constructor/true'>true</a> q:<a href='/type/string'>string</a> hash:<a href='/type/long'>long</a> = <a href='/type/messages.FoundStickerSets'>messages.FoundStickerSets</a>;
<a href='/method/messages.searchEmojiStickerSets'>messages.searchEmojiStickerSets</a>#92b4494c flags:<a href='/type/%23'>#</a> exclude_featured:flags.0?<a href='/constructor/true'>true</a> q:<a href='/type/string'>string</a> hash:<a href='/type/long'>long</a> = <a href='/type/messages.FoundStickerSets'>messages.FoundStickerSets</a>;</code></pre>
<p>You can use <a href="/method/messages.searchStickerSets">messages.searchStickerSets</a> and <a href="/method/messages.searchEmojiStickerSets">messages.searchEmojiStickerSets</a> to search globally available normal stickersets and <a href="/api/custom-emoji">custom emoji stickersets »</a> by name: note that this method returns a set of <a href="#stickerset-previews">stickerset previews »</a>.</p>
<h3><a class="anchor" href="#featured-stickersets" id="featured-stickersets" name="featured-stickersets"><i class="anchor-icon"></i></a>Featured stickersets</h3>
<pre><code><a href='/constructor/messages.featuredStickersNotModified'>messages.featuredStickersNotModified</a>#c6dc0c66 count:<a href='/type/int'>int</a> = <a href='/type/messages.FeaturedStickers'>messages.FeaturedStickers</a>;
<a href='/constructor/messages.featuredStickers'>messages.featuredStickers</a>#be382906 flags:<a href='/type/%23'>#</a> premium:flags.0?<a href='/constructor/true'>true</a> hash:<a href='/type/long'>long</a> count:<a href='/type/int'>int</a> sets:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/StickerSetCovered'>StickerSetCovered</a>&gt; unread:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/long'>long</a>&gt; = <a href='/type/messages.FeaturedStickers'>messages.FeaturedStickers</a>;
<a href='/constructor/updateReadFeaturedStickers'>updateReadFeaturedStickers</a>#571d2742 = <a href='/type/Update'>Update</a>;
<a href='/constructor/updateReadFeaturedEmojiStickers'>updateReadFeaturedEmojiStickers</a>#fb4c496c = <a href='/type/Update'>Update</a>;
---functions---
<a href='/method/messages.getFeaturedStickers'>messages.getFeaturedStickers</a>#64780b14 hash:<a href='/type/long'>long</a> = <a href='/type/messages.FeaturedStickers'>messages.FeaturedStickers</a>;
<a href='/method/messages.readFeaturedStickers'>messages.readFeaturedStickers</a>#5b118126 id:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/long'>long</a>&gt; = <a href='/type/Bool'>Bool</a>;
<a href='/method/messages.getOldFeaturedStickers'>messages.getOldFeaturedStickers</a>#7ed094a1 offset:<a href='/type/int'>int</a> limit:<a href='/type/int'>int</a> hash:<a href='/type/long'>long</a> = <a href='/type/messages.FeaturedStickers'>messages.FeaturedStickers</a>;
<a href='/method/messages.getFeaturedEmojiStickers'>messages.getFeaturedEmojiStickers</a>#ecf6736 hash:<a href='/type/long'>long</a> = <a href='/type/messages.FeaturedStickers'>messages.FeaturedStickers</a>;</code></pre>
<p>Telegram showcases a set of featured stickersets: they can be fetched using <a href="/method/messages.getFeaturedStickers">messages.getFeaturedStickers</a> or <a href="/method/messages.getFeaturedEmojiStickers">messages.getFeaturedEmojiStickers</a>, for <a href="/api/custom-emoji">custom emojis</a>. </p>
<p>Clients should preload featured stickers on startup according to the value of the <code>preload_featured_stickers</code> <a href="/constructor/config">configuration parameter</a>. </p>
<p>The method also returns a set of unread <a href="/constructor/stickerSet">stickerSet</a> IDs in the <code>unread</code> field: use <a href="/method/messages.readFeaturedStickers">messages.readFeaturedStickers</a> to mark them as read: note that this will only affect the <code>unread</code> field, all stickersets will still be returned, unless you also <a href="/api/offsets#hash-generation">generate a <code>hash</code></a>.<br>
This method will also emit an <a href="/constructor/updateReadFeaturedStickers">updateReadFeaturedStickers</a> or <a href="/constructor/updateReadFeaturedEmojiStickers">updateReadFeaturedEmojiStickers</a> update on all other logged-in sessions. </p>
<p><a href="/method/messages.getOldFeaturedStickers">messages.getOldFeaturedStickers</a> can be used to fetch an extended list with even more featured stickersets, that were previously featured in the short list returned by <a href="/method/messages.getFeaturedStickers">messages.getFeaturedStickers</a>. </p>
<h3><a class="anchor" href="#favorite-stickersets" id="favorite-stickersets" name="favorite-stickersets"><i class="anchor-icon"></i></a>Favorite stickersets</h3>
<pre><code><a href='/constructor/messages.favedStickersNotModified'>messages.favedStickersNotModified</a>#9e8fa6d3 = <a href='/type/messages.FavedStickers'>messages.FavedStickers</a>;
<a href='/constructor/messages.favedStickers'>messages.favedStickers</a>#2cb51097 hash:<a href='/type/long'>long</a> packs:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/StickerPack'>StickerPack</a>&gt; stickers:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/Document'>Document</a>&gt; = <a href='/type/messages.FavedStickers'>messages.FavedStickers</a>;
<a href='/constructor/updateFavedStickers'>updateFavedStickers</a>#e511996d = <a href='/type/Update'>Update</a>;
---functions---
<a href='/method/messages.faveSticker'>messages.faveSticker</a>#b9ffc55b id:<a href='/type/InputDocument'>InputDocument</a> unfave:<a href='/type/Bool'>Bool</a> = <a href='/type/Bool'>Bool</a>;
<a href='/method/messages.getFavedStickers'>messages.getFavedStickers</a>#4f1aaa9 hash:<a href='/type/long'>long</a> = <a href='/type/messages.FavedStickers'>messages.FavedStickers</a>;</code></pre>
<p>A stickerset can be faved or unfaved using <a href="/method/messages.faveSticker">messages.faveSticker</a>.</p>
<p>Favorited stickers can be fetched using <a href="/method/messages.getFavedStickers">messages.getFavedStickers</a>: note that this method returns a set of <a href="#stickerset-previews">stickerset previews »</a>.</p>
<p>Users can fave only a certain number of stickersets, as specified by the following <a href="/api/config#client-configuration">configuration</a> parameters:</p>
<ul>
<li>Premium users can fave a total of <a href="/api/config#stickers-faved-limit-premium"><code>stickers_faved_limit_premium</code> stickersets</a>. </li>
<li>Non-Premium users can fave a total of <a href="/api/config#stickers-faved-limit-default"><code>stickers_faved_limit_default</code> stickersets</a>. </li>
</ul>
<p>An <a href="/constructor/updateFavedStickers">updateFavedStickers</a> update will be emitted to the other logged-in sessions when faving or unfaving stickersets.<br>
This update should trigger a call to <a href="/method/messages.getFavedStickers">messages.getFavedStickers</a>. </p>
<h3><a class="anchor" href="#archived-stickersets" id="archived-stickersets" name="archived-stickersets"><i class="anchor-icon"></i></a>Archived stickersets</h3>
<pre><code><a href='/constructor/messages.archivedStickers'>messages.archivedStickers</a>#4fcba9c8 count:<a href='/type/int'>int</a> sets:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/StickerSetCovered'>StickerSetCovered</a>&gt; = <a href='/type/messages.ArchivedStickers'>messages.ArchivedStickers</a>;
<a href='/constructor/updateStickerSets'>updateStickerSets</a>#31c24808 flags:<a href='/type/%23'>#</a> masks:flags.0?<a href='/constructor/true'>true</a> emojis:flags.1?<a href='/constructor/true'>true</a> = <a href='/type/Update'>Update</a>;
---functions---
<a href='/method/messages.installStickerSet'>messages.installStickerSet</a>#c78fe460 stickerset:<a href='/type/InputStickerSet'>InputStickerSet</a> archived:<a href='/type/Bool'>Bool</a> = <a href='/type/messages.StickerSetInstallResult'>messages.StickerSetInstallResult</a>;
<a href='/method/messages.toggleStickerSets'>messages.toggleStickerSets</a>#b5052fea flags:<a href='/type/%23'>#</a> uninstall:flags.0?<a href='/constructor/true'>true</a> archive:flags.1?<a href='/constructor/true'>true</a> unarchive:flags.2?<a href='/constructor/true'>true</a> stickersets:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/InputStickerSet'>InputStickerSet</a>&gt; = <a href='/type/Bool'>Bool</a>;
<a href='/method/messages.getArchivedStickers'>messages.getArchivedStickers</a>#57f17692 flags:<a href='/type/%23'>#</a> masks:flags.0?<a href='/constructor/true'>true</a> emojis:flags.1?<a href='/constructor/true'>true</a> offset_id:<a href='/type/long'>long</a> limit:<a href='/type/int'>int</a> = <a href='/type/messages.ArchivedStickers'>messages.ArchivedStickers</a>;</code></pre>
<p>One or more stickersets can be archived (or unarchived) using <a href="/method/messages.installStickerSet">messages.installStickerSet</a> with <code>archived=true|false</code>, or <a href="/method/messages.toggleStickerSets">messages.toggleStickerSets</a> with either the <code>archive</code> or <code>unarchive</code> flag. </p>
<p>An unused stickerset may also be automatically archived when <a href="#installing-stickersets">installing new stickersets</a>.</p>
<p>Archived stickers are not returned by <a href="/method/messages.getAllStickers">messages.getAllStickers</a> and can only be fetched using <a href="/method/messages.getArchivedStickers">messages.getArchivedStickers</a>: note that this method returns a set of <a href="#stickerset-previews">stickerset previews »</a>.</p>
<p>An <a href="/constructor/updateStickerSets">updateStickerSets</a> update will be emitted to the other logged-in sessions when archiving or unarchiving stickersets.<br>
This update should trigger a call to <a href="/method/messages.getArchivedStickers">messages.getArchivedStickers</a>. </p>
<h3><a class="anchor" href="#recent-stickers" id="recent-stickers" name="recent-stickers"><i class="anchor-icon"></i></a>Recent stickers</h3>
<pre><code><a href='/constructor/messages.recentStickersNotModified'>messages.recentStickersNotModified</a>#b17f890 = <a href='/type/messages.RecentStickers'>messages.RecentStickers</a>;
<a href='/constructor/messages.recentStickers'>messages.recentStickers</a>#88d37c56 hash:<a href='/type/long'>long</a> packs:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/StickerPack'>StickerPack</a>&gt; stickers:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/Document'>Document</a>&gt; dates:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/int'>int</a>&gt; = <a href='/type/messages.RecentStickers'>messages.RecentStickers</a>;
<a href='/constructor/updateRecentStickers'>updateRecentStickers</a>#9a422c20 = <a href='/type/Update'>Update</a>;
---functions---
<a href='/method/messages.saveRecentSticker'>messages.saveRecentSticker</a>#392718f8 flags:<a href='/type/%23'>#</a> attached:flags.0?<a href='/constructor/true'>true</a> id:<a href='/type/InputDocument'>InputDocument</a> unsave:<a href='/type/Bool'>Bool</a> = <a href='/type/Bool'>Bool</a>;
<a href='/method/messages.getRecentStickers'>messages.getRecentStickers</a>#9da9403b flags:<a href='/type/%23'>#</a> attached:flags.0?<a href='/constructor/true'>true</a> hash:<a href='/type/long'>long</a> = <a href='/type/messages.RecentStickers'>messages.RecentStickers</a>;
<a href='/method/messages.clearRecentStickers'>messages.clearRecentStickers</a>#8999602d flags:<a href='/type/%23'>#</a> attached:flags.0?<a href='/constructor/true'>true</a> = <a href='/type/Bool'>Bool</a>;</code></pre>
<p>After using a sticker in a message, clients should invoke <a href="/method/messages.saveRecentSticker">messages.saveRecentSticker</a> (normal and <a href="#mask-stickers">mask</a> stickers only, mask stickers should set the <code>attached</code> flag). </p>
<p>A sticker can be then removed from the recent stickers list using <a href="/method/messages.saveRecentSticker">messages.saveRecentSticker</a> with <code>unsave=true</code>; the entire list can be cleared using <a href="/method/messages.clearRecentStickers">messages.clearRecentStickers</a>. </p>
<p>Use <a href="/method/messages.getRecentStickers">messages.getRecentStickers</a> to fetch the recent stickers list.</p>
<p>Users can add only a certain number of recent stickers, according to the value of the <code>stickers_recent_limit</code> <a href="/constructor/config">configuration parameter</a>. </p>
<p>An <a href="/constructor/updateRecentStickers">updateRecentStickers</a> update will be emitted to the other logged-in sessions when modifying the recent stickerset list.<br>
This update should trigger a call to <a href="/method/messages.getRecentStickers">messages.getRecentStickers</a>. </p>
<h3><a class="anchor" href="#recent-stickersets" id="recent-stickersets" name="recent-stickersets"><i class="anchor-icon"></i></a>Recent stickersets</h3>
<pre><code><a href='/constructor/updateMoveStickerSetToTop'>updateMoveStickerSetToTop</a>#86fccf85 flags:<a href='/type/%23'>#</a> masks:flags.0?<a href='/constructor/true'>true</a> emojis:flags.1?<a href='/constructor/true'>true</a> stickerset:<a href='/type/long'>long</a> = <a href='/type/Update'>Update</a>;
---functions---
<a href='/method/messages.sendMessage'>messages.sendMessage</a>#280d096f flags:<a href='/type/%23'>#</a> no_webpage:flags.1?<a href='/constructor/true'>true</a> silent:flags.5?<a href='/constructor/true'>true</a> background:flags.6?<a href='/constructor/true'>true</a> clear_draft:flags.7?<a href='/constructor/true'>true</a> noforwards:flags.14?<a href='/constructor/true'>true</a> update_stickersets_order:flags.15?<a href='/constructor/true'>true</a> invert_media:flags.16?<a href='/constructor/true'>true</a> peer:<a href='/type/InputPeer'>InputPeer</a> reply_to:flags.0?<a href='/type/InputReplyTo'>InputReplyTo</a> message:<a href='/type/string'>string</a> random_id:<a href='/type/long'>long</a> reply_markup:flags.2?<a href='/type/ReplyMarkup'>ReplyMarkup</a> entities:flags.3?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/MessageEntity'>MessageEntity</a>&gt; schedule_date:flags.10?<a href='/type/int'>int</a> send_as:flags.13?<a href='/type/InputPeer'>InputPeer</a> = <a href='/type/Updates'>Updates</a>;
<a href='/method/messages.sendMedia'>messages.sendMedia</a>#72ccc23d flags:<a href='/type/%23'>#</a> silent:flags.5?<a href='/constructor/true'>true</a> background:flags.6?<a href='/constructor/true'>true</a> clear_draft:flags.7?<a href='/constructor/true'>true</a> noforwards:flags.14?<a href='/constructor/true'>true</a> update_stickersets_order:flags.15?<a href='/constructor/true'>true</a> invert_media:flags.16?<a href='/constructor/true'>true</a> peer:<a href='/type/InputPeer'>InputPeer</a> reply_to:flags.0?<a href='/type/InputReplyTo'>InputReplyTo</a> media:<a href='/type/InputMedia'>InputMedia</a> message:<a href='/type/string'>string</a> random_id:<a href='/type/long'>long</a> reply_markup:flags.2?<a href='/type/ReplyMarkup'>ReplyMarkup</a> entities:flags.3?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/MessageEntity'>MessageEntity</a>&gt; schedule_date:flags.10?<a href='/type/int'>int</a> send_as:flags.13?<a href='/type/InputPeer'>InputPeer</a> = <a href='/type/Updates'>Updates</a>;
<a href='/method/messages.sendMultiMedia'>messages.sendMultiMedia</a>#456e8987 flags:<a href='/type/%23'>#</a> silent:flags.5?<a href='/constructor/true'>true</a> background:flags.6?<a href='/constructor/true'>true</a> clear_draft:flags.7?<a href='/constructor/true'>true</a> noforwards:flags.14?<a href='/constructor/true'>true</a> update_stickersets_order:flags.15?<a href='/constructor/true'>true</a> invert_media:flags.16?<a href='/constructor/true'>true</a> peer:<a href='/type/InputPeer'>InputPeer</a> reply_to:flags.0?<a href='/type/InputReplyTo'>InputReplyTo</a> multi_media:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/InputSingleMedia'>InputSingleMedia</a>&gt; schedule_date:flags.10?<a href='/type/int'>int</a> send_as:flags.13?<a href='/type/InputPeer'>InputPeer</a> = <a href='/type/Updates'>Updates</a>;</code></pre>
<p>The <code>update_stickersets_order</code> flag should be set when manually choosing and using stickers, <a href="#mask-stickers">masks</a> and <a href="/api/custom-emoji">custom emojis</a> from a specific stickerset in the stickerset selection bar (not through suggested or recent stickersets UI views).<br>
Note that for <a href="/api/custom-emoji">custom emojis</a>, the flag should only be set when manually choosing custom emojis from a single custom emoji stickerset (not multiple custom emoji stickersets). </p>
<p>Setting this flag will trigger an <a href="/constructor/updateMoveStickerSetToTop">updateMoveStickerSetToTop</a> update (instead of the usual <a href="/constructor/updateStickerSetsOrder">updateStickerSetsOrder</a>/<a href="/constructor/updateStickerSetsOrder">updateStickerSets</a> updates), indicating that the installed stickerset list was reordered and the specified stickerset was moved to the top.</p>
<p>Note that the API also offers a separate list of recent <em>stickers</em> (not stickersets), see <a href="#recent-stickers">here »</a> for more info. </p>
<h3><a class="anchor" href="#sticker-suggestions" id="sticker-suggestions" name="sticker-suggestions"><i class="anchor-icon"></i></a>Sticker suggestions</h3>
<pre><code><a href='/constructor/messages.stickersNotModified'>messages.stickersNotModified</a>#f1749a22 = <a href='/type/messages.Stickers'>messages.Stickers</a>;
<a href='/constructor/messages.stickers'>messages.stickers</a>#30a6ec7e hash:<a href='/type/long'>long</a> stickers:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/Document'>Document</a>&gt; = <a href='/type/messages.Stickers'>messages.Stickers</a>;
<a href='/constructor/emojiListNotModified'>emojiListNotModified</a>#481eadfa = <a href='/type/EmojiList'>EmojiList</a>;
<a href='/constructor/emojiList'>emojiList</a>#7a1e11d1 hash:<a href='/type/long'>long</a> document_id:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/long'>long</a>&gt; = <a href='/type/EmojiList'>EmojiList</a>;
---functions---
<a href='/method/messages.getStickers'>messages.getStickers</a>#d5a5d3a1 emoticon:<a href='/type/string'>string</a> hash:<a href='/type/long'>long</a> = <a href='/type/messages.Stickers'>messages.Stickers</a>;
<a href='/method/messages.searchCustomEmoji'>messages.searchCustomEmoji</a>#2c11c0d7 emoticon:<a href='/type/string'>string</a> hash:<a href='/type/long'>long</a> = <a href='/type/EmojiList'>EmojiList</a>;</code></pre>
<p>Clients should show a popup with a list of suggested stickers and <a href="/api/custom-emoji">custom emojis</a> when the user enters an emoji in the text bar. </p>
<p><strong>If</strong> the <a href="/api/config#stickers-emoji-suggest-only-api"><code>stickers_emoji_suggest_only_api</code> app configuration parameter</a> is set to true, clients must invoke <a href="/method/messages.getStickers">messages.getStickers</a>/<a href="/method/messages.searchCustomEmoji">messages.searchCustomEmoji</a> to fetch a list of suggested stickers/<a href="/api/custom-emoji">custom emojis</a> for the emoji.<br>
The <a href="/api/config#stickers-emoji-cache-time">stickers_emoji_cache_time appConfig parameter</a> specifies the validity period of the local cache of <a href="/method/messages.getStickers">messages.getStickers</a>/<a href="/method/messages.searchCustomEmoji">messages.searchCustomEmoji</a>, also relevant when generating the pagination hash when invoking the method. </p>
<p><strong>Otherwise</strong>, the following local logic should be used. </p>
<ul>
<li>Construct two lists of recently used stickers, matching the emoji:<ul>
<li>List <strong>a</strong>) Contains all non-Premium stickers.</li>
<li>List <strong>b</strong>) Contains all Premium stickers. </li>
</ul>
</li>
<li>The final suggested sticker list <strong>c</strong> is composed as follows:<ul>
<li>If the user doesn't have a <a href="/api/premium">Premium subscription</a>: all stickers from <strong>a</strong>, followed by <code>stickers_premium_by_emoji_num</code> stickers from <strong>b</strong>.</li>
<li>If the user has a <a href="/api/premium">Premium subscription</a>: <code>stickers_normal_by_emoji_per_premium_num</code> stickers from <strong>a</strong>, followed by 1 sticker from <strong>b</strong>, and so on until both lists are empty.</li>
</ul>
</li>
</ul>
<h3><a class="anchor" href="#attached-stickers" id="attached-stickers" name="attached-stickers"><i class="anchor-icon"></i></a>Attached stickers</h3>
<pre><code><a href='/constructor/inputMediaUploadedPhoto'>inputMediaUploadedPhoto</a>#1e287d04 flags:<a href='/type/%23'>#</a> spoiler:flags.2?<a href='/constructor/true'>true</a> file:<a href='/type/InputFile'>InputFile</a> stickers:flags.0?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/InputDocument'>InputDocument</a>&gt; ttl_seconds:flags.1?<a href='/type/int'>int</a> = <a href='/type/InputMedia'>InputMedia</a>;
<a href='/constructor/inputMediaUploadedDocument'>inputMediaUploadedDocument</a>#5b38c6c1 flags:<a href='/type/%23'>#</a> nosound_video:flags.3?<a href='/constructor/true'>true</a> force_file:flags.4?<a href='/constructor/true'>true</a> spoiler:flags.5?<a href='/constructor/true'>true</a> file:<a href='/type/InputFile'>InputFile</a> thumb:flags.2?<a href='/type/InputFile'>InputFile</a> mime_type:<a href='/type/string'>string</a> attributes:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/DocumentAttribute'>DocumentAttribute</a>&gt; stickers:flags.0?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/InputDocument'>InputDocument</a>&gt; ttl_seconds:flags.1?<a href='/type/int'>int</a> = <a href='/type/InputMedia'>InputMedia</a>;
<a href='/constructor/photo'>photo</a>#fb197a65 flags:<a href='/type/%23'>#</a> has_stickers:flags.0?<a href='/constructor/true'>true</a> id:<a href='/type/long'>long</a> access_hash:<a href='/type/long'>long</a> file_reference:<a href='/type/bytes'>bytes</a> date:<a href='/type/int'>int</a> sizes:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/PhotoSize'>PhotoSize</a>&gt; video_sizes:flags.1?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/VideoSize'>VideoSize</a>&gt; dc_id:<a href='/type/int'>int</a> = <a href='/type/Photo'>Photo</a>;
<a href='/constructor/document'>document</a>#8fd4c4d8 flags:<a href='/type/%23'>#</a> id:<a href='/type/long'>long</a> access_hash:<a href='/type/long'>long</a> file_reference:<a href='/type/bytes'>bytes</a> date:<a href='/type/int'>int</a> mime_type:<a href='/type/string'>string</a> size:<a href='/type/long'>long</a> thumbs:flags.0?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/PhotoSize'>PhotoSize</a>&gt; video_thumbs:flags.1?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/VideoSize'>VideoSize</a>&gt; dc_id:<a href='/type/int'>int</a> attributes:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/DocumentAttribute'>DocumentAttribute</a>&gt; = <a href='/type/Document'>Document</a>;
<a href='/constructor/documentAttributeHasStickers'>documentAttributeHasStickers</a>#9801d2f7 = <a href='/type/DocumentAttribute'>DocumentAttribute</a>;
<a href='/constructor/inputStickeredMediaPhoto'>inputStickeredMediaPhoto</a>#4a992157 id:<a href='/type/InputPhoto'>InputPhoto</a> = <a href='/type/InputStickeredMedia'>InputStickeredMedia</a>;
<a href='/constructor/inputStickeredMediaDocument'>inputStickeredMediaDocument</a>#438865b id:<a href='/type/InputDocument'>InputDocument</a> = <a href='/type/InputStickeredMedia'>InputStickeredMedia</a>;
<a href='/constructor/inputStickerSetItem'>inputStickerSetItem</a>#32da9e9c flags:<a href='/type/%23'>#</a> document:<a href='/type/InputDocument'>InputDocument</a> emoji:<a href='/type/string'>string</a> mask_coords:flags.0?<a href='/type/MaskCoords'>MaskCoords</a> keywords:flags.1?<a href='/type/string'>string</a> = <a href='/type/InputStickerSetItem'>InputStickerSetItem</a>;
<a href='/constructor/stickerSetCovered'>stickerSetCovered</a>#6410a5d2 set:<a href='/type/StickerSet'>StickerSet</a> cover:<a href='/type/Document'>Document</a> = <a href='/type/StickerSetCovered'>StickerSetCovered</a>;
<a href='/constructor/stickerSetMultiCovered'>stickerSetMultiCovered</a>#3407e51b set:<a href='/type/StickerSet'>StickerSet</a> covers:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/Document'>Document</a>&gt; = <a href='/type/StickerSetCovered'>StickerSetCovered</a>;
---functions---
<a href='/method/messages.sendMedia'>messages.sendMedia</a>#72ccc23d flags:<a href='/type/%23'>#</a> silent:flags.5?<a href='/constructor/true'>true</a> background:flags.6?<a href='/constructor/true'>true</a> clear_draft:flags.7?<a href='/constructor/true'>true</a> noforwards:flags.14?<a href='/constructor/true'>true</a> update_stickersets_order:flags.15?<a href='/constructor/true'>true</a> invert_media:flags.16?<a href='/constructor/true'>true</a> peer:<a href='/type/InputPeer'>InputPeer</a> reply_to:flags.0?<a href='/type/InputReplyTo'>InputReplyTo</a> media:<a href='/type/InputMedia'>InputMedia</a> message:<a href='/type/string'>string</a> random_id:<a href='/type/long'>long</a> reply_markup:flags.2?<a href='/type/ReplyMarkup'>ReplyMarkup</a> entities:flags.3?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/MessageEntity'>MessageEntity</a>&gt; schedule_date:flags.10?<a href='/type/int'>int</a> send_as:flags.13?<a href='/type/InputPeer'>InputPeer</a> = <a href='/type/Updates'>Updates</a>;
<a href='/method/messages.getAttachedStickers'>messages.getAttachedStickers</a>#cc5b67cc media:<a href='/type/InputStickeredMedia'>InputStickeredMedia</a> = <a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/StickerSetCovered'>StickerSetCovered</a>&gt;;</code></pre>
<p>Stickers of all kinds can be attached to photos and videos.<br>
First, overlay the sticker on top of the media file locally (properly handling eventual default <a href="#mask-stickers">mask coordinates</a>), and <a href="/api/files">upload</a> the modified media file.<br>
Then, when sending the media file using <a href="/method/messages.sendMedia">messages.sendMedia</a>, indicate the stickers that were overlaid in the <code>stickers</code> field of <a href="/constructor/inputMediaUploadedPhoto">inputMediaUploadedPhoto</a> or <a href="/constructor/inputMediaUploadedPhoto">inputMediaUploadedDocument</a>. </p>
<p>Sent stickered <a href="/constructor/photo">photos</a> will have the <code>has_stickers</code> flag set.<br>
Sent stickered <a href="/constructor/document">video documents</a> will have a <a href="/constructor/documentAttributeHasStickers">documentAttributeHasStickers</a> attribute. </p>
<p>When receiving such a media file, clients should call <a href="/method/messages.getAttachedStickers">messages.getAttachedStickers</a>, passing the media: the method will return a set of <a href="#stickerset-previews">stickerset previews »</a>, with info about the stickersets (not stickers) used in the media.</p>
<h4><a class="anchor" href="#mask-stickers" id="mask-stickers" name="mask-stickers"><i class="anchor-icon"></i></a>Mask stickers</h4>
<p>Mask stickers are a special kind of <a href="#static-stickers">static</a> stickers that are meant to be overlaid on top of photos and attached to media, as specified <a href="#attached-stickers">here »</a>.</p>
<pre><code><a href='/constructor/maskCoords'>maskCoords</a>#aed6dbb2 n:<a href='/type/int'>int</a> x:<a href='/type/double'>double</a> y:<a href='/type/double'>double</a> zoom:<a href='/type/double'>double</a> = <a href='/type/MaskCoords'>MaskCoords</a>;
<a href='/constructor/documentAttributeSticker'>documentAttributeSticker</a>#6319d612 flags:<a href='/type/%23'>#</a> mask:flags.1?<a href='/constructor/true'>true</a> alt:<a href='/type/string'>string</a> stickerset:<a href='/type/InputStickerSet'>InputStickerSet</a> mask_coords:flags.0?<a href='/type/MaskCoords'>MaskCoords</a> = <a href='/type/DocumentAttribute'>DocumentAttribute</a>;
<a href='/constructor/inputStickerSetItem'>inputStickerSetItem</a>#32da9e9c flags:<a href='/type/%23'>#</a> document:<a href='/type/InputDocument'>InputDocument</a> emoji:<a href='/type/string'>string</a> mask_coords:flags.0?<a href='/type/MaskCoords'>MaskCoords</a> keywords:flags.1?<a href='/type/string'>string</a> = <a href='/type/InputStickerSetItem'>InputStickerSetItem</a>;
---functions---
<a href='/method/messages.getMaskStickers'>messages.getMaskStickers</a>#640f82b8 hash:<a href='/type/long'>long</a> = <a href='/type/messages.AllStickers'>messages.AllStickers</a>;</code></pre>
<p>Mask stickers can optionally have associated coordinates, contained in the <a href="/constructor/maskCoords">maskCoords</a> constructor. </p>
<p>The <code>n</code> position indicates where the mask should be placed:</p>
<ul>
<li>0 =&gt; Relative to the forehead</li>
<li>1 =&gt; Relative to the eyes</li>
<li>2 =&gt; Relative to the mouth</li>
<li>3 =&gt; Relative to the chin</li>
</ul>
<p>The <code>x</code>, <code>y</code> and <code>zoom</code> parameters further refine the position relative to the chosen facial feature. </p>
<p>Note that these coordinates are only used to provide a default position when <a href="#attached-stickers">attaching stickers to media</a>, by locally running facial recognition software and placing the mask sticker at the appropriate coordinates relative to the chosen facial feature.<br>
The final sticker position can be modified by the user before generating a new photo/video with the sticker baked-in.<br>
The final coordinates will not be sent along with the attached media, as they are only used as a suggested default position when placing the sticker. </p>
<p>The default coordinates are chosen by the stickerset creator when <a href="#creating-stickersets">uploading the sticker</a>.</p></div>
</div>
</div>
</div>
<div class="footer_wrap">
<div class="footer_columns_wrap footer_desktop">
<div class="footer_column footer_column_telegram">
<h5>Telegram</h5>
<div class="footer_telegram_description"></div>
Telegram is a cloud-based mobile and desktop messaging app with a focus on security and speed.
</div>
<div class="footer_column">
<h5><a href="//telegram.org/faq">About</a></h5>
<ul>
<li><a href="//telegram.org/faq">FAQ</a></li>
<li><a href="//telegram.org/privacy">Privacy</a></li>
<li><a href="//telegram.org/press">Press</a></li>
</ul>
</div>
<div class="footer_column">
<h5><a href="//telegram.org/apps#mobile-apps">Mobile Apps</a></h5>
<ul>
<li><a href="//telegram.org/dl/ios">iPhone/iPad</a></li>
<li><a href="//telegram.org/android">Android</a></li>
<li><a href="//telegram.org/dl/web">Mobile Web</a></li>
</ul>
</div>
<div class="footer_column">
<h5><a href="//telegram.org/apps#desktop-apps">Desktop Apps</a></h5>
<ul>
<li><a href="//desktop.telegram.org/">PC/Mac/Linux</a></li>
<li><a href="//macos.telegram.org/">macOS</a></li>
<li><a href="//telegram.org/dl/web">Web-browser</a></li>
</ul>
</div>
<div class="footer_column footer_column_platform">
<h5><a href="/">Platform</a></h5>
<ul>
<li><a href="/api">API</a></li>
<li><a href="//translations.telegram.org/">Translations</a></li>
<li><a href="//instantview.telegram.org/">Instant View</a></li>
</ul>
</div>
</div>
<div class="footer_columns_wrap footer_mobile">
<div class="footer_column">
<h5><a href="//telegram.org/faq">About</a></h5>
</div>
<div class="footer_column">
<h5><a href="//telegram.org/blog">Blog</a></h5>
</div>
<div class="footer_column">
<h5><a href="//telegram.org/apps">Apps</a></h5>
</div>
<div class="footer_column">
<h5><a href="/">Platform</a></h5>
</div>
<div class="footer_column">
<h5><a href="https://twitter.com/telegram" target="_blank" data-track="Follow/Twitter" onclick="trackDlClick(this, event)">Twitter</a></h5>
</div>
</div>
</div>
</div>
<script src="/js/main.js?47"></script>
<script src="/js/jquery.min.js?1"></script>
<script src="/js/bootstrap.min.js?1"></script>
<script>window.initDevPageNav&&initDevPageNav();
backToTopInit("Go up");
removePreloadInit();
</script>
</body>
</html>