<p>Custom emojis are a special kind of <ahref="/api/entities">entity»</a>, containing just a <code>document_id</code>, which can be passed to <ahref="/method/messages.getCustomEmojiDocuments">messages.getCustomEmojiDocuments</a> to fetch the <ahref="/api/stickers">static, animated or video sticker emoji</a> that should be displayed to the user as described in the <ahref="/api/stickers">stickers documentation</a>. </p>
<p>Custom emoji documents will contain <ahref="/constructor/documentAttributeCustomEmoji">documentAttributeCustomEmoji</a> attribute instead of a <ahref="/constructor/documentAttributeSticker">documentAttributeSticker</a>, containing information on the associated emoji (<code>alt</code>), whether the emoji can be used by non-premium users (<code>free</code>) and the associated <code>stickerset</code>.<br>
If the <ahref="/constructor/documentAttributeCustomEmoji">documentAttributeCustomEmoji</a>.<code>text_color</code> flag is set, the color of this TGS custom emoji should be changed to the text color when used in messages, the accent color if used as emoji status, white on chat photos, or another appropriate color based on context.</p>
<p>Note that when sending messages with attached custom emojis, the <ahref="/constructor/messageEntityCustomEmoji">messageEntityCustomEmoji</a><ahref="/api/entities">entity»</a> must wrap exactly one regular emoji (the one contained in <ahref="/constructor/documentAttributeCustomEmoji">documentAttributeCustomEmoji</a>.<code>alt</code>) in the related text, otherwise the server will ignore it. </p>
<p>Like stickers, custom emojis are organized in <ahref="/api/stickers#stickersets">stickersets</a>: see the <ahref="/api/stickers">stickers documentation»</a> for more info on how to work with them.</p>
<p>To send a message with one or more custom emojis, create and attach <ahref="/constructor/messageEntityCustomEmoji">messageEntityCustomEmoji</a><ahref="/api/entities">entities»</a> to a message.<br>
Note that you can attach a maximum of <code>message_animated_emoji_max</code> custom emojis, as specified by the <ahref="/api/config#message-animated-emoji-max">appConfig field»</a>. </p>
<p>The custom emoji selection UI should offer a list of categories to quickly filter results by a (list of) emojis, or by some other criteria, see <ahref="/api/emoji-categories">here»</a> for more info. </p>
<p>First of all, invoke <ahref="/method/messages.getEmojiKeywordsLanguages">messages.getEmojiKeywordsLanguages</a> to obtain a list of languages that must be used when fetching emoji keyword lists: usually the method will return the passed language codes (if localized) + <code>en</code> + some language codes for similar languages (if applicable).<br>
Then, invoke <ahref="/method/messages.getEmojiKeywords">messages.getEmojiKeywords</a> for all the returned language codes to fetch localized lists of keywords, associated to UTF-8 emojis. </p>
<p>Use the returned keywords to allow users to search both emojis and custom emojis by keyword, by displaying both the UTF-8 emojis associated to the keyword and the custom emojis associated to those UTF-8 emojis. </p>
<p>Invoke <ahref="/method/messages.getEmojiKeywordsDifference">messages.getEmojiKeywordsDifference</a> regularly to fetch updates to locally stored keyword lists for all languages. </p>
<p><ahref="/method/messages.getEmojiURL">messages.getEmojiURL</a> may be used to fetch an HTTP URL which can be used to automatically log in into translation platform and suggest new emoji keywords: the URL will be valid for 30 seconds after generation. </p>
<p>Additionally, custom emojis and non-mask stickers may also have a set of <em>custom</em> keywords, returned in the <ahref="/api/stickers#stickersets">custom emoji stickerset information</a>: </p>