telegram-crawler/data/web/core.telegram.org/api/effects.html
2024-09-23 18:02:35 +00:00

159 lines
16 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. 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>Animated message effects</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="Telegram allows adding spectacular animated effects to messages you send.">
<meta property="og:title" content="Animated message effects">
<meta property="og:image" content="">
<meta property="og:description" content="Telegram allows adding spectacular animated effects to messages you send.">
<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?241" 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/effects" >Animated message effects</a></li></ul></div>
<h1 id="dev_page_title">Animated message effects</h1>
<div id="dev_page_content"><!-- scroll_nav -->
<p>Telegram allows adding spectacular <strong>animated effects</strong> to messages you send in 1-on-1 chats. </p>
<pre><code><a href='/constructor/availableEffect'>availableEffect</a>#93c3e27e flags:<a href='/type/%23'>#</a> premium_required:flags.2?<a href='/constructor/true'>true</a> id:<a href='/type/long'>long</a> emoticon:<a href='/type/string'>string</a> static_icon_id:flags.0?<a href='/type/long'>long</a> effect_sticker_id:<a href='/type/long'>long</a> effect_animation_id:flags.1?<a href='/type/long'>long</a> = <a href='/type/AvailableEffect'>AvailableEffect</a>;
<a href='/constructor/messages.availableEffectsNotModified'>messages.availableEffectsNotModified</a>#d1ed9a5b = <a href='/type/messages.AvailableEffects'>messages.AvailableEffects</a>;
<a href='/constructor/messages.availableEffects'>messages.availableEffects</a>#bddb616e hash:<a href='/type/int'>int</a> effects:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/AvailableEffect'>AvailableEffect</a>&gt; documents:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/Document'>Document</a>&gt; = <a href='/type/messages.AvailableEffects'>messages.AvailableEffects</a>;
<a href='/constructor/message'>message</a>#94345242 flags:<a href='/type/%23'>#</a> out:flags.1?<a href='/constructor/true'>true</a> mentioned:flags.4?<a href='/constructor/true'>true</a> media_unread:flags.5?<a href='/constructor/true'>true</a> silent:flags.13?<a href='/constructor/true'>true</a> post:flags.14?<a href='/constructor/true'>true</a> from_scheduled:flags.18?<a href='/constructor/true'>true</a> legacy:flags.19?<a href='/constructor/true'>true</a> edit_hide:flags.21?<a href='/constructor/true'>true</a> pinned:flags.24?<a href='/constructor/true'>true</a> noforwards:flags.26?<a href='/constructor/true'>true</a> invert_media:flags.27?<a href='/constructor/true'>true</a> flags2:<a href='/type/%23'>#</a> offline:flags2.1?<a href='/constructor/true'>true</a> id:<a href='/type/int'>int</a> from_id:flags.8?<a href='/type/Peer'>Peer</a> from_boosts_applied:flags.29?<a href='/type/int'>int</a> peer_id:<a href='/type/Peer'>Peer</a> saved_peer_id:flags.28?<a href='/type/Peer'>Peer</a> fwd_from:flags.2?<a href='/type/MessageFwdHeader'>MessageFwdHeader</a> via_bot_id:flags.11?<a href='/type/long'>long</a> via_business_bot_id:flags2.0?<a href='/type/long'>long</a> reply_to:flags.3?<a href='/type/MessageReplyHeader'>MessageReplyHeader</a> date:<a href='/type/int'>int</a> message:<a href='/type/string'>string</a> media:flags.9?<a href='/type/MessageMedia'>MessageMedia</a> reply_markup:flags.6?<a href='/type/ReplyMarkup'>ReplyMarkup</a> entities:flags.7?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/MessageEntity'>MessageEntity</a>&gt; views:flags.10?<a href='/type/int'>int</a> forwards:flags.10?<a href='/type/int'>int</a> replies:flags.23?<a href='/type/MessageReplies'>MessageReplies</a> edit_date:flags.15?<a href='/type/int'>int</a> post_author:flags.16?<a href='/type/string'>string</a> grouped_id:flags.17?<a href='/type/long'>long</a> reactions:flags.20?<a href='/type/MessageReactions'>MessageReactions</a> restriction_reason:flags.22?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/RestrictionReason'>RestrictionReason</a>&gt; ttl_period:flags.25?<a href='/type/int'>int</a> quick_reply_shortcut_id:flags.30?<a href='/type/int'>int</a> effect:flags2.2?<a href='/type/long'>long</a> factcheck:flags2.3?<a href='/type/FactCheck'>FactCheck</a> = <a href='/type/Message'>Message</a>;
<a href='/constructor/draftMessage'>draftMessage</a>#2d65321f flags:<a href='/type/%23'>#</a> no_webpage:flags.1?<a href='/constructor/true'>true</a> invert_media:flags.6?<a href='/constructor/true'>true</a> reply_to:flags.4?<a href='/type/InputReplyTo'>InputReplyTo</a> message:<a href='/type/string'>string</a> entities:flags.3?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/MessageEntity'>MessageEntity</a>&gt; media:flags.5?<a href='/type/InputMedia'>InputMedia</a> date:<a href='/type/int'>int</a> effect:flags.7?<a href='/type/long'>long</a> = <a href='/type/DraftMessage'>DraftMessage</a>;
---functions---
<a href='/method/messages.getAvailableEffects'>messages.getAvailableEffects</a>#dea20a39 hash:<a href='/type/int'>int</a> = <a href='/type/messages.AvailableEffects'>messages.AvailableEffects</a>;
<a href='/method/messages.sendMessage'>messages.sendMessage</a>#983f9745 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> quick_reply_shortcut:flags.17?<a href='/type/InputQuickReplyShortcut'>InputQuickReplyShortcut</a> effect:flags.18?<a href='/type/long'>long</a> = <a href='/type/Updates'>Updates</a>;
<a href='/method/messages.sendMedia'>messages.sendMedia</a>#7852834e 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> quick_reply_shortcut:flags.17?<a href='/type/InputQuickReplyShortcut'>InputQuickReplyShortcut</a> effect:flags.18?<a href='/type/long'>long</a> = <a href='/type/Updates'>Updates</a>;
<a href='/method/messages.sendMultiMedia'>messages.sendMultiMedia</a>#37b74355 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> quick_reply_shortcut:flags.17?<a href='/type/InputQuickReplyShortcut'>InputQuickReplyShortcut</a> effect:flags.18?<a href='/type/long'>long</a> = <a href='/type/Updates'>Updates</a>;
<a href='/method/messages.saveDraft'>messages.saveDraft</a>#d372c5ce flags:<a href='/type/%23'>#</a> no_webpage:flags.1?<a href='/constructor/true'>true</a> invert_media:flags.6?<a href='/constructor/true'>true</a> reply_to:flags.4?<a href='/type/InputReplyTo'>InputReplyTo</a> peer:<a href='/type/InputPeer'>InputPeer</a> message:<a href='/type/string'>string</a> entities:flags.3?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/MessageEntity'>MessageEntity</a>&gt; media:flags.5?<a href='/type/InputMedia'>InputMedia</a> effect:flags.7?<a href='/type/long'>long</a> = <a href='/type/Bool'>Bool</a>;</code></pre>
<p>Use <a href="/method/messages.getAvailableEffects">messages.getAvailableEffects</a> to fetch the full list of message effects that may be used. </p>
<p>Clients should re-invoke the method (re-using the <code>hash</code> returned from the previous method call) to check for updates in the effects list at most once an hour (or if a <a href="/constructor/message">message</a> with an unknown <code>effect</code> is received). </p>
<p>Info about each effect is stored in the <a href="/constructor/availableEffect">availableEffect</a> constructor, identified by its <code>id</code> field: this ID should then be passed to the <code>effect</code> field of <a href="/method/messages.sendMessage">messages.sendMessage</a>, <a href="/method/messages.sendMedia">messages.sendMedia</a>, <a href="/method/messages.sendMultiMedia">messages.sendMultiMedia</a> to attach the effect to the <a href="/constructor/message">message</a>, in the <code>effect</code> field. </p>
<p>All <code>long</code> IDs of <a href="/constructor/availableEffect">availableEffect</a> except for <code>id</code> are <a href="/constructor/document">document</a>.<code>id</code>s from the containing <a href="/constructor/messages.availableEffects">messages.availableEffects</a> constructor. </p>
<p>Each effect has the following info, described by the fields of <a href="/constructor/availableEffect">availableEffect</a> as follows:</p>
<ul>
<li>Emoji: specified in <code>emoticon</code>, used to quickly search for effects. </li>
<li>Preview icon: the webp image from <code>static_icon_id</code> if set, otherwise the emoji specified in <code>emoticon</code>.<br>
Shown in the right bottom corner of the preview animation as a quick way for the user to classify effects.
Must also be shown in messages with this effect, near the message date: clicking on this icon should re-trigger the effect. </li>
<li>Preview animation: the <a href="/api/stickers#animated-stickers">animated sticker</a> specified in <code>effect_sticker_id</code>.<br>
Used for the effect selection menu. </li>
<li>Effect animation: a different <a href="/api/stickers#animated-stickers">animated sticker</a>, specified either by <code>effect_animation_id</code> (if set) or by the <a href="/api/stickers#premium-animated-sticker-effects">premium animated sticker effect</a> associated to the animated sticker specified in <code>effect_sticker_id</code> (always different from the animated sticker itself, fetched thanks to the <a href="/constructor/videoSize">videoSize</a> of type <code>f</code> as specified <a href="/api/stickers#premium-animated-sticker-effects">here »</a>).<br>
The effect animation should be only played once, when first receiving or sending the message.<br>
Clicking on the preview icon near the message date should re-trigger the effect.</li>
</ul></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="//telegram.org/press">Press</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>