mirror of
https://github.com/MarshalX/telegram-crawler.git
synced 2024-12-13 02:11:00 +01:00
11349 lines
417 KiB
HTML
11349 lines
417 KiB
HTML
<!DOCTYPE html>
|
|
<html class="">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Telegram Bot API</title>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<meta property="description" content="The Bot API is an HTTP-based interface created for developers keen on building bots for Telegram.
|
|
To learn how to create…">
|
|
<meta property="og:title" content="Telegram Bot API">
|
|
<meta property="og:image" content="30f729d4f304e41659">
|
|
<meta property="og:description" content="The Bot API is an HTTP-based interface created for developers keen on building bots for Telegram.
|
|
To learn how to create…">
|
|
<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=""><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="/bots" >Telegram Bots</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/bots/api" >Telegram Bot API</a></li></ul></div>
|
|
<h1 id="dev_page_title">Telegram Bot API</h1>
|
|
|
|
<div id="dev_page_content"><!-- scroll_nav -->
|
|
|
|
<blockquote>
|
|
<p>The Bot API is an HTTP-based interface created for developers keen on building bots for Telegram.<br>To learn how to create and set up a bot, please consult our <a href="/bots"><strong>Introduction to Bots</strong></a> and <a href="/bots/faq"><strong>Bot FAQ</strong></a>.</p>
|
|
</blockquote>
|
|
<h3><a class="anchor" name="recent-changes" href="#recent-changes"><i class="anchor-icon"></i></a>Recent changes</h3>
|
|
<blockquote>
|
|
<p>Subscribe to <a href="https://t.me/botnews">@BotNews</a> to be the first to know about the latest updates and join the discussion in <a href="https://t.me/bottalk">@BotTalk</a></p>
|
|
</blockquote>
|
|
<h4><a class="anchor" name="april-21-2023" href="#april-21-2023"><i class="anchor-icon"></i></a>April 21, 2023</h4>
|
|
<p><strong>Bot API 6.7</strong></p>
|
|
<ul>
|
|
<li>Added support for launching <a href="/bots/webapps">Web Apps</a> from inline query results by replacing the parameters <em>switch_pm_text</em> and <em>switch_pm_parameter</em> of the method <a href="#answerinlinequery">answerInlineQuery</a> with the parameter <em>button</em> of type <a href="#inlinequeryresultsbutton">InlineQueryResultsButton</a>.</li>
|
|
<li>Added the field <em>web_app_name</em> to the class <a href="#writeaccessallowed">WriteAccessAllowed</a>.</li>
|
|
<li>Added the field <em>switch_inline_query_chosen_chat</em> of the type <a href="#switchinlinequerychosenchat">SwitchInlineQueryChosenChat</a> to the class <a href="#inlinekeyboardbutton">InlineKeyboardButton</a>, which allows bots to switch to inline mode in a chosen chat of the given type.</li>
|
|
<li>Added the field <em>via_chat_folder_invite_link</em> to the class <a href="#chatmemberupdated">ChatMemberUpdated</a>.</li>
|
|
<li>Added the ability to set different bot names for different user languages using the method <a href="#setmyname">setMyName</a>.</li>
|
|
<li>Added the ability to get the current bot name in the given language as the class <a href="#botname">BotName</a> using the method <a href="#getmyname">getMyName</a>.</li>
|
|
<li>Added the ability to change bot settings from the bot's profile in official Telegram apps, including the ability to set animated profile photos.</li>
|
|
<li>Added the ability to specify custom emoji entities using <a href="#html-style">HTML</a> and <a href="#markdownv2-style">MarkdownV2</a> formatting options for bots that purchased additional usernames on <a href="https://fragment.com">Fragment</a>.</li>
|
|
</ul>
|
|
<h4><a class="anchor" name="march-9-2023" href="#march-9-2023"><i class="anchor-icon"></i></a>March 9, 2023</h4>
|
|
<p><strong>Bot API 6.6</strong></p>
|
|
<ul>
|
|
<li>Added the ability to set different bot descriptions for different user languages using the method <a href="#setmydescription">setMyDescription</a>.</li>
|
|
<li>Added the ability to get the current bot description in the given language as the class <a href="#botdescription">BotDescription</a> using the method <a href="#getmydescription">getMyDescription</a>.</li>
|
|
<li>Added the ability to set different bot short descriptions for different user languages using the method <a href="#setmyshortdescription">setMyShortDescription</a>.</li>
|
|
<li>Added the ability to get the current bot short description in the given language as the class <a href="#botshortdescription">BotShortDescription</a> using the method <a href="#getmyshortdescription">getMyShortDescription</a>.</li>
|
|
<li>Added the parameter <em>emoji</em> to the method <a href="#sendsticker">sendSticker</a> to specify an emoji for just uploaded stickers.</li>
|
|
<li>Added support for the creation of custom emoji sticker sets in <a href="#createnewstickerset">createNewStickerSet</a>.</li>
|
|
<li>Added the parameter <em>needs_repainting</em> to the method <a href="#createnewstickerset">createNewStickerSet</a> to automatically change the color of emoji based on context (e.g., use text color in messages, accent color in statuses, etc.).</li>
|
|
<li>Added the field <em>needs_repainting</em> to the class <a href="#sticker">Sticker</a>.</li>
|
|
<li>Replaced the parameters <em>png_sticker</em>, <em>tgs_sticker</em>, <em>webm_sticker</em>, <em>emojis</em> and <em>mask_position</em> in the method <a href="#addstickertoset">addStickerToSet</a> with the parameter <em>sticker</em> of the type <a href="#inputsticker">InputSticker</a>.</li>
|
|
<li>Added support for the creation of sticker sets with multiple initial stickers in <a href="#createnewstickerset">createNewStickerSet</a> by replacing the parameters <em>png_sticker</em>, <em>tgs_sticker</em>, <em>webm_sticker</em>, <em>emojis</em> and <em>mask_position</em> with the parameters <em>stickers</em> and <em>sticker_format</em>.</li>
|
|
<li>Added support for .WEBP files in <a href="#createnewstickerset">createNewStickerSet</a> and <a href="#addstickertoset">addStickerToSet</a>.</li>
|
|
<li>Added support for .WEBP, .TGS, and .WEBM files in <a href="#uploadstickerfile">uploadStickerFile</a> by replacing the parameter <em>png_sticker</em> in the method <a href="#uploadstickerfile">uploadStickerFile</a> with the parameters <em>sticker</em> and <em>sticker_format</em>.</li>
|
|
<li>Added the ability to specify search keywords for stickers added to sticker sets.</li>
|
|
<li>Added the method <a href="#setcustomemojistickersetthumbnail">setCustomEmojiStickerSetThumbnail</a> for editing the thumbnail of custom emoji sticker sets created by the bot.</li>
|
|
<li>Added the method <a href="#setstickersettitle">setStickerSetTitle</a> for editing the title of sticker sets created by the bot.</li>
|
|
<li>Added the method <a href="#deletestickerset">deleteStickerSet</a> for complete deletion of a given sticker set that was created by the bot.</li>
|
|
<li>Added the method <a href="#setstickeremojilist">setStickerEmojiList</a> for changing the list of emoji associated with a sticker.</li>
|
|
<li>Added the method <a href="#setstickerkeywords">setStickerKeywords</a> for changing the search keywords assigned to a sticker.</li>
|
|
<li>Added the method <a href="#setstickermaskposition">setStickerMaskPosition</a> for changing the <a href="#maskposition">mask position</a> of a mask sticker.</li>
|
|
<li>Renamed the field <em>thumb</em> in the classes <a href="#animation">Animation</a>, <a href="#audio">Audio</a>, <a href="#document">Document</a>, <a href="#sticker">Sticker</a>, <a href="#video">Video</a>, <a href="#videonote">VideoNote</a>, <a href="#inputmediaanimation">InputMediaAnimation</a>, <a href="#inputmediaaudio">InputMediaAudio</a>, <a href="#inputmediadocument">InputMediaDocument</a>, <a href="#inputmediavideo">InputMediaVideo</a>, <a href="#stickerset">StickerSet</a> to <em>thumbnail</em>.</li>
|
|
<li>Renamed the parameter <em>thumb</em> in the methods <a href="#sendanimation">sendAnimation</a>, <a href="#sendaudio">sendAudio</a>, <a href="#senddocument">sendDocument</a>, <a href="#sendvideo">sendVideo</a>, <a href="#sendvideonote">sendVideoNote</a> to <em>thumbnail</em>.</li>
|
|
<li>Renamed the method <em>setStickerSetThumb</em> to <a href="#setstickersetthumbnail">setStickerSetThumbnail</a> and its parameter <em>thumb</em> to <em>thumbnail</em>.</li>
|
|
<li>Renamed the fields <em>thumb_url</em>, <em>thumb_width</em>, and <em>thumb_height</em> in the classes <a href="#inlinequeryresultarticle">InlineQueryResultArticle</a>, <a href="#inlinequeryresultcontact">InlineQueryResultContact</a>, <a href="#inlinequeryresultdocument">InlineQueryResultDocument</a>, <a href="#inlinequeryresultlocation">InlineQueryResultLocation</a>, and <a href="#inlinequeryresultvenue">InlineQueryResultVenue</a> to <em>thumbnail_url</em>, <em>thumbnail_width</em>, and <em>thumbnail_height</em> respectively.</li>
|
|
<li>Renamed the field <em>thumb_url</em> in the classes <a href="#inlinequeryresultphoto">InlineQueryResultPhoto</a> and <a href="#inlinequeryresultvideo">InlineQueryResultVideo</a> to <em>thumbnail_url</em>.</li>
|
|
<li>Renamed the fields <em>thumb_url</em> and <em>thumb_mime_type</em> in the classes <a href="#inlinequeryresultgif">InlineQueryResultGif</a>, and <a href="#inlinequeryresultmpeg4gif">InlineQueryResultMpeg4Gif</a> to <em>thumbnail_url</em> and <em>thumbnail_mime_type</em> respectively.</li>
|
|
</ul>
|
|
<h4><a class="anchor" name="february-3-2023" href="#february-3-2023"><i class="anchor-icon"></i></a>February 3, 2023</h4>
|
|
<p><strong>Bot API 6.5</strong></p>
|
|
<ul>
|
|
<li>Added <a href="https://telegram.org/blog/profile-pics-emoji-translations#chat-selection-for-bots">requests for users and chats</a> and support for <a href="https://telegram.org/blog/profile-pics-emoji-translations#granular-media-permissions">granular media permissions</a>.</li>
|
|
<li>Added the class <a href="#keyboardbuttonrequestuser">KeyboardButtonRequestUser</a> and the field <em>request_user</em> to the class <a href="#keyboardbutton">KeyboardButton</a>.</li>
|
|
<li>Added the class <a href="#keyboardbuttonrequestchat">KeyboardButtonRequestChat</a> and the field <em>request_chat</em> to the class <a href="#keyboardbutton">KeyboardButton</a>.</li>
|
|
<li>Added the classes <a href="#usershared">UserShared</a>, <a href="#chatshared">ChatShared</a> and the fields <em>user_shared</em>, and <em>chat_shared</em> to the class <a href="#message">Message</a>.</li>
|
|
<li>Replaced the fields <em>can_send_media_messages</em> in the classes <a href="#chatmemberrestricted">ChatMemberRestricted</a> and <a href="#chatpermissions">ChatPermissions</a> with separate fields <em>can_send_audios</em>, <em>can_send_documents</em>, <em>can_send_photos</em>, <em>can_send_videos</em>, <em>can_send_video_notes</em>, and <em>can_send_voice_notes</em> for different media types.</li>
|
|
<li>Added the parameter <em>use_independent_chat_permissions</em> to the methods <a href="#restrictchatmember">restrictChatMember</a> and <a href="#setchatpermissions">setChatPermissions</a>.</li>
|
|
<li>Added the field <em>user_chat_id</em> to the class <a href="#chatjoinrequest">ChatJoinRequest</a>.</li>
|
|
</ul>
|
|
<p><strong><a href="/bots/api-changelog">See earlier changes »</a></strong></p>
|
|
<h3><a class="anchor" name="authorizing-your-bot" href="#authorizing-your-bot"><i class="anchor-icon"></i></a>Authorizing your bot</h3>
|
|
<p>Each bot is given a unique authentication token <a href="/bots/features#botfather">when it is created</a>. The token looks something like <code>123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11</code>, but we'll use simply <strong><token></strong> in this document instead. You can learn about obtaining tokens and generating new ones in <a href="/bots/features#botfather">this document</a>.</p>
|
|
<h3><a class="anchor" name="making-requests" href="#making-requests"><i class="anchor-icon"></i></a>Making requests</h3>
|
|
<p>All queries to the Telegram Bot API must be served over HTTPS and need to be presented in this form: <code>https://api.telegram.org/bot<token>/METHOD_NAME</code>. Like this for example:</p>
|
|
<pre><code>https://api.telegram.org/bot123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11/getMe</code></pre>
|
|
<p>We support <strong>GET</strong> and <strong>POST</strong> HTTP methods. We support four ways of passing parameters in Bot API requests:</p>
|
|
<ul>
|
|
<li><a href="https://en.wikipedia.org/wiki/Query_string">URL query string</a></li>
|
|
<li>application/x-www-form-urlencoded</li>
|
|
<li>application/json (except for uploading files)</li>
|
|
<li>multipart/form-data (use to upload files)</li>
|
|
</ul>
|
|
<p>The response contains a JSON object, which always has a Boolean field 'ok' and may have an optional String field 'description' with a human-readable description of the result. If 'ok' equals <em>True</em>, the request was successful and the result of the query can be found in the 'result' field. In case of an unsuccessful request, 'ok' equals false and the error is explained in the 'description'. An Integer 'error_code' field is also returned, but its contents are subject to change in the future. Some errors may also have an optional field 'parameters' of the type <a href="#responseparameters">ResponseParameters</a>, which can help to automatically handle the error.</p>
|
|
<ul>
|
|
<li>All methods in the Bot API are case-insensitive.</li>
|
|
<li>All queries must be made using UTF-8.</li>
|
|
</ul>
|
|
<h4><a class="anchor" name="making-requests-when-getting-updates" href="#making-requests-when-getting-updates"><i class="anchor-icon"></i></a>Making requests when getting updates</h4>
|
|
<p>If you're using <a href="#getting-updates"><strong>webhooks</strong></a>, you can perform a request to the Bot API while sending an answer to the webhook. Use either <em>application/json</em> or <em>application/x-www-form-urlencoded</em> or <em>multipart/form-data</em> response content type for passing parameters. Specify the method to be invoked in the <em>method</em> parameter of the request. It's not possible to know that such a request was successful or get its result.</p>
|
|
<blockquote>
|
|
<p>Please see our <a href="/bots/faq#how-can-i-make-requests-in-response-to-updates">FAQ</a> for examples.</p>
|
|
</blockquote>
|
|
<h3><a class="anchor" name="using-a-local-bot-api-server" href="#using-a-local-bot-api-server"><i class="anchor-icon"></i></a>Using a Local Bot API Server</h3>
|
|
<p>The Bot API server source code is available at <a href="https://github.com/tdlib/telegram-bot-api">telegram-bot-api</a>. You can run it locally and send the requests to your own server instead of <code>https://api.telegram.org</code>. If you switch to a local Bot API server, your bot will be able to:</p>
|
|
<ul>
|
|
<li>Download files without a size limit.</li>
|
|
<li>Upload files up to 2000 MB.</li>
|
|
<li>Upload files using their local path and <a href="https://en.wikipedia.org/wiki/File_URI_scheme">the file URI scheme</a>.</li>
|
|
<li>Use an HTTP URL for the webhook.</li>
|
|
<li>Use any local IP address for the webhook.</li>
|
|
<li>Use any port for the webhook.</li>
|
|
<li>Set <em>max_webhook_connections</em> up to 100000.</li>
|
|
<li>Receive the absolute local path as a value of the <em>file_path</em> field without the need to download the file after a <a href="#getfile">getFile</a> request.</li>
|
|
</ul>
|
|
<h4><a class="anchor" name="do-i-need-a-local-bot-api-server" href="#do-i-need-a-local-bot-api-server"><i class="anchor-icon"></i></a>Do I need a Local Bot API Server</h4>
|
|
<p>The majority of bots will be OK with the default configuration, running on our servers. But if you feel that you need one of <a href="#using-a-local-bot-api-server">these features</a>, you're welcome to switch to your own at any time.</p>
|
|
<h3><a class="anchor" name="getting-updates" href="#getting-updates"><i class="anchor-icon"></i></a>Getting updates</h3>
|
|
<p>There are two mutually exclusive ways of receiving updates for your bot - the <a href="#getupdates">getUpdates</a> method on one hand and <a href="#setwebhook">webhooks</a> on the other. Incoming updates are stored on the server until the bot receives them either way, but they will not be kept longer than 24 hours.</p>
|
|
<p>Regardless of which option you choose, you will receive JSON-serialized <a href="#update">Update</a> objects as a result.</p>
|
|
<h4><a class="anchor" name="update" href="#update"><i class="anchor-icon"></i></a>Update</h4>
|
|
<p>This <a href="#available-types">object</a> represents an incoming update.<br>At most <strong>one</strong> of the optional parameters can be present in any given update.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>update_id</td>
|
|
<td>Integer</td>
|
|
<td>The update's unique identifier. Update identifiers start from a certain positive number and increase sequentially. This ID becomes especially handy if you're using <a href="#setwebhook">webhooks</a>, since it allows you to ignore repeated updates or to restore the correct update sequence, should they get out of order. If there are no new updates for at least a week, then identifier of the next update will be chosen randomly instead of sequentially.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>message</td>
|
|
<td><a href="#message">Message</a></td>
|
|
<td><em>Optional</em>. New incoming message of any kind - text, photo, sticker, etc.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>edited_message</td>
|
|
<td><a href="#message">Message</a></td>
|
|
<td><em>Optional</em>. New version of a message that is known to the bot and was edited</td>
|
|
</tr>
|
|
<tr>
|
|
<td>channel_post</td>
|
|
<td><a href="#message">Message</a></td>
|
|
<td><em>Optional</em>. New incoming channel post of any kind - text, photo, sticker, etc.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>edited_channel_post</td>
|
|
<td><a href="#message">Message</a></td>
|
|
<td><em>Optional</em>. New version of a channel post that is known to the bot and was edited</td>
|
|
</tr>
|
|
<tr>
|
|
<td>inline_query</td>
|
|
<td><a href="#inlinequery">InlineQuery</a></td>
|
|
<td><em>Optional</em>. New incoming <a href="#inline-mode">inline</a> query</td>
|
|
</tr>
|
|
<tr>
|
|
<td>chosen_inline_result</td>
|
|
<td><a href="#choseninlineresult">ChosenInlineResult</a></td>
|
|
<td><em>Optional</em>. The result of an <a href="#inline-mode">inline</a> query that was chosen by a user and sent to their chat partner. Please see our documentation on the <a href="/bots/inline#collecting-feedback">feedback collecting</a> for details on how to enable these updates for your bot.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>callback_query</td>
|
|
<td><a href="#callbackquery">CallbackQuery</a></td>
|
|
<td><em>Optional</em>. New incoming callback query</td>
|
|
</tr>
|
|
<tr>
|
|
<td>shipping_query</td>
|
|
<td><a href="#shippingquery">ShippingQuery</a></td>
|
|
<td><em>Optional</em>. New incoming shipping query. Only for invoices with flexible price</td>
|
|
</tr>
|
|
<tr>
|
|
<td>pre_checkout_query</td>
|
|
<td><a href="#precheckoutquery">PreCheckoutQuery</a></td>
|
|
<td><em>Optional</em>. New incoming pre-checkout query. Contains full information about checkout</td>
|
|
</tr>
|
|
<tr>
|
|
<td>poll</td>
|
|
<td><a href="#poll">Poll</a></td>
|
|
<td><em>Optional</em>. New poll state. Bots receive only updates about stopped polls and polls, which are sent by the bot</td>
|
|
</tr>
|
|
<tr>
|
|
<td>poll_answer</td>
|
|
<td><a href="#pollanswer">PollAnswer</a></td>
|
|
<td><em>Optional</em>. A user changed their answer in a non-anonymous poll. Bots receive new votes only in polls that were sent by the bot itself.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>my_chat_member</td>
|
|
<td><a href="#chatmemberupdated">ChatMemberUpdated</a></td>
|
|
<td><em>Optional</em>. The bot's chat member status was updated in a chat. For private chats, this update is received only when the bot is blocked or unblocked by the user.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>chat_member</td>
|
|
<td><a href="#chatmemberupdated">ChatMemberUpdated</a></td>
|
|
<td><em>Optional</em>. A chat member's status was updated in a chat. The bot must be an administrator in the chat and must explicitly specify “chat_member” in the list of <em>allowed_updates</em> to receive these updates.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>chat_join_request</td>
|
|
<td><a href="#chatjoinrequest">ChatJoinRequest</a></td>
|
|
<td><em>Optional</em>. A request to join the chat has been sent. The bot must have the <em>can_invite_users</em> administrator right in the chat to receive these updates.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="getupdates" href="#getupdates"><i class="anchor-icon"></i></a>getUpdates</h4>
|
|
<p>Use this method to receive incoming updates using long polling (<a href="https://en.wikipedia.org/wiki/Push_technology#Long_polling">wiki</a>). Returns an Array of <a href="#update">Update</a> objects.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>offset</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>Identifier of the first update to be returned. Must be greater by one than the highest among the identifiers of previously received updates. By default, updates starting with the earliest unconfirmed update are returned. An update is considered confirmed as soon as <a href="#getupdates">getUpdates</a> is called with an <em>offset</em> higher than its <em>update_id</em>. The negative offset can be specified to retrieve updates starting from <em>-offset</em> update from the end of the updates queue. All previous updates will be forgotten.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>limit</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>Limits the number of updates to be retrieved. Values between 1-100 are accepted. Defaults to 100.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>timeout</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>Timeout in seconds for long polling. Defaults to 0, i.e. usual short polling. Should be positive, short polling should be used for testing purposes only.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>allowed_updates</td>
|
|
<td>Array of String</td>
|
|
<td>Optional</td>
|
|
<td>A JSON-serialized list of the update types you want your bot to receive. For example, specify [“message”, “edited_channel_post”, “callback_query”] to only receive updates of these types. See <a href="#update">Update</a> for a complete list of available update types. Specify an empty list to receive all update types except <em>chat_member</em> (default). If not specified, the previous setting will be used.<br><br>Please note that this parameter doesn't affect updates created before the call to the getUpdates, so unwanted updates may be received for a short period of time.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<blockquote>
|
|
<p><strong>Notes</strong><br><strong>1.</strong> This method will not work if an outgoing webhook is set up.<br><strong>2.</strong> In order to avoid getting duplicate updates, recalculate <em>offset</em> after each server response.</p>
|
|
</blockquote>
|
|
<h4><a class="anchor" name="setwebhook" href="#setwebhook"><i class="anchor-icon"></i></a>setWebhook</h4>
|
|
<p>Use this method to specify a URL and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified URL, containing a JSON-serialized <a href="#update">Update</a>. In case of an unsuccessful request, we will give up after a reasonable amount of attempts. Returns <em>True</em> on success.</p>
|
|
<p>If you'd like to make sure that the webhook was set by you, you can specify secret data in the parameter <em>secret_token</em>. If specified, the request will contain a header “X-Telegram-Bot-Api-Secret-Token” with the secret token as content.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>url</td>
|
|
<td>String</td>
|
|
<td>Yes</td>
|
|
<td>HTTPS URL to send updates to. Use an empty string to remove webhook integration</td>
|
|
</tr>
|
|
<tr>
|
|
<td>certificate</td>
|
|
<td><a href="#inputfile">InputFile</a></td>
|
|
<td>Optional</td>
|
|
<td>Upload your public key certificate so that the root certificate in use can be checked. See our <a href="/bots/self-signed">self-signed guide</a> for details.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>ip_address</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>The fixed IP address which will be used to send webhook requests instead of the IP address resolved through DNS</td>
|
|
</tr>
|
|
<tr>
|
|
<td>max_connections</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>The maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery, 1-100. Defaults to <em>40</em>. Use lower values to limit the load on your bot's server, and higher values to increase your bot's throughput.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>allowed_updates</td>
|
|
<td>Array of String</td>
|
|
<td>Optional</td>
|
|
<td>A JSON-serialized list of the update types you want your bot to receive. For example, specify [“message”, “edited_channel_post”, “callback_query”] to only receive updates of these types. See <a href="#update">Update</a> for a complete list of available update types. Specify an empty list to receive all update types except <em>chat_member</em> (default). If not specified, the previous setting will be used.<br>Please note that this parameter doesn't affect updates created before the call to the setWebhook, so unwanted updates may be received for a short period of time.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>drop_pending_updates</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Pass <em>True</em> to drop all pending updates</td>
|
|
</tr>
|
|
<tr>
|
|
<td>secret_token</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>A secret token to be sent in a header “X-Telegram-Bot-Api-Secret-Token” in every webhook request, 1-256 characters. Only characters <code>A-Z</code>, <code>a-z</code>, <code>0-9</code>, <code>_</code> and <code>-</code> are allowed. The header is useful to ensure that the request comes from a webhook set by you.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<blockquote>
|
|
<p><strong>Notes</strong><br><strong>1.</strong> You will not be able to receive updates using <a href="#getupdates">getUpdates</a> for as long as an outgoing webhook is set up.<br><strong>2.</strong> To use a self-signed certificate, you need to upload your <a href="/bots/self-signed">public key certificate</a> using <em>certificate</em> parameter. Please upload as InputFile, sending a String will not work.<br><strong>3.</strong> Ports currently supported <em>for webhooks</em>: <strong>443, 80, 88, 8443</strong>.</p>
|
|
<p>If you're having any trouble setting up webhooks, please check out this <a href="/bots/webhooks">amazing guide to webhooks</a>.</p>
|
|
</blockquote>
|
|
<h4><a class="anchor" name="deletewebhook" href="#deletewebhook"><i class="anchor-icon"></i></a>deleteWebhook</h4>
|
|
<p>Use this method to remove webhook integration if you decide to switch back to <a href="#getupdates">getUpdates</a>. Returns <em>True</em> on success.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>drop_pending_updates</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Pass <em>True</em> to drop all pending updates</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="getwebhookinfo" href="#getwebhookinfo"><i class="anchor-icon"></i></a>getWebhookInfo</h4>
|
|
<p>Use this method to get current webhook status. Requires no parameters. On success, returns a <a href="#webhookinfo">WebhookInfo</a> object. If the bot is using <a href="#getupdates">getUpdates</a>, will return an object with the <em>url</em> field empty.</p>
|
|
<h4><a class="anchor" name="webhookinfo" href="#webhookinfo"><i class="anchor-icon"></i></a>WebhookInfo</h4>
|
|
<p>Describes the current status of a webhook.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>url</td>
|
|
<td>String</td>
|
|
<td>Webhook URL, may be empty if webhook is not set up</td>
|
|
</tr>
|
|
<tr>
|
|
<td>has_custom_certificate</td>
|
|
<td>Boolean</td>
|
|
<td><em>True</em>, if a custom certificate was provided for webhook certificate checks</td>
|
|
</tr>
|
|
<tr>
|
|
<td>pending_update_count</td>
|
|
<td>Integer</td>
|
|
<td>Number of updates awaiting delivery</td>
|
|
</tr>
|
|
<tr>
|
|
<td>ip_address</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Currently used webhook IP address</td>
|
|
</tr>
|
|
<tr>
|
|
<td>last_error_date</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. Unix time for the most recent error that happened when trying to deliver an update via webhook</td>
|
|
</tr>
|
|
<tr>
|
|
<td>last_error_message</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Error message in human-readable format for the most recent error that happened when trying to deliver an update via webhook</td>
|
|
</tr>
|
|
<tr>
|
|
<td>last_synchronization_error_date</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. Unix time of the most recent error that happened when trying to synchronize available updates with Telegram datacenters</td>
|
|
</tr>
|
|
<tr>
|
|
<td>max_connections</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. The maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery</td>
|
|
</tr>
|
|
<tr>
|
|
<td>allowed_updates</td>
|
|
<td>Array of String</td>
|
|
<td><em>Optional</em>. A list of update types the bot is subscribed to. Defaults to all update types except <em>chat_member</em></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h3><a class="anchor" name="available-types" href="#available-types"><i class="anchor-icon"></i></a>Available types</h3>
|
|
<p>All types used in the Bot API responses are represented as JSON-objects.</p>
|
|
<p>It is safe to use 32-bit signed integers for storing all <strong>Integer</strong> fields unless otherwise noted.</p>
|
|
<blockquote>
|
|
<p><strong>Optional</strong> fields may be not returned when irrelevant.</p>
|
|
</blockquote>
|
|
<h4><a class="anchor" name="user" href="#user"><i class="anchor-icon"></i></a>User</h4>
|
|
<p>This object represents a Telegram user or bot.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>id</td>
|
|
<td>Integer</td>
|
|
<td>Unique identifier for this user or bot. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>is_bot</td>
|
|
<td>Boolean</td>
|
|
<td><em>True</em>, if this user is a bot</td>
|
|
</tr>
|
|
<tr>
|
|
<td>first_name</td>
|
|
<td>String</td>
|
|
<td>User's or bot's first name</td>
|
|
</tr>
|
|
<tr>
|
|
<td>last_name</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. User's or bot's last name</td>
|
|
</tr>
|
|
<tr>
|
|
<td>username</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. User's or bot's username</td>
|
|
</tr>
|
|
<tr>
|
|
<td>language_code</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. <a href="https://en.wikipedia.org/wiki/IETF_language_tag">IETF language tag</a> of the user's language</td>
|
|
</tr>
|
|
<tr>
|
|
<td>is_premium</td>
|
|
<td>True</td>
|
|
<td><em>Optional</em>. <em>True</em>, if this user is a Telegram Premium user</td>
|
|
</tr>
|
|
<tr>
|
|
<td>added_to_attachment_menu</td>
|
|
<td>True</td>
|
|
<td><em>Optional</em>. <em>True</em>, if this user added the bot to the attachment menu</td>
|
|
</tr>
|
|
<tr>
|
|
<td>can_join_groups</td>
|
|
<td>Boolean</td>
|
|
<td><em>Optional</em>. <em>True</em>, if the bot can be invited to groups. Returned only in <a href="#getme">getMe</a>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>can_read_all_group_messages</td>
|
|
<td>Boolean</td>
|
|
<td><em>Optional</em>. <em>True</em>, if <a href="/bots/features#privacy-mode">privacy mode</a> is disabled for the bot. Returned only in <a href="#getme">getMe</a>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>supports_inline_queries</td>
|
|
<td>Boolean</td>
|
|
<td><em>Optional</em>. <em>True</em>, if the bot supports inline queries. Returned only in <a href="#getme">getMe</a>.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="chat" href="#chat"><i class="anchor-icon"></i></a>Chat</h4>
|
|
<p>This object represents a chat.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>id</td>
|
|
<td>Integer</td>
|
|
<td>Unique identifier for this chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>type</td>
|
|
<td>String</td>
|
|
<td>Type of chat, can be either “private”, “group”, “supergroup” or “channel”</td>
|
|
</tr>
|
|
<tr>
|
|
<td>title</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Title, for supergroups, channels and group chats</td>
|
|
</tr>
|
|
<tr>
|
|
<td>username</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Username, for private chats, supergroups and channels if available</td>
|
|
</tr>
|
|
<tr>
|
|
<td>first_name</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. First name of the other party in a private chat</td>
|
|
</tr>
|
|
<tr>
|
|
<td>last_name</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Last name of the other party in a private chat</td>
|
|
</tr>
|
|
<tr>
|
|
<td>is_forum</td>
|
|
<td>True</td>
|
|
<td><em>Optional</em>. <em>True</em>, if the supergroup chat is a forum (has <a href="https://telegram.org/blog/topics-in-groups-collectible-usernames#topics-in-groups">topics</a> enabled)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>photo</td>
|
|
<td><a href="#chatphoto">ChatPhoto</a></td>
|
|
<td><em>Optional</em>. Chat photo. Returned only in <a href="#getchat">getChat</a>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>active_usernames</td>
|
|
<td>Array of String</td>
|
|
<td><em>Optional</em>. If non-empty, the list of all <a href="https://telegram.org/blog/topics-in-groups-collectible-usernames#collectible-usernames">active chat usernames</a>; for private chats, supergroups and channels. Returned only in <a href="#getchat">getChat</a>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>emoji_status_custom_emoji_id</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Custom emoji identifier of emoji status of the other party in a private chat. Returned only in <a href="#getchat">getChat</a>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>bio</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Bio of the other party in a private chat. Returned only in <a href="#getchat">getChat</a>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>has_private_forwards</td>
|
|
<td>True</td>
|
|
<td><em>Optional</em>. <em>True</em>, if privacy settings of the other party in the private chat allows to use <code>tg://user?id=<user_id></code> links only in chats with the user. Returned only in <a href="#getchat">getChat</a>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>has_restricted_voice_and_video_messages</td>
|
|
<td>True</td>
|
|
<td><em>Optional</em>. <em>True</em>, if the privacy settings of the other party restrict sending voice and video note messages in the private chat. Returned only in <a href="#getchat">getChat</a>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>join_to_send_messages</td>
|
|
<td>True</td>
|
|
<td><em>Optional</em>. <em>True</em>, if users need to join the supergroup before they can send messages. Returned only in <a href="#getchat">getChat</a>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>join_by_request</td>
|
|
<td>True</td>
|
|
<td><em>Optional</em>. <em>True</em>, if all users directly joining the supergroup need to be approved by supergroup administrators. Returned only in <a href="#getchat">getChat</a>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>description</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Description, for groups, supergroups and channel chats. Returned only in <a href="#getchat">getChat</a>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>invite_link</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Primary invite link, for groups, supergroups and channel chats. Returned only in <a href="#getchat">getChat</a>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>pinned_message</td>
|
|
<td><a href="#message">Message</a></td>
|
|
<td><em>Optional</em>. The most recent pinned message (by sending date). Returned only in <a href="#getchat">getChat</a>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>permissions</td>
|
|
<td><a href="#chatpermissions">ChatPermissions</a></td>
|
|
<td><em>Optional</em>. Default chat member permissions, for groups and supergroups. Returned only in <a href="#getchat">getChat</a>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>slow_mode_delay</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. For supergroups, the minimum allowed delay between consecutive messages sent by each unpriviledged user; in seconds. Returned only in <a href="#getchat">getChat</a>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>message_auto_delete_time</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. The time after which all messages sent to the chat will be automatically deleted; in seconds. Returned only in <a href="#getchat">getChat</a>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>has_aggressive_anti_spam_enabled</td>
|
|
<td>True</td>
|
|
<td><em>Optional</em>. <em>True</em>, if aggressive anti-spam checks are enabled in the supergroup. The field is only available to chat administrators. Returned only in <a href="#getchat">getChat</a>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>has_hidden_members</td>
|
|
<td>True</td>
|
|
<td><em>Optional</em>. <em>True</em>, if non-administrators can only get the list of bots and administrators in the chat. Returned only in <a href="#getchat">getChat</a>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>has_protected_content</td>
|
|
<td>True</td>
|
|
<td><em>Optional</em>. <em>True</em>, if messages from the chat can't be forwarded to other chats. Returned only in <a href="#getchat">getChat</a>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>sticker_set_name</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. For supergroups, name of group sticker set. Returned only in <a href="#getchat">getChat</a>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>can_set_sticker_set</td>
|
|
<td>True</td>
|
|
<td><em>Optional</em>. <em>True</em>, if the bot can change the group sticker set. Returned only in <a href="#getchat">getChat</a>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>linked_chat_id</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. This identifier may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier. Returned only in <a href="#getchat">getChat</a>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>location</td>
|
|
<td><a href="#chatlocation">ChatLocation</a></td>
|
|
<td><em>Optional</em>. For supergroups, the location to which the supergroup is connected. Returned only in <a href="#getchat">getChat</a>.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="message" href="#message"><i class="anchor-icon"></i></a>Message</h4>
|
|
<p>This object represents a message.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>message_id</td>
|
|
<td>Integer</td>
|
|
<td>Unique message identifier inside this chat</td>
|
|
</tr>
|
|
<tr>
|
|
<td>message_thread_id</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. Unique identifier of a message thread to which the message belongs; for supergroups only</td>
|
|
</tr>
|
|
<tr>
|
|
<td>from</td>
|
|
<td><a href="#user">User</a></td>
|
|
<td><em>Optional</em>. Sender of the message; empty for messages sent to channels. For backward compatibility, the field contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>sender_chat</td>
|
|
<td><a href="#chat">Chat</a></td>
|
|
<td><em>Optional</em>. Sender of the message, sent on behalf of a chat. For example, the channel itself for channel posts, the supergroup itself for messages from anonymous group administrators, the linked channel for messages automatically forwarded to the discussion group. For backward compatibility, the field <em>from</em> contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>date</td>
|
|
<td>Integer</td>
|
|
<td>Date the message was sent in Unix time</td>
|
|
</tr>
|
|
<tr>
|
|
<td>chat</td>
|
|
<td><a href="#chat">Chat</a></td>
|
|
<td>Conversation the message belongs to</td>
|
|
</tr>
|
|
<tr>
|
|
<td>forward_from</td>
|
|
<td><a href="#user">User</a></td>
|
|
<td><em>Optional</em>. For forwarded messages, sender of the original message</td>
|
|
</tr>
|
|
<tr>
|
|
<td>forward_from_chat</td>
|
|
<td><a href="#chat">Chat</a></td>
|
|
<td><em>Optional</em>. For messages forwarded from channels or from anonymous administrators, information about the original sender chat</td>
|
|
</tr>
|
|
<tr>
|
|
<td>forward_from_message_id</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. For messages forwarded from channels, identifier of the original message in the channel</td>
|
|
</tr>
|
|
<tr>
|
|
<td>forward_signature</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. For forwarded messages that were originally sent in channels or by an anonymous chat administrator, signature of the message sender if present</td>
|
|
</tr>
|
|
<tr>
|
|
<td>forward_sender_name</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Sender's name for messages forwarded from users who disallow adding a link to their account in forwarded messages</td>
|
|
</tr>
|
|
<tr>
|
|
<td>forward_date</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. For forwarded messages, date the original message was sent in Unix time</td>
|
|
</tr>
|
|
<tr>
|
|
<td>is_topic_message</td>
|
|
<td>True</td>
|
|
<td><em>Optional</em>. <em>True</em>, if the message is sent to a forum topic</td>
|
|
</tr>
|
|
<tr>
|
|
<td>is_automatic_forward</td>
|
|
<td>True</td>
|
|
<td><em>Optional</em>. <em>True</em>, if the message is a channel post that was automatically forwarded to the connected discussion group</td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply_to_message</td>
|
|
<td><a href="#message">Message</a></td>
|
|
<td><em>Optional</em>. For replies, the original message. Note that the Message object in this field will not contain further <em>reply_to_message</em> fields even if it itself is a reply.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>via_bot</td>
|
|
<td><a href="#user">User</a></td>
|
|
<td><em>Optional</em>. Bot through which the message was sent</td>
|
|
</tr>
|
|
<tr>
|
|
<td>edit_date</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. Date the message was last edited in Unix time</td>
|
|
</tr>
|
|
<tr>
|
|
<td>has_protected_content</td>
|
|
<td>True</td>
|
|
<td><em>Optional</em>. <em>True</em>, if the message can't be forwarded</td>
|
|
</tr>
|
|
<tr>
|
|
<td>media_group_id</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. The unique identifier of a media message group this message belongs to</td>
|
|
</tr>
|
|
<tr>
|
|
<td>author_signature</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Signature of the post author for messages in channels, or the custom title of an anonymous group administrator</td>
|
|
</tr>
|
|
<tr>
|
|
<td>text</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. For text messages, the actual UTF-8 text of the message</td>
|
|
</tr>
|
|
<tr>
|
|
<td>entities</td>
|
|
<td>Array of <a href="#messageentity">MessageEntity</a></td>
|
|
<td><em>Optional</em>. For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text</td>
|
|
</tr>
|
|
<tr>
|
|
<td>animation</td>
|
|
<td><a href="#animation">Animation</a></td>
|
|
<td><em>Optional</em>. Message is an animation, information about the animation. For backward compatibility, when this field is set, the <em>document</em> field will also be set</td>
|
|
</tr>
|
|
<tr>
|
|
<td>audio</td>
|
|
<td><a href="#audio">Audio</a></td>
|
|
<td><em>Optional</em>. Message is an audio file, information about the file</td>
|
|
</tr>
|
|
<tr>
|
|
<td>document</td>
|
|
<td><a href="#document">Document</a></td>
|
|
<td><em>Optional</em>. Message is a general file, information about the file</td>
|
|
</tr>
|
|
<tr>
|
|
<td>photo</td>
|
|
<td>Array of <a href="#photosize">PhotoSize</a></td>
|
|
<td><em>Optional</em>. Message is a photo, available sizes of the photo</td>
|
|
</tr>
|
|
<tr>
|
|
<td>sticker</td>
|
|
<td><a href="#sticker">Sticker</a></td>
|
|
<td><em>Optional</em>. Message is a sticker, information about the sticker</td>
|
|
</tr>
|
|
<tr>
|
|
<td>video</td>
|
|
<td><a href="#video">Video</a></td>
|
|
<td><em>Optional</em>. Message is a video, information about the video</td>
|
|
</tr>
|
|
<tr>
|
|
<td>video_note</td>
|
|
<td><a href="#videonote">VideoNote</a></td>
|
|
<td><em>Optional</em>. Message is a <a href="https://telegram.org/blog/video-messages-and-telescope">video note</a>, information about the video message</td>
|
|
</tr>
|
|
<tr>
|
|
<td>voice</td>
|
|
<td><a href="#voice">Voice</a></td>
|
|
<td><em>Optional</em>. Message is a voice message, information about the file</td>
|
|
</tr>
|
|
<tr>
|
|
<td>caption</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Caption for the animation, audio, document, photo, video or voice</td>
|
|
</tr>
|
|
<tr>
|
|
<td>caption_entities</td>
|
|
<td>Array of <a href="#messageentity">MessageEntity</a></td>
|
|
<td><em>Optional</em>. For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption</td>
|
|
</tr>
|
|
<tr>
|
|
<td>has_media_spoiler</td>
|
|
<td>True</td>
|
|
<td><em>Optional</em>. <em>True</em>, if the message media is covered by a spoiler animation</td>
|
|
</tr>
|
|
<tr>
|
|
<td>contact</td>
|
|
<td><a href="#contact">Contact</a></td>
|
|
<td><em>Optional</em>. Message is a shared contact, information about the contact</td>
|
|
</tr>
|
|
<tr>
|
|
<td>dice</td>
|
|
<td><a href="#dice">Dice</a></td>
|
|
<td><em>Optional</em>. Message is a dice with random value</td>
|
|
</tr>
|
|
<tr>
|
|
<td>game</td>
|
|
<td><a href="#game">Game</a></td>
|
|
<td><em>Optional</em>. Message is a game, information about the game. <a href="#games">More about games »</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td>poll</td>
|
|
<td><a href="#poll">Poll</a></td>
|
|
<td><em>Optional</em>. Message is a native poll, information about the poll</td>
|
|
</tr>
|
|
<tr>
|
|
<td>venue</td>
|
|
<td><a href="#venue">Venue</a></td>
|
|
<td><em>Optional</em>. Message is a venue, information about the venue. For backward compatibility, when this field is set, the <em>location</em> field will also be set</td>
|
|
</tr>
|
|
<tr>
|
|
<td>location</td>
|
|
<td><a href="#location">Location</a></td>
|
|
<td><em>Optional</em>. Message is a shared location, information about the location</td>
|
|
</tr>
|
|
<tr>
|
|
<td>new_chat_members</td>
|
|
<td>Array of <a href="#user">User</a></td>
|
|
<td><em>Optional</em>. New members that were added to the group or supergroup and information about them (the bot itself may be one of these members)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>left_chat_member</td>
|
|
<td><a href="#user">User</a></td>
|
|
<td><em>Optional</em>. A member was removed from the group, information about them (this member may be the bot itself)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>new_chat_title</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. A chat title was changed to this value</td>
|
|
</tr>
|
|
<tr>
|
|
<td>new_chat_photo</td>
|
|
<td>Array of <a href="#photosize">PhotoSize</a></td>
|
|
<td><em>Optional</em>. A chat photo was change to this value</td>
|
|
</tr>
|
|
<tr>
|
|
<td>delete_chat_photo</td>
|
|
<td>True</td>
|
|
<td><em>Optional</em>. Service message: the chat photo was deleted</td>
|
|
</tr>
|
|
<tr>
|
|
<td>group_chat_created</td>
|
|
<td>True</td>
|
|
<td><em>Optional</em>. Service message: the group has been created</td>
|
|
</tr>
|
|
<tr>
|
|
<td>supergroup_chat_created</td>
|
|
<td>True</td>
|
|
<td><em>Optional</em>. Service message: the supergroup has been created. This field can't be received in a message coming through updates, because bot can't be a member of a supergroup when it is created. It can only be found in reply_to_message if someone replies to a very first message in a directly created supergroup.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>channel_chat_created</td>
|
|
<td>True</td>
|
|
<td><em>Optional</em>. Service message: the channel has been created. This field can't be received in a message coming through updates, because bot can't be a member of a channel when it is created. It can only be found in reply_to_message if someone replies to a very first message in a channel.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>message_auto_delete_timer_changed</td>
|
|
<td><a href="#messageautodeletetimerchanged">MessageAutoDeleteTimerChanged</a></td>
|
|
<td><em>Optional</em>. Service message: auto-delete timer settings changed in the chat</td>
|
|
</tr>
|
|
<tr>
|
|
<td>migrate_to_chat_id</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. The group has been migrated to a supergroup with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>migrate_from_chat_id</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. The supergroup has been migrated from a group with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>pinned_message</td>
|
|
<td><a href="#message">Message</a></td>
|
|
<td><em>Optional</em>. Specified message was pinned. Note that the Message object in this field will not contain further <em>reply_to_message</em> fields even if it is itself a reply.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>invoice</td>
|
|
<td><a href="#invoice">Invoice</a></td>
|
|
<td><em>Optional</em>. Message is an invoice for a <a href="#payments">payment</a>, information about the invoice. <a href="#payments">More about payments »</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td>successful_payment</td>
|
|
<td><a href="#successfulpayment">SuccessfulPayment</a></td>
|
|
<td><em>Optional</em>. Message is a service message about a successful payment, information about the payment. <a href="#payments">More about payments »</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td>user_shared</td>
|
|
<td><a href="#usershared">UserShared</a></td>
|
|
<td><em>Optional</em>. Service message: a user was shared with the bot</td>
|
|
</tr>
|
|
<tr>
|
|
<td>chat_shared</td>
|
|
<td><a href="#chatshared">ChatShared</a></td>
|
|
<td><em>Optional</em>. Service message: a chat was shared with the bot</td>
|
|
</tr>
|
|
<tr>
|
|
<td>connected_website</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. The domain name of the website on which the user has logged in. <a href="/widgets/login">More about Telegram Login »</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td>write_access_allowed</td>
|
|
<td><a href="#writeaccessallowed">WriteAccessAllowed</a></td>
|
|
<td><em>Optional</em>. Service message: the user allowed the bot added to the attachment menu to write messages</td>
|
|
</tr>
|
|
<tr>
|
|
<td>passport_data</td>
|
|
<td><a href="#passportdata">PassportData</a></td>
|
|
<td><em>Optional</em>. Telegram Passport data</td>
|
|
</tr>
|
|
<tr>
|
|
<td>proximity_alert_triggered</td>
|
|
<td><a href="#proximityalerttriggered">ProximityAlertTriggered</a></td>
|
|
<td><em>Optional</em>. Service message. A user in the chat triggered another user's proximity alert while sharing Live Location.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>forum_topic_created</td>
|
|
<td><a href="#forumtopiccreated">ForumTopicCreated</a></td>
|
|
<td><em>Optional</em>. Service message: forum topic created</td>
|
|
</tr>
|
|
<tr>
|
|
<td>forum_topic_edited</td>
|
|
<td><a href="#forumtopicedited">ForumTopicEdited</a></td>
|
|
<td><em>Optional</em>. Service message: forum topic edited</td>
|
|
</tr>
|
|
<tr>
|
|
<td>forum_topic_closed</td>
|
|
<td><a href="#forumtopicclosed">ForumTopicClosed</a></td>
|
|
<td><em>Optional</em>. Service message: forum topic closed</td>
|
|
</tr>
|
|
<tr>
|
|
<td>forum_topic_reopened</td>
|
|
<td><a href="#forumtopicreopened">ForumTopicReopened</a></td>
|
|
<td><em>Optional</em>. Service message: forum topic reopened</td>
|
|
</tr>
|
|
<tr>
|
|
<td>general_forum_topic_hidden</td>
|
|
<td><a href="#generalforumtopichidden">GeneralForumTopicHidden</a></td>
|
|
<td><em>Optional</em>. Service message: the 'General' forum topic hidden</td>
|
|
</tr>
|
|
<tr>
|
|
<td>general_forum_topic_unhidden</td>
|
|
<td><a href="#generalforumtopicunhidden">GeneralForumTopicUnhidden</a></td>
|
|
<td><em>Optional</em>. Service message: the 'General' forum topic unhidden</td>
|
|
</tr>
|
|
<tr>
|
|
<td>video_chat_scheduled</td>
|
|
<td><a href="#videochatscheduled">VideoChatScheduled</a></td>
|
|
<td><em>Optional</em>. Service message: video chat scheduled</td>
|
|
</tr>
|
|
<tr>
|
|
<td>video_chat_started</td>
|
|
<td><a href="#videochatstarted">VideoChatStarted</a></td>
|
|
<td><em>Optional</em>. Service message: video chat started</td>
|
|
</tr>
|
|
<tr>
|
|
<td>video_chat_ended</td>
|
|
<td><a href="#videochatended">VideoChatEnded</a></td>
|
|
<td><em>Optional</em>. Service message: video chat ended</td>
|
|
</tr>
|
|
<tr>
|
|
<td>video_chat_participants_invited</td>
|
|
<td><a href="#videochatparticipantsinvited">VideoChatParticipantsInvited</a></td>
|
|
<td><em>Optional</em>. Service message: new participants invited to a video chat</td>
|
|
</tr>
|
|
<tr>
|
|
<td>web_app_data</td>
|
|
<td><a href="#webappdata">WebAppData</a></td>
|
|
<td><em>Optional</em>. Service message: data sent by a Web App</td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply_markup</td>
|
|
<td><a href="#inlinekeyboardmarkup">InlineKeyboardMarkup</a></td>
|
|
<td><em>Optional</em>. Inline keyboard attached to the message. <code>login_url</code> buttons are represented as ordinary <code>url</code> buttons.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="messageid" href="#messageid"><i class="anchor-icon"></i></a>MessageId</h4>
|
|
<p>This object represents a unique message identifier.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>message_id</td>
|
|
<td>Integer</td>
|
|
<td>Unique message identifier</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="messageentity" href="#messageentity"><i class="anchor-icon"></i></a>MessageEntity</h4>
|
|
<p>This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>type</td>
|
|
<td>String</td>
|
|
<td>Type of the entity. Currently, can be “mention” (<code>@username</code>), “hashtag” (<code>#hashtag</code>), “cashtag” (<code>$USD</code>), “bot_command” (<code>/start@jobs_bot</code>), “url” (<code>https://telegram.org</code>), “email” (<code>do-not-reply@telegram.org</code>), “phone_number” (<code>+1-212-555-0123</code>), “bold” (<strong>bold text</strong>), “italic” (<em>italic text</em>), “underline” (underlined text), “strikethrough” (strikethrough text), “spoiler” (spoiler message), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users <a href="https://telegram.org/blog/edit#new-mentions">without usernames</a>), “custom_emoji” (for inline custom emoji stickers)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>offset</td>
|
|
<td>Integer</td>
|
|
<td>Offset in <a href="/api/entities#entity-length">UTF-16 code units</a> to the start of the entity</td>
|
|
</tr>
|
|
<tr>
|
|
<td>length</td>
|
|
<td>Integer</td>
|
|
<td>Length of the entity in <a href="/api/entities#entity-length">UTF-16 code units</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td>url</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. For “text_link” only, URL that will be opened after user taps on the text</td>
|
|
</tr>
|
|
<tr>
|
|
<td>user</td>
|
|
<td><a href="#user">User</a></td>
|
|
<td><em>Optional</em>. For “text_mention” only, the mentioned user</td>
|
|
</tr>
|
|
<tr>
|
|
<td>language</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. For “pre” only, the programming language of the entity text</td>
|
|
</tr>
|
|
<tr>
|
|
<td>custom_emoji_id</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. For “custom_emoji” only, unique identifier of the custom emoji. Use <a href="#getcustomemojistickers">getCustomEmojiStickers</a> to get full information about the sticker</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="photosize" href="#photosize"><i class="anchor-icon"></i></a>PhotoSize</h4>
|
|
<p>This object represents one size of a photo or a <a href="#document">file</a> / <a href="#sticker">sticker</a> thumbnail.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>file_id</td>
|
|
<td>String</td>
|
|
<td>Identifier for this file, which can be used to download or reuse the file</td>
|
|
</tr>
|
|
<tr>
|
|
<td>file_unique_id</td>
|
|
<td>String</td>
|
|
<td>Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>width</td>
|
|
<td>Integer</td>
|
|
<td>Photo width</td>
|
|
</tr>
|
|
<tr>
|
|
<td>height</td>
|
|
<td>Integer</td>
|
|
<td>Photo height</td>
|
|
</tr>
|
|
<tr>
|
|
<td>file_size</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. File size in bytes</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="animation" href="#animation"><i class="anchor-icon"></i></a>Animation</h4>
|
|
<p>This object represents an animation file (GIF or H.264/MPEG-4 AVC video without sound).</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>file_id</td>
|
|
<td>String</td>
|
|
<td>Identifier for this file, which can be used to download or reuse the file</td>
|
|
</tr>
|
|
<tr>
|
|
<td>file_unique_id</td>
|
|
<td>String</td>
|
|
<td>Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>width</td>
|
|
<td>Integer</td>
|
|
<td>Video width as defined by sender</td>
|
|
</tr>
|
|
<tr>
|
|
<td>height</td>
|
|
<td>Integer</td>
|
|
<td>Video height as defined by sender</td>
|
|
</tr>
|
|
<tr>
|
|
<td>duration</td>
|
|
<td>Integer</td>
|
|
<td>Duration of the video in seconds as defined by sender</td>
|
|
</tr>
|
|
<tr>
|
|
<td>thumbnail</td>
|
|
<td><a href="#photosize">PhotoSize</a></td>
|
|
<td><em>Optional</em>. Animation thumbnail as defined by sender</td>
|
|
</tr>
|
|
<tr>
|
|
<td>file_name</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Original animation filename as defined by sender</td>
|
|
</tr>
|
|
<tr>
|
|
<td>mime_type</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. MIME type of the file as defined by sender</td>
|
|
</tr>
|
|
<tr>
|
|
<td>file_size</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="audio" href="#audio"><i class="anchor-icon"></i></a>Audio</h4>
|
|
<p>This object represents an audio file to be treated as music by the Telegram clients.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>file_id</td>
|
|
<td>String</td>
|
|
<td>Identifier for this file, which can be used to download or reuse the file</td>
|
|
</tr>
|
|
<tr>
|
|
<td>file_unique_id</td>
|
|
<td>String</td>
|
|
<td>Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>duration</td>
|
|
<td>Integer</td>
|
|
<td>Duration of the audio in seconds as defined by sender</td>
|
|
</tr>
|
|
<tr>
|
|
<td>performer</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Performer of the audio as defined by sender or by audio tags</td>
|
|
</tr>
|
|
<tr>
|
|
<td>title</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Title of the audio as defined by sender or by audio tags</td>
|
|
</tr>
|
|
<tr>
|
|
<td>file_name</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Original filename as defined by sender</td>
|
|
</tr>
|
|
<tr>
|
|
<td>mime_type</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. MIME type of the file as defined by sender</td>
|
|
</tr>
|
|
<tr>
|
|
<td>file_size</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>thumbnail</td>
|
|
<td><a href="#photosize">PhotoSize</a></td>
|
|
<td><em>Optional</em>. Thumbnail of the album cover to which the music file belongs</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="document" href="#document"><i class="anchor-icon"></i></a>Document</h4>
|
|
<p>This object represents a general file (as opposed to <a href="#photosize">photos</a>, <a href="#voice">voice messages</a> and <a href="#audio">audio files</a>).</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>file_id</td>
|
|
<td>String</td>
|
|
<td>Identifier for this file, which can be used to download or reuse the file</td>
|
|
</tr>
|
|
<tr>
|
|
<td>file_unique_id</td>
|
|
<td>String</td>
|
|
<td>Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>thumbnail</td>
|
|
<td><a href="#photosize">PhotoSize</a></td>
|
|
<td><em>Optional</em>. Document thumbnail as defined by sender</td>
|
|
</tr>
|
|
<tr>
|
|
<td>file_name</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Original filename as defined by sender</td>
|
|
</tr>
|
|
<tr>
|
|
<td>mime_type</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. MIME type of the file as defined by sender</td>
|
|
</tr>
|
|
<tr>
|
|
<td>file_size</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="video" href="#video"><i class="anchor-icon"></i></a>Video</h4>
|
|
<p>This object represents a video file.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>file_id</td>
|
|
<td>String</td>
|
|
<td>Identifier for this file, which can be used to download or reuse the file</td>
|
|
</tr>
|
|
<tr>
|
|
<td>file_unique_id</td>
|
|
<td>String</td>
|
|
<td>Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>width</td>
|
|
<td>Integer</td>
|
|
<td>Video width as defined by sender</td>
|
|
</tr>
|
|
<tr>
|
|
<td>height</td>
|
|
<td>Integer</td>
|
|
<td>Video height as defined by sender</td>
|
|
</tr>
|
|
<tr>
|
|
<td>duration</td>
|
|
<td>Integer</td>
|
|
<td>Duration of the video in seconds as defined by sender</td>
|
|
</tr>
|
|
<tr>
|
|
<td>thumbnail</td>
|
|
<td><a href="#photosize">PhotoSize</a></td>
|
|
<td><em>Optional</em>. Video thumbnail</td>
|
|
</tr>
|
|
<tr>
|
|
<td>file_name</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Original filename as defined by sender</td>
|
|
</tr>
|
|
<tr>
|
|
<td>mime_type</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. MIME type of the file as defined by sender</td>
|
|
</tr>
|
|
<tr>
|
|
<td>file_size</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="videonote" href="#videonote"><i class="anchor-icon"></i></a>VideoNote</h4>
|
|
<p>This object represents a <a href="https://telegram.org/blog/video-messages-and-telescope">video message</a> (available in Telegram apps as of <a href="https://telegram.org/blog/video-messages-and-telescope">v.4.0</a>).</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>file_id</td>
|
|
<td>String</td>
|
|
<td>Identifier for this file, which can be used to download or reuse the file</td>
|
|
</tr>
|
|
<tr>
|
|
<td>file_unique_id</td>
|
|
<td>String</td>
|
|
<td>Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>length</td>
|
|
<td>Integer</td>
|
|
<td>Video width and height (diameter of the video message) as defined by sender</td>
|
|
</tr>
|
|
<tr>
|
|
<td>duration</td>
|
|
<td>Integer</td>
|
|
<td>Duration of the video in seconds as defined by sender</td>
|
|
</tr>
|
|
<tr>
|
|
<td>thumbnail</td>
|
|
<td><a href="#photosize">PhotoSize</a></td>
|
|
<td><em>Optional</em>. Video thumbnail</td>
|
|
</tr>
|
|
<tr>
|
|
<td>file_size</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. File size in bytes</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="voice" href="#voice"><i class="anchor-icon"></i></a>Voice</h4>
|
|
<p>This object represents a voice note.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>file_id</td>
|
|
<td>String</td>
|
|
<td>Identifier for this file, which can be used to download or reuse the file</td>
|
|
</tr>
|
|
<tr>
|
|
<td>file_unique_id</td>
|
|
<td>String</td>
|
|
<td>Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>duration</td>
|
|
<td>Integer</td>
|
|
<td>Duration of the audio in seconds as defined by sender</td>
|
|
</tr>
|
|
<tr>
|
|
<td>mime_type</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. MIME type of the file as defined by sender</td>
|
|
</tr>
|
|
<tr>
|
|
<td>file_size</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="contact" href="#contact"><i class="anchor-icon"></i></a>Contact</h4>
|
|
<p>This object represents a phone contact.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>phone_number</td>
|
|
<td>String</td>
|
|
<td>Contact's phone number</td>
|
|
</tr>
|
|
<tr>
|
|
<td>first_name</td>
|
|
<td>String</td>
|
|
<td>Contact's first name</td>
|
|
</tr>
|
|
<tr>
|
|
<td>last_name</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Contact's last name</td>
|
|
</tr>
|
|
<tr>
|
|
<td>user_id</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. Contact's user identifier in Telegram. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>vcard</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Additional data about the contact in the form of a <a href="https://en.wikipedia.org/wiki/VCard">vCard</a></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="dice" href="#dice"><i class="anchor-icon"></i></a>Dice</h4>
|
|
<p>This object represents an animated emoji that displays a random value.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>emoji</td>
|
|
<td>String</td>
|
|
<td>Emoji on which the dice throw animation is based</td>
|
|
</tr>
|
|
<tr>
|
|
<td>value</td>
|
|
<td>Integer</td>
|
|
<td>Value of the dice, 1-6 for “<img class="emoji" src="//telegram.org/img/emoji/40/F09F8EB2.png" width="20" height="20" alt="🎲" />”, “<img class="emoji" src="//telegram.org/img/emoji/40/F09F8EAF.png" width="20" height="20" alt="🎯" />” and “<img class="emoji" src="//telegram.org/img/emoji/40/F09F8EB3.png" width="20" height="20" alt="🎳" />” base emoji, 1-5 for “<img class="emoji" src="//telegram.org/img/emoji/40/F09F8F80.png" width="20" height="20" alt="🏀" />” and “<img class="emoji" src="//telegram.org/img/emoji/40/E29ABD.png" width="20" height="20" alt="⚽" />” base emoji, 1-64 for “<img class="emoji" src="//telegram.org/img/emoji/40/F09F8EB0.png" width="20" height="20" alt="🎰" />” base emoji</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="polloption" href="#polloption"><i class="anchor-icon"></i></a>PollOption</h4>
|
|
<p>This object contains information about one answer option in a poll.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>text</td>
|
|
<td>String</td>
|
|
<td>Option text, 1-100 characters</td>
|
|
</tr>
|
|
<tr>
|
|
<td>voter_count</td>
|
|
<td>Integer</td>
|
|
<td>Number of users that voted for this option</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="pollanswer" href="#pollanswer"><i class="anchor-icon"></i></a>PollAnswer</h4>
|
|
<p>This object represents an answer of a user in a non-anonymous poll.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>poll_id</td>
|
|
<td>String</td>
|
|
<td>Unique poll identifier</td>
|
|
</tr>
|
|
<tr>
|
|
<td>user</td>
|
|
<td><a href="#user">User</a></td>
|
|
<td>The user, who changed the answer to the poll</td>
|
|
</tr>
|
|
<tr>
|
|
<td>option_ids</td>
|
|
<td>Array of Integer</td>
|
|
<td>0-based identifiers of answer options, chosen by the user. May be empty if the user retracted their vote.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="poll" href="#poll"><i class="anchor-icon"></i></a>Poll</h4>
|
|
<p>This object contains information about a poll.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>id</td>
|
|
<td>String</td>
|
|
<td>Unique poll identifier</td>
|
|
</tr>
|
|
<tr>
|
|
<td>question</td>
|
|
<td>String</td>
|
|
<td>Poll question, 1-300 characters</td>
|
|
</tr>
|
|
<tr>
|
|
<td>options</td>
|
|
<td>Array of <a href="#polloption">PollOption</a></td>
|
|
<td>List of poll options</td>
|
|
</tr>
|
|
<tr>
|
|
<td>total_voter_count</td>
|
|
<td>Integer</td>
|
|
<td>Total number of users that voted in the poll</td>
|
|
</tr>
|
|
<tr>
|
|
<td>is_closed</td>
|
|
<td>Boolean</td>
|
|
<td><em>True</em>, if the poll is closed</td>
|
|
</tr>
|
|
<tr>
|
|
<td>is_anonymous</td>
|
|
<td>Boolean</td>
|
|
<td><em>True</em>, if the poll is anonymous</td>
|
|
</tr>
|
|
<tr>
|
|
<td>type</td>
|
|
<td>String</td>
|
|
<td>Poll type, currently can be “regular” or “quiz”</td>
|
|
</tr>
|
|
<tr>
|
|
<td>allows_multiple_answers</td>
|
|
<td>Boolean</td>
|
|
<td><em>True</em>, if the poll allows multiple answers</td>
|
|
</tr>
|
|
<tr>
|
|
<td>correct_option_id</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. 0-based identifier of the correct answer option. Available only for polls in the quiz mode, which are closed, or was sent (not forwarded) by the bot or to the private chat with the bot.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>explanation</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters</td>
|
|
</tr>
|
|
<tr>
|
|
<td>explanation_entities</td>
|
|
<td>Array of <a href="#messageentity">MessageEntity</a></td>
|
|
<td><em>Optional</em>. Special entities like usernames, URLs, bot commands, etc. that appear in the <em>explanation</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>open_period</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. Amount of time in seconds the poll will be active after creation</td>
|
|
</tr>
|
|
<tr>
|
|
<td>close_date</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. Point in time (Unix timestamp) when the poll will be automatically closed</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="location" href="#location"><i class="anchor-icon"></i></a>Location</h4>
|
|
<p>This object represents a point on the map.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>longitude</td>
|
|
<td>Float</td>
|
|
<td>Longitude as defined by sender</td>
|
|
</tr>
|
|
<tr>
|
|
<td>latitude</td>
|
|
<td>Float</td>
|
|
<td>Latitude as defined by sender</td>
|
|
</tr>
|
|
<tr>
|
|
<td>horizontal_accuracy</td>
|
|
<td>Float number</td>
|
|
<td><em>Optional</em>. The radius of uncertainty for the location, measured in meters; 0-1500</td>
|
|
</tr>
|
|
<tr>
|
|
<td>live_period</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. Time relative to the message sending date, during which the location can be updated; in seconds. For active live locations only.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>heading</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. The direction in which user is moving, in degrees; 1-360. For active live locations only.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>proximity_alert_radius</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. The maximum distance for proximity alerts about approaching another chat member, in meters. For sent live locations only.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="venue" href="#venue"><i class="anchor-icon"></i></a>Venue</h4>
|
|
<p>This object represents a venue.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>location</td>
|
|
<td><a href="#location">Location</a></td>
|
|
<td>Venue location. Can't be a live location</td>
|
|
</tr>
|
|
<tr>
|
|
<td>title</td>
|
|
<td>String</td>
|
|
<td>Name of the venue</td>
|
|
</tr>
|
|
<tr>
|
|
<td>address</td>
|
|
<td>String</td>
|
|
<td>Address of the venue</td>
|
|
</tr>
|
|
<tr>
|
|
<td>foursquare_id</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Foursquare identifier of the venue</td>
|
|
</tr>
|
|
<tr>
|
|
<td>foursquare_type</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Foursquare type of the venue. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>google_place_id</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Google Places identifier of the venue</td>
|
|
</tr>
|
|
<tr>
|
|
<td>google_place_type</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Google Places type of the venue. (See <a href="https://developers.google.com/places/web-service/supported_types">supported types</a>.)</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="webappdata" href="#webappdata"><i class="anchor-icon"></i></a>WebAppData</h4>
|
|
<p>Describes data sent from a <a href="/bots/webapps">Web App</a> to the bot.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>data</td>
|
|
<td>String</td>
|
|
<td>The data. Be aware that a bad client can send arbitrary data in this field.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>button_text</td>
|
|
<td>String</td>
|
|
<td>Text of the <em>web_app</em> keyboard button from which the Web App was opened. Be aware that a bad client can send arbitrary data in this field.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="proximityalerttriggered" href="#proximityalerttriggered"><i class="anchor-icon"></i></a>ProximityAlertTriggered</h4>
|
|
<p>This object represents the content of a service message, sent whenever a user in the chat triggers a proximity alert set by another user.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>traveler</td>
|
|
<td><a href="#user">User</a></td>
|
|
<td>User that triggered the alert</td>
|
|
</tr>
|
|
<tr>
|
|
<td>watcher</td>
|
|
<td><a href="#user">User</a></td>
|
|
<td>User that set the alert</td>
|
|
</tr>
|
|
<tr>
|
|
<td>distance</td>
|
|
<td>Integer</td>
|
|
<td>The distance between the users</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="messageautodeletetimerchanged" href="#messageautodeletetimerchanged"><i class="anchor-icon"></i></a>MessageAutoDeleteTimerChanged</h4>
|
|
<p>This object represents a service message about a change in auto-delete timer settings.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>message_auto_delete_time</td>
|
|
<td>Integer</td>
|
|
<td>New auto-delete time for messages in the chat; in seconds</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="forumtopiccreated" href="#forumtopiccreated"><i class="anchor-icon"></i></a>ForumTopicCreated</h4>
|
|
<p>This object represents a service message about a new forum topic created in the chat.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>name</td>
|
|
<td>String</td>
|
|
<td>Name of the topic</td>
|
|
</tr>
|
|
<tr>
|
|
<td>icon_color</td>
|
|
<td>Integer</td>
|
|
<td>Color of the topic icon in RGB format</td>
|
|
</tr>
|
|
<tr>
|
|
<td>icon_custom_emoji_id</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Unique identifier of the custom emoji shown as the topic icon</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="forumtopicclosed" href="#forumtopicclosed"><i class="anchor-icon"></i></a>ForumTopicClosed</h4>
|
|
<p>This object represents a service message about a forum topic closed in the chat. Currently holds no information.</p>
|
|
<h4><a class="anchor" name="forumtopicedited" href="#forumtopicedited"><i class="anchor-icon"></i></a>ForumTopicEdited</h4>
|
|
<p>This object represents a service message about an edited forum topic.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>name</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. New name of the topic, if it was edited</td>
|
|
</tr>
|
|
<tr>
|
|
<td>icon_custom_emoji_id</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. New identifier of the custom emoji shown as the topic icon, if it was edited; an empty string if the icon was removed</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="forumtopicreopened" href="#forumtopicreopened"><i class="anchor-icon"></i></a>ForumTopicReopened</h4>
|
|
<p>This object represents a service message about a forum topic reopened in the chat. Currently holds no information.</p>
|
|
<h4><a class="anchor" name="generalforumtopichidden" href="#generalforumtopichidden"><i class="anchor-icon"></i></a>GeneralForumTopicHidden</h4>
|
|
<p>This object represents a service message about General forum topic hidden in the chat. Currently holds no information.</p>
|
|
<h4><a class="anchor" name="generalforumtopicunhidden" href="#generalforumtopicunhidden"><i class="anchor-icon"></i></a>GeneralForumTopicUnhidden</h4>
|
|
<p>This object represents a service message about General forum topic unhidden in the chat. Currently holds no information.</p>
|
|
<h4><a class="anchor" name="usershared" href="#usershared"><i class="anchor-icon"></i></a>UserShared</h4>
|
|
<p>This object contains information about the user whose identifier was shared with the bot using a <a href="#keyboardbuttonrequestuser">KeyboardButtonRequestUser</a> button.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>request_id</td>
|
|
<td>Integer</td>
|
|
<td>Identifier of the request</td>
|
|
</tr>
|
|
<tr>
|
|
<td>user_id</td>
|
|
<td>Integer</td>
|
|
<td>Identifier of the shared user. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. The bot may not have access to the user and could be unable to use this identifier, unless the user is already known to the bot by some other means.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="chatshared" href="#chatshared"><i class="anchor-icon"></i></a>ChatShared</h4>
|
|
<p>This object contains information about the chat whose identifier was shared with the bot using a <a href="#keyboardbuttonrequestchat">KeyboardButtonRequestChat</a> button.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>request_id</td>
|
|
<td>Integer</td>
|
|
<td>Identifier of the request</td>
|
|
</tr>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer</td>
|
|
<td>Identifier of the shared chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. The bot may not have access to the chat and could be unable to use this identifier, unless the chat is already known to the bot by some other means.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="writeaccessallowed" href="#writeaccessallowed"><i class="anchor-icon"></i></a>WriteAccessAllowed</h4>
|
|
<p>This object represents a service message about a user allowing a bot to write messages after adding the bot to the attachment menu or launching a Web App from a link.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>web_app_name</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Name of the Web App which was launched from a link</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="videochatscheduled" href="#videochatscheduled"><i class="anchor-icon"></i></a>VideoChatScheduled</h4>
|
|
<p>This object represents a service message about a video chat scheduled in the chat.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>start_date</td>
|
|
<td>Integer</td>
|
|
<td>Point in time (Unix timestamp) when the video chat is supposed to be started by a chat administrator</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="videochatstarted" href="#videochatstarted"><i class="anchor-icon"></i></a>VideoChatStarted</h4>
|
|
<p>This object represents a service message about a video chat started in the chat. Currently holds no information.</p>
|
|
<h4><a class="anchor" name="videochatended" href="#videochatended"><i class="anchor-icon"></i></a>VideoChatEnded</h4>
|
|
<p>This object represents a service message about a video chat ended in the chat.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>duration</td>
|
|
<td>Integer</td>
|
|
<td>Video chat duration in seconds</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="videochatparticipantsinvited" href="#videochatparticipantsinvited"><i class="anchor-icon"></i></a>VideoChatParticipantsInvited</h4>
|
|
<p>This object represents a service message about new members invited to a video chat.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>users</td>
|
|
<td>Array of <a href="#user">User</a></td>
|
|
<td>New members that were invited to the video chat</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="userprofilephotos" href="#userprofilephotos"><i class="anchor-icon"></i></a>UserProfilePhotos</h4>
|
|
<p>This object represent a user's profile pictures.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>total_count</td>
|
|
<td>Integer</td>
|
|
<td>Total number of profile pictures the target user has</td>
|
|
</tr>
|
|
<tr>
|
|
<td>photos</td>
|
|
<td>Array of Array of <a href="#photosize">PhotoSize</a></td>
|
|
<td>Requested profile pictures (in up to 4 sizes each)</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="file" href="#file"><i class="anchor-icon"></i></a>File</h4>
|
|
<p>This object represents a file ready to be downloaded. The file can be downloaded via the link <code>https://api.telegram.org/file/bot<token>/<file_path></code>. It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be requested by calling <a href="#getfile">getFile</a>.</p>
|
|
<blockquote>
|
|
<p>The maximum file size to download is 20 MB</p>
|
|
</blockquote>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>file_id</td>
|
|
<td>String</td>
|
|
<td>Identifier for this file, which can be used to download or reuse the file</td>
|
|
</tr>
|
|
<tr>
|
|
<td>file_unique_id</td>
|
|
<td>String</td>
|
|
<td>Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>file_size</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>file_path</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. File path. Use <code>https://api.telegram.org/file/bot<token>/<file_path></code> to get the file.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="webappinfo" href="#webappinfo"><i class="anchor-icon"></i></a>WebAppInfo</h4>
|
|
<p>Describes a <a href="/bots/webapps">Web App</a>.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>url</td>
|
|
<td>String</td>
|
|
<td>An HTTPS URL of a Web App to be opened with additional data as specified in <a href="/bots/webapps#initializing-web-apps">Initializing Web Apps</a></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="replykeyboardmarkup" href="#replykeyboardmarkup"><i class="anchor-icon"></i></a>ReplyKeyboardMarkup</h4>
|
|
<p>This object represents a <a href="/bots/features#keyboards">custom keyboard</a> with reply options (see <a href="/bots/features#keyboards">Introduction to bots</a> for details and examples).</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>keyboard</td>
|
|
<td>Array of Array of <a href="#keyboardbutton">KeyboardButton</a></td>
|
|
<td>Array of button rows, each represented by an Array of <a href="#keyboardbutton">KeyboardButton</a> objects</td>
|
|
</tr>
|
|
<tr>
|
|
<td>is_persistent</td>
|
|
<td>Boolean</td>
|
|
<td><em>Optional</em>. Requests clients to always show the keyboard when the regular keyboard is hidden. Defaults to <em>false</em>, in which case the custom keyboard can be hidden and opened with a keyboard icon.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>resize_keyboard</td>
|
|
<td>Boolean</td>
|
|
<td><em>Optional</em>. Requests clients to resize the keyboard vertically for optimal fit (e.g., make the keyboard smaller if there are just two rows of buttons). Defaults to <em>false</em>, in which case the custom keyboard is always of the same height as the app's standard keyboard.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>one_time_keyboard</td>
|
|
<td>Boolean</td>
|
|
<td><em>Optional</em>. Requests clients to hide the keyboard as soon as it's been used. The keyboard will still be available, but clients will automatically display the usual letter-keyboard in the chat - the user can press a special button in the input field to see the custom keyboard again. Defaults to <em>false</em>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>input_field_placeholder</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. The placeholder to be shown in the input field when the keyboard is active; 1-64 characters</td>
|
|
</tr>
|
|
<tr>
|
|
<td>selective</td>
|
|
<td>Boolean</td>
|
|
<td><em>Optional</em>. Use this parameter if you want to show the keyboard to specific users only. Targets: 1) users that are @mentioned in the <em>text</em> of the <a href="#message">Message</a> object; 2) if the bot's message is a reply (has <em>reply_to_message_id</em>), sender of the original message.<br><br><em>Example:</em> A user requests to change the bot's language, bot replies to the request with a keyboard to select the new language. Other users in the group don't see the keyboard.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="keyboardbutton" href="#keyboardbutton"><i class="anchor-icon"></i></a>KeyboardButton</h4>
|
|
<p>This object represents one button of the reply keyboard. For simple text buttons, <em>String</em> can be used instead of this object to specify the button text. The optional fields <em>web_app</em>, <em>request_user</em>, <em>request_chat</em>, <em>request_contact</em>, <em>request_location</em>, and <em>request_poll</em> are mutually exclusive.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>text</td>
|
|
<td>String</td>
|
|
<td>Text of the button. If none of the optional fields are used, it will be sent as a message when the button is pressed</td>
|
|
</tr>
|
|
<tr>
|
|
<td>request_user</td>
|
|
<td><a href="#keyboardbuttonrequestuser">KeyboardButtonRequestUser</a></td>
|
|
<td><em>Optional.</em> If specified, pressing the button will open a list of suitable users. Tapping on any user will send their identifier to the bot in a “user_shared” service message. Available in private chats only.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>request_chat</td>
|
|
<td><a href="#keyboardbuttonrequestchat">KeyboardButtonRequestChat</a></td>
|
|
<td><em>Optional.</em> If specified, pressing the button will open a list of suitable chats. Tapping on a chat will send its identifier to the bot in a “chat_shared” service message. Available in private chats only.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>request_contact</td>
|
|
<td>Boolean</td>
|
|
<td><em>Optional</em>. If <em>True</em>, the user's phone number will be sent as a contact when the button is pressed. Available in private chats only.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>request_location</td>
|
|
<td>Boolean</td>
|
|
<td><em>Optional</em>. If <em>True</em>, the user's current location will be sent when the button is pressed. Available in private chats only.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>request_poll</td>
|
|
<td><a href="#keyboardbuttonpolltype">KeyboardButtonPollType</a></td>
|
|
<td><em>Optional</em>. If specified, the user will be asked to create a poll and send it to the bot when the button is pressed. Available in private chats only.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>web_app</td>
|
|
<td><a href="#webappinfo">WebAppInfo</a></td>
|
|
<td><em>Optional</em>. If specified, the described <a href="/bots/webapps">Web App</a> will be launched when the button is pressed. The Web App will be able to send a “web_app_data” service message. Available in private chats only.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p><strong>Note:</strong> <em>request_contact</em> and <em>request_location</em> options will only work in Telegram versions released after 9 April, 2016. Older clients will display <em>unsupported message</em>.<br><strong>Note:</strong> <em>request_poll</em> option will only work in Telegram versions released after 23 January, 2020. Older clients will display <em>unsupported message</em>.<br><strong>Note:</strong> <em>web_app</em> option will only work in Telegram versions released after 16 April, 2022. Older clients will display <em>unsupported message</em>.<br><strong>Note:</strong> <em>request_user</em> and <em>request_chat</em> options will only work in Telegram versions released after 3 February, 2023. Older clients will display <em>unsupported message</em>.</p>
|
|
<h4><a class="anchor" name="keyboardbuttonrequestuser" href="#keyboardbuttonrequestuser"><i class="anchor-icon"></i></a>KeyboardButtonRequestUser</h4>
|
|
<p>This object defines the criteria used to request a suitable user. The identifier of the selected user will be shared with the bot when the corresponding button is pressed. <a href="/bots/features#chat-and-user-selection">More about requesting users »</a></p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>request_id</td>
|
|
<td>Integer</td>
|
|
<td>Signed 32-bit identifier of the request, which will be received back in the <a href="#usershared">UserShared</a> object. Must be unique within the message</td>
|
|
</tr>
|
|
<tr>
|
|
<td>user_is_bot</td>
|
|
<td>Boolean</td>
|
|
<td><em>Optional</em>. Pass <em>True</em> to request a bot, pass <em>False</em> to request a regular user. If not specified, no additional restrictions are applied.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>user_is_premium</td>
|
|
<td>Boolean</td>
|
|
<td><em>Optional</em>. Pass <em>True</em> to request a premium user, pass <em>False</em> to request a non-premium user. If not specified, no additional restrictions are applied.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="keyboardbuttonrequestchat" href="#keyboardbuttonrequestchat"><i class="anchor-icon"></i></a>KeyboardButtonRequestChat</h4>
|
|
<p>This object defines the criteria used to request a suitable chat. The identifier of the selected chat will be shared with the bot when the corresponding button is pressed. <a href="/bots/features#chat-and-user-selection">More about requesting chats »</a></p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>request_id</td>
|
|
<td>Integer</td>
|
|
<td>Signed 32-bit identifier of the request, which will be received back in the <a href="#chatshared">ChatShared</a> object. Must be unique within the message</td>
|
|
</tr>
|
|
<tr>
|
|
<td>chat_is_channel</td>
|
|
<td>Boolean</td>
|
|
<td>Pass <em>True</em> to request a channel chat, pass <em>False</em> to request a group or a supergroup chat.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>chat_is_forum</td>
|
|
<td>Boolean</td>
|
|
<td><em>Optional</em>. Pass <em>True</em> to request a forum supergroup, pass <em>False</em> to request a non-forum chat. If not specified, no additional restrictions are applied.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>chat_has_username</td>
|
|
<td>Boolean</td>
|
|
<td><em>Optional</em>. Pass <em>True</em> to request a supergroup or a channel with a username, pass <em>False</em> to request a chat without a username. If not specified, no additional restrictions are applied.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>chat_is_created</td>
|
|
<td>Boolean</td>
|
|
<td><em>Optional</em>. Pass <em>True</em> to request a chat owned by the user. Otherwise, no additional restrictions are applied.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>user_administrator_rights</td>
|
|
<td><a href="#chatadministratorrights">ChatAdministratorRights</a></td>
|
|
<td><em>Optional</em>. A JSON-serialized object listing the required administrator rights of the user in the chat. The rights must be a superset of <em>bot_administrator_rights</em>. If not specified, no additional restrictions are applied.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>bot_administrator_rights</td>
|
|
<td><a href="#chatadministratorrights">ChatAdministratorRights</a></td>
|
|
<td><em>Optional</em>. A JSON-serialized object listing the required administrator rights of the bot in the chat. The rights must be a subset of <em>user_administrator_rights</em>. If not specified, no additional restrictions are applied.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>bot_is_member</td>
|
|
<td>Boolean</td>
|
|
<td><em>Optional</em>. Pass <em>True</em> to request a chat with the bot as a member. Otherwise, no additional restrictions are applied.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="keyboardbuttonpolltype" href="#keyboardbuttonpolltype"><i class="anchor-icon"></i></a>KeyboardButtonPollType</h4>
|
|
<p>This object represents type of a poll, which is allowed to be created and sent when the corresponding button is pressed.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>type</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. If <em>quiz</em> is passed, the user will be allowed to create only polls in the quiz mode. If <em>regular</em> is passed, only regular polls will be allowed. Otherwise, the user will be allowed to create a poll of any type.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="replykeyboardremove" href="#replykeyboardremove"><i class="anchor-icon"></i></a>ReplyKeyboardRemove</h4>
|
|
<p>Upon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a bot. An exception is made for one-time keyboards that are hidden immediately after the user presses a button (see <a href="#replykeyboardmarkup">ReplyKeyboardMarkup</a>).</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>remove_keyboard</td>
|
|
<td>True</td>
|
|
<td>Requests clients to remove the custom keyboard (user will not be able to summon this keyboard; if you want to hide the keyboard from sight but keep it accessible, use <em>one_time_keyboard</em> in <a href="#replykeyboardmarkup">ReplyKeyboardMarkup</a>)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>selective</td>
|
|
<td>Boolean</td>
|
|
<td><em>Optional</em>. Use this parameter if you want to remove the keyboard for specific users only. Targets: 1) users that are @mentioned in the <em>text</em> of the <a href="#message">Message</a> object; 2) if the bot's message is a reply (has <em>reply_to_message_id</em>), sender of the original message.<br><br><em>Example:</em> A user votes in a poll, bot returns confirmation message in reply to the vote and removes the keyboard for that user, while still showing the keyboard with poll options to users who haven't voted yet.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="inlinekeyboardmarkup" href="#inlinekeyboardmarkup"><i class="anchor-icon"></i></a>InlineKeyboardMarkup</h4>
|
|
<p>This object represents an <a href="/bots/features#inline-keyboards">inline keyboard</a> that appears right next to the message it belongs to.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>inline_keyboard</td>
|
|
<td>Array of Array of <a href="#inlinekeyboardbutton">InlineKeyboardButton</a></td>
|
|
<td>Array of button rows, each represented by an Array of <a href="#inlinekeyboardbutton">InlineKeyboardButton</a> objects</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p><strong>Note:</strong> This will only work in Telegram versions released after 9 April, 2016. Older clients will display <em>unsupported message</em>.</p>
|
|
<h4><a class="anchor" name="inlinekeyboardbutton" href="#inlinekeyboardbutton"><i class="anchor-icon"></i></a>InlineKeyboardButton</h4>
|
|
<p>This object represents one button of an inline keyboard. You <strong>must</strong> use exactly one of the optional fields.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>text</td>
|
|
<td>String</td>
|
|
<td>Label text on the button</td>
|
|
</tr>
|
|
<tr>
|
|
<td>url</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. HTTP or tg:// URL to be opened when the button is pressed. Links <code>tg://user?id=<user_id></code> can be used to mention a user by their ID without using a username, if this is allowed by their privacy settings.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>callback_data</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Data to be sent in a <a href="#callbackquery">callback query</a> to the bot when button is pressed, 1-64 bytes</td>
|
|
</tr>
|
|
<tr>
|
|
<td>web_app</td>
|
|
<td><a href="#webappinfo">WebAppInfo</a></td>
|
|
<td><em>Optional</em>. Description of the <a href="/bots/webapps">Web App</a> that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method <a href="#answerwebappquery">answerWebAppQuery</a>. Available only in private chats between a user and the bot.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>login_url</td>
|
|
<td><a href="#loginurl">LoginUrl</a></td>
|
|
<td><em>Optional</em>. An HTTPS URL used to automatically authorize the user. Can be used as a replacement for the <a href="/widgets/login">Telegram Login Widget</a>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>switch_inline_query</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field. May be empty, in which case just the bot's username will be inserted.<br><br><strong>Note:</strong> This offers an easy way for users to start using your bot in <a href="/bots/inline">inline mode</a> when they are currently in a private chat with it. Especially useful when combined with <a href="#answerinlinequery"><em>switch_pm…</em></a> actions - in this case the user will be automatically returned to the chat they switched from, skipping the chat selection screen.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>switch_inline_query_current_chat</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. If set, pressing the button will insert the bot's username and the specified inline query in the current chat's input field. May be empty, in which case only the bot's username will be inserted.<br><br>This offers a quick way for the user to open your bot in inline mode in the same chat - good for selecting something from multiple options.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>switch_inline_query_chosen_chat</td>
|
|
<td><a href="#switchinlinequerychosenchat">SwitchInlineQueryChosenChat</a></td>
|
|
<td><em>Optional</em>. If set, pressing the button will prompt the user to select one of their chats of the specified type, open that chat and insert the bot's username and the specified inline query in the input field</td>
|
|
</tr>
|
|
<tr>
|
|
<td>callback_game</td>
|
|
<td><a href="#callbackgame">CallbackGame</a></td>
|
|
<td><em>Optional</em>. Description of the game that will be launched when the user presses the button.<br><br><strong>NOTE:</strong> This type of button <strong>must</strong> always be the first button in the first row.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>pay</td>
|
|
<td>Boolean</td>
|
|
<td><em>Optional</em>. Specify <em>True</em>, to send a <a href="#payments">Pay button</a>.<br><br><strong>NOTE:</strong> This type of button <strong>must</strong> always be the first button in the first row and can only be used in invoice messages.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="loginurl" href="#loginurl"><i class="anchor-icon"></i></a>LoginUrl</h4>
|
|
<p>This object represents a parameter of the inline keyboard button used to automatically authorize a user. Serves as a great replacement for the <a href="/widgets/login">Telegram Login Widget</a> when the user is coming from Telegram. All the user needs to do is tap/click a button and confirm that they want to log in:</p>
|
|
<div class="blog_image_wrap">
|
|
<a href="/file/811140015/1734/8VZFkwWXalM.97872/6127fa62d8a0bf2b3c" target="_blank"><img src="/file/811140909/1631/20k1Z53eiyY.23995/c541e89b74253623d9" title="TITLE" alt="TITLE" srcset="/file/811140015/1734/8VZFkwWXalM.97872/6127fa62d8a0bf2b3c , 2x" /></a>
|
|
</div>
|
|
|
|
<p>Telegram apps support these buttons as of <a href="https://telegram.org/blog/privacy-discussions-web-bots#meet-seamless-web-bots">version 5.7</a>.</p>
|
|
<blockquote>
|
|
<p>Sample bot: <a href="https://t.me/discussbot">@discussbot</a></p>
|
|
</blockquote>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>url</td>
|
|
<td>String</td>
|
|
<td>An HTTPS URL to be opened with user authorization data added to the query string when the button is pressed. If the user refuses to provide authorization data, the original URL without information about the user will be opened. The data added is the same as described in <a href="/widgets/login#receiving-authorization-data">Receiving authorization data</a>.<br><br><strong>NOTE:</strong> You <strong>must</strong> always check the hash of the received data to verify the authentication and the integrity of the data as described in <a href="/widgets/login#checking-authorization">Checking authorization</a>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>forward_text</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. New text of the button in forwarded messages.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>bot_username</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Username of a bot, which will be used for user authorization. See <a href="/widgets/login#setting-up-a-bot">Setting up a bot</a> for more details. If not specified, the current bot's username will be assumed. The <em>url</em>'s domain must be the same as the domain linked with the bot. See <a href="/widgets/login#linking-your-domain-to-the-bot">Linking your domain to the bot</a> for more details.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>request_write_access</td>
|
|
<td>Boolean</td>
|
|
<td><em>Optional</em>. Pass <em>True</em> to request the permission for your bot to send messages to the user.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="switchinlinequerychosenchat" href="#switchinlinequerychosenchat"><i class="anchor-icon"></i></a>SwitchInlineQueryChosenChat</h4>
|
|
<p>This object represents an inline button that switches the current user to inline mode in a chosen chat, with an optional default inline query.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>query</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. The default inline query to be inserted in the input field. If left empty, only the bot's username will be inserted</td>
|
|
</tr>
|
|
<tr>
|
|
<td>allow_user_chats</td>
|
|
<td>Boolean</td>
|
|
<td><em>Optional</em>. True, if private chats with users can be chosen</td>
|
|
</tr>
|
|
<tr>
|
|
<td>allow_bot_chats</td>
|
|
<td>Boolean</td>
|
|
<td><em>Optional</em>. True, if private chats with bots can be chosen</td>
|
|
</tr>
|
|
<tr>
|
|
<td>allow_group_chats</td>
|
|
<td>Boolean</td>
|
|
<td><em>Optional</em>. True, if group and supergroup chats can be chosen</td>
|
|
</tr>
|
|
<tr>
|
|
<td>allow_channel_chats</td>
|
|
<td>Boolean</td>
|
|
<td><em>Optional</em>. True, if channel chats can be chosen</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="callbackquery" href="#callbackquery"><i class="anchor-icon"></i></a>CallbackQuery</h4>
|
|
<p>This object represents an incoming callback query from a callback button in an <a href="/bots/features#inline-keyboards">inline keyboard</a>. If the button that originated the query was attached to a message sent by the bot, the field <em>message</em> will be present. If the button was attached to a message sent via the bot (in <a href="#inline-mode">inline mode</a>), the field <em>inline_message_id</em> will be present. Exactly one of the fields <em>data</em> or <em>game_short_name</em> will be present.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>id</td>
|
|
<td>String</td>
|
|
<td>Unique identifier for this query</td>
|
|
</tr>
|
|
<tr>
|
|
<td>from</td>
|
|
<td><a href="#user">User</a></td>
|
|
<td>Sender</td>
|
|
</tr>
|
|
<tr>
|
|
<td>message</td>
|
|
<td><a href="#message">Message</a></td>
|
|
<td><em>Optional</em>. Message with the callback button that originated the query. Note that message content and message date will not be available if the message is too old</td>
|
|
</tr>
|
|
<tr>
|
|
<td>inline_message_id</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Identifier of the message sent via the bot in inline mode, that originated the query.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>chat_instance</td>
|
|
<td>String</td>
|
|
<td>Global identifier, uniquely corresponding to the chat to which the message with the callback button was sent. Useful for high scores in <a href="#games">games</a>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>data</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Data associated with the callback button. Be aware that the message originated the query can contain no callback buttons with this data.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>game_short_name</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Short name of a <a href="#games">Game</a> to be returned, serves as the unique identifier for the game</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<blockquote>
|
|
<p><strong>NOTE:</strong> After the user presses a callback button, Telegram clients will display a progress bar until you call <a href="#answercallbackquery">answerCallbackQuery</a>. It is, therefore, necessary to react by calling <a href="#answercallbackquery">answerCallbackQuery</a> even if no notification to the user is needed (e.g., without specifying any of the optional parameters).</p>
|
|
</blockquote>
|
|
<h4><a class="anchor" name="forcereply" href="#forcereply"><i class="anchor-icon"></i></a>ForceReply</h4>
|
|
<p>Upon receiving a message with this object, Telegram clients will display a reply interface to the user (act as if the user has selected the bot's message and tapped 'Reply'). This can be extremely useful if you want to create user-friendly step-by-step interfaces without having to sacrifice <a href="/bots/features#privacy-mode">privacy mode</a>.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>force_reply</td>
|
|
<td>True</td>
|
|
<td>Shows reply interface to the user, as if they manually selected the bot's message and tapped 'Reply'</td>
|
|
</tr>
|
|
<tr>
|
|
<td>input_field_placeholder</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. The placeholder to be shown in the input field when the reply is active; 1-64 characters</td>
|
|
</tr>
|
|
<tr>
|
|
<td>selective</td>
|
|
<td>Boolean</td>
|
|
<td><em>Optional</em>. Use this parameter if you want to force reply from specific users only. Targets: 1) users that are @mentioned in the <em>text</em> of the <a href="#message">Message</a> object; 2) if the bot's message is a reply (has <em>reply_to_message_id</em>), sender of the original message.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<blockquote>
|
|
<p><strong>Example:</strong> A <a href="https://t.me/PollBot">poll bot</a> for groups runs in privacy mode (only receives commands, replies to its messages and mentions). There could be two ways to create a new poll:</p>
|
|
<ul>
|
|
<li>Explain the user how to send a command with parameters (e.g. /newpoll question answer1 answer2). May be appealing for hardcore users but lacks modern day polish.</li>
|
|
<li>Guide the user through a step-by-step process. 'Please send me your question', 'Cool, now let's add the first answer option', 'Great. Keep adding answer options, then send /done when you're ready'.</li>
|
|
</ul>
|
|
<p>The last option is definitely more attractive. And if you use <a href="#forcereply">ForceReply</a> in your bot's questions, it will receive the user's answers even if it only receives replies, commands and mentions - without any extra work for the user.</p>
|
|
</blockquote>
|
|
<h4><a class="anchor" name="chatphoto" href="#chatphoto"><i class="anchor-icon"></i></a>ChatPhoto</h4>
|
|
<p>This object represents a chat photo.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>small_file_id</td>
|
|
<td>String</td>
|
|
<td>File identifier of small (160x160) chat photo. This file_id can be used only for photo download and only for as long as the photo is not changed.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>small_file_unique_id</td>
|
|
<td>String</td>
|
|
<td>Unique file identifier of small (160x160) chat photo, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>big_file_id</td>
|
|
<td>String</td>
|
|
<td>File identifier of big (640x640) chat photo. This file_id can be used only for photo download and only for as long as the photo is not changed.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>big_file_unique_id</td>
|
|
<td>String</td>
|
|
<td>Unique file identifier of big (640x640) chat photo, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="chatinvitelink" href="#chatinvitelink"><i class="anchor-icon"></i></a>ChatInviteLink</h4>
|
|
<p>Represents an invite link for a chat.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>invite_link</td>
|
|
<td>String</td>
|
|
<td>The invite link. If the link was created by another chat administrator, then the second part of the link will be replaced with “…”.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>creator</td>
|
|
<td><a href="#user">User</a></td>
|
|
<td>Creator of the link</td>
|
|
</tr>
|
|
<tr>
|
|
<td>creates_join_request</td>
|
|
<td>Boolean</td>
|
|
<td><em>True</em>, if users joining the chat via the link need to be approved by chat administrators</td>
|
|
</tr>
|
|
<tr>
|
|
<td>is_primary</td>
|
|
<td>Boolean</td>
|
|
<td><em>True</em>, if the link is primary</td>
|
|
</tr>
|
|
<tr>
|
|
<td>is_revoked</td>
|
|
<td>Boolean</td>
|
|
<td><em>True</em>, if the link is revoked</td>
|
|
</tr>
|
|
<tr>
|
|
<td>name</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Invite link name</td>
|
|
</tr>
|
|
<tr>
|
|
<td>expire_date</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. Point in time (Unix timestamp) when the link will expire or has been expired</td>
|
|
</tr>
|
|
<tr>
|
|
<td>member_limit</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999</td>
|
|
</tr>
|
|
<tr>
|
|
<td>pending_join_request_count</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. Number of pending join requests created using this link</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="chatadministratorrights" href="#chatadministratorrights"><i class="anchor-icon"></i></a>ChatAdministratorRights</h4>
|
|
<p>Represents the rights of an administrator in a chat.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>is_anonymous</td>
|
|
<td>Boolean</td>
|
|
<td><em>True</em>, if the user's presence in the chat is hidden</td>
|
|
</tr>
|
|
<tr>
|
|
<td>can_manage_chat</td>
|
|
<td>Boolean</td>
|
|
<td><em>True</em>, if the administrator can access the chat event log, chat statistics, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege</td>
|
|
</tr>
|
|
<tr>
|
|
<td>can_delete_messages</td>
|
|
<td>Boolean</td>
|
|
<td><em>True</em>, if the administrator can delete messages of other users</td>
|
|
</tr>
|
|
<tr>
|
|
<td>can_manage_video_chats</td>
|
|
<td>Boolean</td>
|
|
<td><em>True</em>, if the administrator can manage video chats</td>
|
|
</tr>
|
|
<tr>
|
|
<td>can_restrict_members</td>
|
|
<td>Boolean</td>
|
|
<td><em>True</em>, if the administrator can restrict, ban or unban chat members</td>
|
|
</tr>
|
|
<tr>
|
|
<td>can_promote_members</td>
|
|
<td>Boolean</td>
|
|
<td><em>True</em>, if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by the user)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>can_change_info</td>
|
|
<td>Boolean</td>
|
|
<td><em>True</em>, if the user is allowed to change the chat title, photo and other settings</td>
|
|
</tr>
|
|
<tr>
|
|
<td>can_invite_users</td>
|
|
<td>Boolean</td>
|
|
<td><em>True</em>, if the user is allowed to invite new users to the chat</td>
|
|
</tr>
|
|
<tr>
|
|
<td>can_post_messages</td>
|
|
<td>Boolean</td>
|
|
<td><em>Optional</em>. <em>True</em>, if the administrator can post in the channel; channels only</td>
|
|
</tr>
|
|
<tr>
|
|
<td>can_edit_messages</td>
|
|
<td>Boolean</td>
|
|
<td><em>Optional</em>. <em>True</em>, if the administrator can edit messages of other users and can pin messages; channels only</td>
|
|
</tr>
|
|
<tr>
|
|
<td>can_pin_messages</td>
|
|
<td>Boolean</td>
|
|
<td><em>Optional</em>. <em>True</em>, if the user is allowed to pin messages; groups and supergroups only</td>
|
|
</tr>
|
|
<tr>
|
|
<td>can_manage_topics</td>
|
|
<td>Boolean</td>
|
|
<td><em>Optional</em>. <em>True</em>, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="chatmember" href="#chatmember"><i class="anchor-icon"></i></a>ChatMember</h4>
|
|
<p>This object contains information about one member of a chat. Currently, the following 6 types of chat members are supported:</p>
|
|
<ul>
|
|
<li><a href="#chatmemberowner">ChatMemberOwner</a></li>
|
|
<li><a href="#chatmemberadministrator">ChatMemberAdministrator</a></li>
|
|
<li><a href="#chatmembermember">ChatMemberMember</a></li>
|
|
<li><a href="#chatmemberrestricted">ChatMemberRestricted</a></li>
|
|
<li><a href="#chatmemberleft">ChatMemberLeft</a></li>
|
|
<li><a href="#chatmemberbanned">ChatMemberBanned</a></li>
|
|
</ul>
|
|
<h4><a class="anchor" name="chatmemberowner" href="#chatmemberowner"><i class="anchor-icon"></i></a>ChatMemberOwner</h4>
|
|
<p>Represents a <a href="#chatmember">chat member</a> that owns the chat and has all administrator privileges.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>status</td>
|
|
<td>String</td>
|
|
<td>The member's status in the chat, always “creator”</td>
|
|
</tr>
|
|
<tr>
|
|
<td>user</td>
|
|
<td><a href="#user">User</a></td>
|
|
<td>Information about the user</td>
|
|
</tr>
|
|
<tr>
|
|
<td>is_anonymous</td>
|
|
<td>Boolean</td>
|
|
<td><em>True</em>, if the user's presence in the chat is hidden</td>
|
|
</tr>
|
|
<tr>
|
|
<td>custom_title</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Custom title for this user</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="chatmemberadministrator" href="#chatmemberadministrator"><i class="anchor-icon"></i></a>ChatMemberAdministrator</h4>
|
|
<p>Represents a <a href="#chatmember">chat member</a> that has some additional privileges.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>status</td>
|
|
<td>String</td>
|
|
<td>The member's status in the chat, always “administrator”</td>
|
|
</tr>
|
|
<tr>
|
|
<td>user</td>
|
|
<td><a href="#user">User</a></td>
|
|
<td>Information about the user</td>
|
|
</tr>
|
|
<tr>
|
|
<td>can_be_edited</td>
|
|
<td>Boolean</td>
|
|
<td><em>True</em>, if the bot is allowed to edit administrator privileges of that user</td>
|
|
</tr>
|
|
<tr>
|
|
<td>is_anonymous</td>
|
|
<td>Boolean</td>
|
|
<td><em>True</em>, if the user's presence in the chat is hidden</td>
|
|
</tr>
|
|
<tr>
|
|
<td>can_manage_chat</td>
|
|
<td>Boolean</td>
|
|
<td><em>True</em>, if the administrator can access the chat event log, chat statistics, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege</td>
|
|
</tr>
|
|
<tr>
|
|
<td>can_delete_messages</td>
|
|
<td>Boolean</td>
|
|
<td><em>True</em>, if the administrator can delete messages of other users</td>
|
|
</tr>
|
|
<tr>
|
|
<td>can_manage_video_chats</td>
|
|
<td>Boolean</td>
|
|
<td><em>True</em>, if the administrator can manage video chats</td>
|
|
</tr>
|
|
<tr>
|
|
<td>can_restrict_members</td>
|
|
<td>Boolean</td>
|
|
<td><em>True</em>, if the administrator can restrict, ban or unban chat members</td>
|
|
</tr>
|
|
<tr>
|
|
<td>can_promote_members</td>
|
|
<td>Boolean</td>
|
|
<td><em>True</em>, if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by the user)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>can_change_info</td>
|
|
<td>Boolean</td>
|
|
<td><em>True</em>, if the user is allowed to change the chat title, photo and other settings</td>
|
|
</tr>
|
|
<tr>
|
|
<td>can_invite_users</td>
|
|
<td>Boolean</td>
|
|
<td><em>True</em>, if the user is allowed to invite new users to the chat</td>
|
|
</tr>
|
|
<tr>
|
|
<td>can_post_messages</td>
|
|
<td>Boolean</td>
|
|
<td><em>Optional</em>. <em>True</em>, if the administrator can post in the channel; channels only</td>
|
|
</tr>
|
|
<tr>
|
|
<td>can_edit_messages</td>
|
|
<td>Boolean</td>
|
|
<td><em>Optional</em>. <em>True</em>, if the administrator can edit messages of other users and can pin messages; channels only</td>
|
|
</tr>
|
|
<tr>
|
|
<td>can_pin_messages</td>
|
|
<td>Boolean</td>
|
|
<td><em>Optional</em>. <em>True</em>, if the user is allowed to pin messages; groups and supergroups only</td>
|
|
</tr>
|
|
<tr>
|
|
<td>can_manage_topics</td>
|
|
<td>Boolean</td>
|
|
<td><em>Optional</em>. <em>True</em>, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only</td>
|
|
</tr>
|
|
<tr>
|
|
<td>custom_title</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Custom title for this user</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="chatmembermember" href="#chatmembermember"><i class="anchor-icon"></i></a>ChatMemberMember</h4>
|
|
<p>Represents a <a href="#chatmember">chat member</a> that has no additional privileges or restrictions.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>status</td>
|
|
<td>String</td>
|
|
<td>The member's status in the chat, always “member”</td>
|
|
</tr>
|
|
<tr>
|
|
<td>user</td>
|
|
<td><a href="#user">User</a></td>
|
|
<td>Information about the user</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="chatmemberrestricted" href="#chatmemberrestricted"><i class="anchor-icon"></i></a>ChatMemberRestricted</h4>
|
|
<p>Represents a <a href="#chatmember">chat member</a> that is under certain restrictions in the chat. Supergroups only.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>status</td>
|
|
<td>String</td>
|
|
<td>The member's status in the chat, always “restricted”</td>
|
|
</tr>
|
|
<tr>
|
|
<td>user</td>
|
|
<td><a href="#user">User</a></td>
|
|
<td>Information about the user</td>
|
|
</tr>
|
|
<tr>
|
|
<td>is_member</td>
|
|
<td>Boolean</td>
|
|
<td><em>True</em>, if the user is a member of the chat at the moment of the request</td>
|
|
</tr>
|
|
<tr>
|
|
<td>can_send_messages</td>
|
|
<td>Boolean</td>
|
|
<td><em>True</em>, if the user is allowed to send text messages, contacts, invoices, locations and venues</td>
|
|
</tr>
|
|
<tr>
|
|
<td>can_send_audios</td>
|
|
<td>Boolean</td>
|
|
<td><em>True</em>, if the user is allowed to send audios</td>
|
|
</tr>
|
|
<tr>
|
|
<td>can_send_documents</td>
|
|
<td>Boolean</td>
|
|
<td><em>True</em>, if the user is allowed to send documents</td>
|
|
</tr>
|
|
<tr>
|
|
<td>can_send_photos</td>
|
|
<td>Boolean</td>
|
|
<td><em>True</em>, if the user is allowed to send photos</td>
|
|
</tr>
|
|
<tr>
|
|
<td>can_send_videos</td>
|
|
<td>Boolean</td>
|
|
<td><em>True</em>, if the user is allowed to send videos</td>
|
|
</tr>
|
|
<tr>
|
|
<td>can_send_video_notes</td>
|
|
<td>Boolean</td>
|
|
<td><em>True</em>, if the user is allowed to send video notes</td>
|
|
</tr>
|
|
<tr>
|
|
<td>can_send_voice_notes</td>
|
|
<td>Boolean</td>
|
|
<td><em>True</em>, if the user is allowed to send voice notes</td>
|
|
</tr>
|
|
<tr>
|
|
<td>can_send_polls</td>
|
|
<td>Boolean</td>
|
|
<td><em>True</em>, if the user is allowed to send polls</td>
|
|
</tr>
|
|
<tr>
|
|
<td>can_send_other_messages</td>
|
|
<td>Boolean</td>
|
|
<td><em>True</em>, if the user is allowed to send animations, games, stickers and use inline bots</td>
|
|
</tr>
|
|
<tr>
|
|
<td>can_add_web_page_previews</td>
|
|
<td>Boolean</td>
|
|
<td><em>True</em>, if the user is allowed to add web page previews to their messages</td>
|
|
</tr>
|
|
<tr>
|
|
<td>can_change_info</td>
|
|
<td>Boolean</td>
|
|
<td><em>True</em>, if the user is allowed to change the chat title, photo and other settings</td>
|
|
</tr>
|
|
<tr>
|
|
<td>can_invite_users</td>
|
|
<td>Boolean</td>
|
|
<td><em>True</em>, if the user is allowed to invite new users to the chat</td>
|
|
</tr>
|
|
<tr>
|
|
<td>can_pin_messages</td>
|
|
<td>Boolean</td>
|
|
<td><em>True</em>, if the user is allowed to pin messages</td>
|
|
</tr>
|
|
<tr>
|
|
<td>can_manage_topics</td>
|
|
<td>Boolean</td>
|
|
<td><em>True</em>, if the user is allowed to create forum topics</td>
|
|
</tr>
|
|
<tr>
|
|
<td>until_date</td>
|
|
<td>Integer</td>
|
|
<td>Date when restrictions will be lifted for this user; unix time. If 0, then the user is restricted forever</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="chatmemberleft" href="#chatmemberleft"><i class="anchor-icon"></i></a>ChatMemberLeft</h4>
|
|
<p>Represents a <a href="#chatmember">chat member</a> that isn't currently a member of the chat, but may join it themselves.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>status</td>
|
|
<td>String</td>
|
|
<td>The member's status in the chat, always “left”</td>
|
|
</tr>
|
|
<tr>
|
|
<td>user</td>
|
|
<td><a href="#user">User</a></td>
|
|
<td>Information about the user</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="chatmemberbanned" href="#chatmemberbanned"><i class="anchor-icon"></i></a>ChatMemberBanned</h4>
|
|
<p>Represents a <a href="#chatmember">chat member</a> that was banned in the chat and can't return to the chat or view chat messages.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>status</td>
|
|
<td>String</td>
|
|
<td>The member's status in the chat, always “kicked”</td>
|
|
</tr>
|
|
<tr>
|
|
<td>user</td>
|
|
<td><a href="#user">User</a></td>
|
|
<td>Information about the user</td>
|
|
</tr>
|
|
<tr>
|
|
<td>until_date</td>
|
|
<td>Integer</td>
|
|
<td>Date when restrictions will be lifted for this user; unix time. If 0, then the user is banned forever</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="chatmemberupdated" href="#chatmemberupdated"><i class="anchor-icon"></i></a>ChatMemberUpdated</h4>
|
|
<p>This object represents changes in the status of a chat member.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat</td>
|
|
<td><a href="#chat">Chat</a></td>
|
|
<td>Chat the user belongs to</td>
|
|
</tr>
|
|
<tr>
|
|
<td>from</td>
|
|
<td><a href="#user">User</a></td>
|
|
<td>Performer of the action, which resulted in the change</td>
|
|
</tr>
|
|
<tr>
|
|
<td>date</td>
|
|
<td>Integer</td>
|
|
<td>Date the change was done in Unix time</td>
|
|
</tr>
|
|
<tr>
|
|
<td>old_chat_member</td>
|
|
<td><a href="#chatmember">ChatMember</a></td>
|
|
<td>Previous information about the chat member</td>
|
|
</tr>
|
|
<tr>
|
|
<td>new_chat_member</td>
|
|
<td><a href="#chatmember">ChatMember</a></td>
|
|
<td>New information about the chat member</td>
|
|
</tr>
|
|
<tr>
|
|
<td>invite_link</td>
|
|
<td><a href="#chatinvitelink">ChatInviteLink</a></td>
|
|
<td><em>Optional</em>. Chat invite link, which was used by the user to join the chat; for joining by invite link events only.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>via_chat_folder_invite_link</td>
|
|
<td>Boolean</td>
|
|
<td><em>Optional</em>. True, if the user joined the chat via a chat folder invite link</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="chatjoinrequest" href="#chatjoinrequest"><i class="anchor-icon"></i></a>ChatJoinRequest</h4>
|
|
<p>Represents a join request sent to a chat.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat</td>
|
|
<td><a href="#chat">Chat</a></td>
|
|
<td>Chat to which the request was sent</td>
|
|
</tr>
|
|
<tr>
|
|
<td>from</td>
|
|
<td><a href="#user">User</a></td>
|
|
<td>User that sent the join request</td>
|
|
</tr>
|
|
<tr>
|
|
<td>user_chat_id</td>
|
|
<td>Integer</td>
|
|
<td>Identifier of a private chat with the user who sent the join request. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. The bot can use this identifier for 24 hours to send messages until the join request is processed, assuming no other administrator contacted the user.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>date</td>
|
|
<td>Integer</td>
|
|
<td>Date the request was sent in Unix time</td>
|
|
</tr>
|
|
<tr>
|
|
<td>bio</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Bio of the user.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>invite_link</td>
|
|
<td><a href="#chatinvitelink">ChatInviteLink</a></td>
|
|
<td><em>Optional</em>. Chat invite link that was used by the user to send the join request</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="chatpermissions" href="#chatpermissions"><i class="anchor-icon"></i></a>ChatPermissions</h4>
|
|
<p>Describes actions that a non-administrator user is allowed to take in a chat.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>can_send_messages</td>
|
|
<td>Boolean</td>
|
|
<td><em>Optional</em>. <em>True</em>, if the user is allowed to send text messages, contacts, invoices, locations and venues</td>
|
|
</tr>
|
|
<tr>
|
|
<td>can_send_audios</td>
|
|
<td>Boolean</td>
|
|
<td><em>Optional</em>. <em>True</em>, if the user is allowed to send audios</td>
|
|
</tr>
|
|
<tr>
|
|
<td>can_send_documents</td>
|
|
<td>Boolean</td>
|
|
<td><em>Optional</em>. <em>True</em>, if the user is allowed to send documents</td>
|
|
</tr>
|
|
<tr>
|
|
<td>can_send_photos</td>
|
|
<td>Boolean</td>
|
|
<td><em>Optional</em>. <em>True</em>, if the user is allowed to send photos</td>
|
|
</tr>
|
|
<tr>
|
|
<td>can_send_videos</td>
|
|
<td>Boolean</td>
|
|
<td><em>Optional</em>. <em>True</em>, if the user is allowed to send videos</td>
|
|
</tr>
|
|
<tr>
|
|
<td>can_send_video_notes</td>
|
|
<td>Boolean</td>
|
|
<td><em>Optional</em>. <em>True</em>, if the user is allowed to send video notes</td>
|
|
</tr>
|
|
<tr>
|
|
<td>can_send_voice_notes</td>
|
|
<td>Boolean</td>
|
|
<td><em>Optional</em>. <em>True</em>, if the user is allowed to send voice notes</td>
|
|
</tr>
|
|
<tr>
|
|
<td>can_send_polls</td>
|
|
<td>Boolean</td>
|
|
<td><em>Optional</em>. <em>True</em>, if the user is allowed to send polls</td>
|
|
</tr>
|
|
<tr>
|
|
<td>can_send_other_messages</td>
|
|
<td>Boolean</td>
|
|
<td><em>Optional</em>. <em>True</em>, if the user is allowed to send animations, games, stickers and use inline bots</td>
|
|
</tr>
|
|
<tr>
|
|
<td>can_add_web_page_previews</td>
|
|
<td>Boolean</td>
|
|
<td><em>Optional</em>. <em>True</em>, if the user is allowed to add web page previews to their messages</td>
|
|
</tr>
|
|
<tr>
|
|
<td>can_change_info</td>
|
|
<td>Boolean</td>
|
|
<td><em>Optional</em>. <em>True</em>, if the user is allowed to change the chat title, photo and other settings. Ignored in public supergroups</td>
|
|
</tr>
|
|
<tr>
|
|
<td>can_invite_users</td>
|
|
<td>Boolean</td>
|
|
<td><em>Optional</em>. <em>True</em>, if the user is allowed to invite new users to the chat</td>
|
|
</tr>
|
|
<tr>
|
|
<td>can_pin_messages</td>
|
|
<td>Boolean</td>
|
|
<td><em>Optional</em>. <em>True</em>, if the user is allowed to pin messages. Ignored in public supergroups</td>
|
|
</tr>
|
|
<tr>
|
|
<td>can_manage_topics</td>
|
|
<td>Boolean</td>
|
|
<td><em>Optional</em>. <em>True</em>, if the user is allowed to create forum topics. If omitted defaults to the value of can_pin_messages</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="chatlocation" href="#chatlocation"><i class="anchor-icon"></i></a>ChatLocation</h4>
|
|
<p>Represents a location to which a chat is connected.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>location</td>
|
|
<td><a href="#location">Location</a></td>
|
|
<td>The location to which the supergroup is connected. Can't be a live location.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>address</td>
|
|
<td>String</td>
|
|
<td>Location address; 1-64 characters, as defined by the chat owner</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="forumtopic" href="#forumtopic"><i class="anchor-icon"></i></a>ForumTopic</h4>
|
|
<p>This object represents a forum topic.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>message_thread_id</td>
|
|
<td>Integer</td>
|
|
<td>Unique identifier of the forum topic</td>
|
|
</tr>
|
|
<tr>
|
|
<td>name</td>
|
|
<td>String</td>
|
|
<td>Name of the topic</td>
|
|
</tr>
|
|
<tr>
|
|
<td>icon_color</td>
|
|
<td>Integer</td>
|
|
<td>Color of the topic icon in RGB format</td>
|
|
</tr>
|
|
<tr>
|
|
<td>icon_custom_emoji_id</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Unique identifier of the custom emoji shown as the topic icon</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="botcommand" href="#botcommand"><i class="anchor-icon"></i></a>BotCommand</h4>
|
|
<p>This object represents a bot command.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>command</td>
|
|
<td>String</td>
|
|
<td>Text of the command; 1-32 characters. Can contain only lowercase English letters, digits and underscores.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>description</td>
|
|
<td>String</td>
|
|
<td>Description of the command; 1-256 characters.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="botcommandscope" href="#botcommandscope"><i class="anchor-icon"></i></a>BotCommandScope</h4>
|
|
<p>This object represents the scope to which bot commands are applied. Currently, the following 7 scopes are supported:</p>
|
|
<ul>
|
|
<li><a href="#botcommandscopedefault">BotCommandScopeDefault</a></li>
|
|
<li><a href="#botcommandscopeallprivatechats">BotCommandScopeAllPrivateChats</a></li>
|
|
<li><a href="#botcommandscopeallgroupchats">BotCommandScopeAllGroupChats</a></li>
|
|
<li><a href="#botcommandscopeallchatadministrators">BotCommandScopeAllChatAdministrators</a></li>
|
|
<li><a href="#botcommandscopechat">BotCommandScopeChat</a></li>
|
|
<li><a href="#botcommandscopechatadministrators">BotCommandScopeChatAdministrators</a></li>
|
|
<li><a href="#botcommandscopechatmember">BotCommandScopeChatMember</a></li>
|
|
</ul>
|
|
<h4><a class="anchor" name="determining-list-of-commands" href="#determining-list-of-commands"><i class="anchor-icon"></i></a>Determining list of commands</h4>
|
|
<p>The following algorithm is used to determine the list of commands for a particular user viewing the bot menu. The first list of commands which is set is returned:</p>
|
|
<p><strong>Commands in the chat with the bot</strong></p>
|
|
<ul>
|
|
<li>botCommandScopeChat + language_code</li>
|
|
<li>botCommandScopeChat</li>
|
|
<li>botCommandScopeAllPrivateChats + language_code</li>
|
|
<li>botCommandScopeAllPrivateChats</li>
|
|
<li>botCommandScopeDefault + language_code</li>
|
|
<li>botCommandScopeDefault</li>
|
|
</ul>
|
|
<p><strong>Commands in group and supergroup chats</strong></p>
|
|
<ul>
|
|
<li>botCommandScopeChatMember + language_code</li>
|
|
<li>botCommandScopeChatMember</li>
|
|
<li>botCommandScopeChatAdministrators + language_code (administrators only)</li>
|
|
<li>botCommandScopeChatAdministrators (administrators only)</li>
|
|
<li>botCommandScopeChat + language_code</li>
|
|
<li>botCommandScopeChat</li>
|
|
<li>botCommandScopeAllChatAdministrators + language_code (administrators only)</li>
|
|
<li>botCommandScopeAllChatAdministrators (administrators only)</li>
|
|
<li>botCommandScopeAllGroupChats + language_code</li>
|
|
<li>botCommandScopeAllGroupChats</li>
|
|
<li>botCommandScopeDefault + language_code</li>
|
|
<li>botCommandScopeDefault</li>
|
|
</ul>
|
|
<h4><a class="anchor" name="botcommandscopedefault" href="#botcommandscopedefault"><i class="anchor-icon"></i></a>BotCommandScopeDefault</h4>
|
|
<p>Represents the default <a href="#botcommandscope">scope</a> of bot commands. Default commands are used if no commands with a <a href="#determining-list-of-commands">narrower scope</a> are specified for the user.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>type</td>
|
|
<td>String</td>
|
|
<td>Scope type, must be <em>default</em></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="botcommandscopeallprivatechats" href="#botcommandscopeallprivatechats"><i class="anchor-icon"></i></a>BotCommandScopeAllPrivateChats</h4>
|
|
<p>Represents the <a href="#botcommandscope">scope</a> of bot commands, covering all private chats.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>type</td>
|
|
<td>String</td>
|
|
<td>Scope type, must be <em>all_private_chats</em></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="botcommandscopeallgroupchats" href="#botcommandscopeallgroupchats"><i class="anchor-icon"></i></a>BotCommandScopeAllGroupChats</h4>
|
|
<p>Represents the <a href="#botcommandscope">scope</a> of bot commands, covering all group and supergroup chats.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>type</td>
|
|
<td>String</td>
|
|
<td>Scope type, must be <em>all_group_chats</em></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="botcommandscopeallchatadministrators" href="#botcommandscopeallchatadministrators"><i class="anchor-icon"></i></a>BotCommandScopeAllChatAdministrators</h4>
|
|
<p>Represents the <a href="#botcommandscope">scope</a> of bot commands, covering all group and supergroup chat administrators.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>type</td>
|
|
<td>String</td>
|
|
<td>Scope type, must be <em>all_chat_administrators</em></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="botcommandscopechat" href="#botcommandscopechat"><i class="anchor-icon"></i></a>BotCommandScopeChat</h4>
|
|
<p>Represents the <a href="#botcommandscope">scope</a> of bot commands, covering a specific chat.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>type</td>
|
|
<td>String</td>
|
|
<td>Scope type, must be <em>chat</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Unique identifier for the target chat or username of the target supergroup (in the format <code>@supergroupusername</code>)</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="botcommandscopechatadministrators" href="#botcommandscopechatadministrators"><i class="anchor-icon"></i></a>BotCommandScopeChatAdministrators</h4>
|
|
<p>Represents the <a href="#botcommandscope">scope</a> of bot commands, covering all administrators of a specific group or supergroup chat.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>type</td>
|
|
<td>String</td>
|
|
<td>Scope type, must be <em>chat_administrators</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Unique identifier for the target chat or username of the target supergroup (in the format <code>@supergroupusername</code>)</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="botcommandscopechatmember" href="#botcommandscopechatmember"><i class="anchor-icon"></i></a>BotCommandScopeChatMember</h4>
|
|
<p>Represents the <a href="#botcommandscope">scope</a> of bot commands, covering a specific member of a group or supergroup chat.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>type</td>
|
|
<td>String</td>
|
|
<td>Scope type, must be <em>chat_member</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Unique identifier for the target chat or username of the target supergroup (in the format <code>@supergroupusername</code>)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>user_id</td>
|
|
<td>Integer</td>
|
|
<td>Unique identifier of the target user</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="botname" href="#botname"><i class="anchor-icon"></i></a>BotName</h4>
|
|
<p>This object represents the bot's name.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>name</td>
|
|
<td>String</td>
|
|
<td>The bot's name</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="botdescription" href="#botdescription"><i class="anchor-icon"></i></a>BotDescription</h4>
|
|
<p>This object represents the bot's description.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>description</td>
|
|
<td>String</td>
|
|
<td>The bot's description</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="botshortdescription" href="#botshortdescription"><i class="anchor-icon"></i></a>BotShortDescription</h4>
|
|
<p>This object represents the bot's short description.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>short_description</td>
|
|
<td>String</td>
|
|
<td>The bot's short description</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="menubutton" href="#menubutton"><i class="anchor-icon"></i></a>MenuButton</h4>
|
|
<p>This object describes the bot's menu button in a private chat. It should be one of</p>
|
|
<ul>
|
|
<li><a href="#menubuttoncommands">MenuButtonCommands</a></li>
|
|
<li><a href="#menubuttonwebapp">MenuButtonWebApp</a></li>
|
|
<li><a href="#menubuttondefault">MenuButtonDefault</a></li>
|
|
</ul>
|
|
<p>If a menu button other than <a href="#menubuttondefault">MenuButtonDefault</a> is set for a private chat, then it is applied in the chat. Otherwise the default menu button is applied. By default, the menu button opens the list of bot commands.</p>
|
|
<h4><a class="anchor" name="menubuttoncommands" href="#menubuttoncommands"><i class="anchor-icon"></i></a>MenuButtonCommands</h4>
|
|
<p>Represents a menu button, which opens the bot's list of commands.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>type</td>
|
|
<td>String</td>
|
|
<td>Type of the button, must be <em>commands</em></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="menubuttonwebapp" href="#menubuttonwebapp"><i class="anchor-icon"></i></a>MenuButtonWebApp</h4>
|
|
<p>Represents a menu button, which launches a <a href="/bots/webapps">Web App</a>.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>type</td>
|
|
<td>String</td>
|
|
<td>Type of the button, must be <em>web_app</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>text</td>
|
|
<td>String</td>
|
|
<td>Text on the button</td>
|
|
</tr>
|
|
<tr>
|
|
<td>web_app</td>
|
|
<td><a href="#webappinfo">WebAppInfo</a></td>
|
|
<td>Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method <a href="#answerwebappquery">answerWebAppQuery</a>.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="menubuttondefault" href="#menubuttondefault"><i class="anchor-icon"></i></a>MenuButtonDefault</h4>
|
|
<p>Describes that no specific value for the menu button was set.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>type</td>
|
|
<td>String</td>
|
|
<td>Type of the button, must be <em>default</em></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="responseparameters" href="#responseparameters"><i class="anchor-icon"></i></a>ResponseParameters</h4>
|
|
<p>Describes why a request was unsuccessful.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>migrate_to_chat_id</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. The group has been migrated to a supergroup with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>retry_after</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. In case of exceeding flood control, the number of seconds left to wait before the request can be repeated</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="inputmedia" href="#inputmedia"><i class="anchor-icon"></i></a>InputMedia</h4>
|
|
<p>This object represents the content of a media message to be sent. It should be one of</p>
|
|
<ul>
|
|
<li><a href="#inputmediaanimation">InputMediaAnimation</a></li>
|
|
<li><a href="#inputmediadocument">InputMediaDocument</a></li>
|
|
<li><a href="#inputmediaaudio">InputMediaAudio</a></li>
|
|
<li><a href="#inputmediaphoto">InputMediaPhoto</a></li>
|
|
<li><a href="#inputmediavideo">InputMediaVideo</a></li>
|
|
</ul>
|
|
<h4><a class="anchor" name="inputmediaphoto" href="#inputmediaphoto"><i class="anchor-icon"></i></a>InputMediaPhoto</h4>
|
|
<p>Represents a photo to be sent.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>type</td>
|
|
<td>String</td>
|
|
<td>Type of the result, must be <em>photo</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>media</td>
|
|
<td>String</td>
|
|
<td>File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. <a href="#sending-files">More information on Sending Files »</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td>caption</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Caption of the photo to be sent, 0-1024 characters after entities parsing</td>
|
|
</tr>
|
|
<tr>
|
|
<td>parse_mode</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Mode for parsing entities in the photo caption. See <a href="#formatting-options">formatting options</a> for more details.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>caption_entities</td>
|
|
<td>Array of <a href="#messageentity">MessageEntity</a></td>
|
|
<td><em>Optional</em>. List of special entities that appear in the caption, which can be specified instead of <em>parse_mode</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>has_spoiler</td>
|
|
<td>Boolean</td>
|
|
<td><em>Optional</em>. Pass <em>True</em> if the photo needs to be covered with a spoiler animation</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="inputmediavideo" href="#inputmediavideo"><i class="anchor-icon"></i></a>InputMediaVideo</h4>
|
|
<p>Represents a video to be sent.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>type</td>
|
|
<td>String</td>
|
|
<td>Type of the result, must be <em>video</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>media</td>
|
|
<td>String</td>
|
|
<td>File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. <a href="#sending-files">More information on Sending Files »</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td>thumbnail</td>
|
|
<td><a href="#inputfile">InputFile</a> or String</td>
|
|
<td><em>Optional</em>. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. <a href="#sending-files">More information on Sending Files »</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td>caption</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Caption of the video to be sent, 0-1024 characters after entities parsing</td>
|
|
</tr>
|
|
<tr>
|
|
<td>parse_mode</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Mode for parsing entities in the video caption. See <a href="#formatting-options">formatting options</a> for more details.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>caption_entities</td>
|
|
<td>Array of <a href="#messageentity">MessageEntity</a></td>
|
|
<td><em>Optional</em>. List of special entities that appear in the caption, which can be specified instead of <em>parse_mode</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>width</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. Video width</td>
|
|
</tr>
|
|
<tr>
|
|
<td>height</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. Video height</td>
|
|
</tr>
|
|
<tr>
|
|
<td>duration</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. Video duration in seconds</td>
|
|
</tr>
|
|
<tr>
|
|
<td>supports_streaming</td>
|
|
<td>Boolean</td>
|
|
<td><em>Optional</em>. Pass <em>True</em> if the uploaded video is suitable for streaming</td>
|
|
</tr>
|
|
<tr>
|
|
<td>has_spoiler</td>
|
|
<td>Boolean</td>
|
|
<td><em>Optional</em>. Pass <em>True</em> if the video needs to be covered with a spoiler animation</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="inputmediaanimation" href="#inputmediaanimation"><i class="anchor-icon"></i></a>InputMediaAnimation</h4>
|
|
<p>Represents an animation file (GIF or H.264/MPEG-4 AVC video without sound) to be sent.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>type</td>
|
|
<td>String</td>
|
|
<td>Type of the result, must be <em>animation</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>media</td>
|
|
<td>String</td>
|
|
<td>File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. <a href="#sending-files">More information on Sending Files »</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td>thumbnail</td>
|
|
<td><a href="#inputfile">InputFile</a> or String</td>
|
|
<td><em>Optional</em>. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. <a href="#sending-files">More information on Sending Files »</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td>caption</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Caption of the animation to be sent, 0-1024 characters after entities parsing</td>
|
|
</tr>
|
|
<tr>
|
|
<td>parse_mode</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Mode for parsing entities in the animation caption. See <a href="#formatting-options">formatting options</a> for more details.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>caption_entities</td>
|
|
<td>Array of <a href="#messageentity">MessageEntity</a></td>
|
|
<td><em>Optional</em>. List of special entities that appear in the caption, which can be specified instead of <em>parse_mode</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>width</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. Animation width</td>
|
|
</tr>
|
|
<tr>
|
|
<td>height</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. Animation height</td>
|
|
</tr>
|
|
<tr>
|
|
<td>duration</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. Animation duration in seconds</td>
|
|
</tr>
|
|
<tr>
|
|
<td>has_spoiler</td>
|
|
<td>Boolean</td>
|
|
<td><em>Optional</em>. Pass <em>True</em> if the animation needs to be covered with a spoiler animation</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="inputmediaaudio" href="#inputmediaaudio"><i class="anchor-icon"></i></a>InputMediaAudio</h4>
|
|
<p>Represents an audio file to be treated as music to be sent.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>type</td>
|
|
<td>String</td>
|
|
<td>Type of the result, must be <em>audio</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>media</td>
|
|
<td>String</td>
|
|
<td>File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. <a href="#sending-files">More information on Sending Files »</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td>thumbnail</td>
|
|
<td><a href="#inputfile">InputFile</a> or String</td>
|
|
<td><em>Optional</em>. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. <a href="#sending-files">More information on Sending Files »</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td>caption</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Caption of the audio to be sent, 0-1024 characters after entities parsing</td>
|
|
</tr>
|
|
<tr>
|
|
<td>parse_mode</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Mode for parsing entities in the audio caption. See <a href="#formatting-options">formatting options</a> for more details.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>caption_entities</td>
|
|
<td>Array of <a href="#messageentity">MessageEntity</a></td>
|
|
<td><em>Optional</em>. List of special entities that appear in the caption, which can be specified instead of <em>parse_mode</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>duration</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. Duration of the audio in seconds</td>
|
|
</tr>
|
|
<tr>
|
|
<td>performer</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Performer of the audio</td>
|
|
</tr>
|
|
<tr>
|
|
<td>title</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Title of the audio</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="inputmediadocument" href="#inputmediadocument"><i class="anchor-icon"></i></a>InputMediaDocument</h4>
|
|
<p>Represents a general file to be sent.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>type</td>
|
|
<td>String</td>
|
|
<td>Type of the result, must be <em>document</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>media</td>
|
|
<td>String</td>
|
|
<td>File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. <a href="#sending-files">More information on Sending Files »</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td>thumbnail</td>
|
|
<td><a href="#inputfile">InputFile</a> or String</td>
|
|
<td><em>Optional</em>. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. <a href="#sending-files">More information on Sending Files »</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td>caption</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Caption of the document to be sent, 0-1024 characters after entities parsing</td>
|
|
</tr>
|
|
<tr>
|
|
<td>parse_mode</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Mode for parsing entities in the document caption. See <a href="#formatting-options">formatting options</a> for more details.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>caption_entities</td>
|
|
<td>Array of <a href="#messageentity">MessageEntity</a></td>
|
|
<td><em>Optional</em>. List of special entities that appear in the caption, which can be specified instead of <em>parse_mode</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>disable_content_type_detection</td>
|
|
<td>Boolean</td>
|
|
<td><em>Optional</em>. Disables automatic server-side content type detection for files uploaded using multipart/form-data. Always <em>True</em>, if the document is sent as part of an album.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="inputfile" href="#inputfile"><i class="anchor-icon"></i></a>InputFile</h4>
|
|
<p>This object represents the contents of a file to be uploaded. Must be posted using multipart/form-data in the usual way that files are uploaded via the browser.</p>
|
|
<h4><a class="anchor" name="sending-files" href="#sending-files"><i class="anchor-icon"></i></a>Sending files</h4>
|
|
<p>There are three ways to send files (photos, stickers, audio, media, etc.):</p>
|
|
<ol>
|
|
<li>If the file is already stored somewhere on the Telegram servers, you don't need to reupload it: each file object has a <strong>file_id</strong> field, simply pass this <strong>file_id</strong> as a parameter instead of uploading. There are <strong>no limits</strong> for files sent this way.</li>
|
|
<li>Provide Telegram with an HTTP URL for the file to be sent. Telegram will download and send the file. 5 MB max size for photos and 20 MB max for other types of content.</li>
|
|
<li>Post the file using multipart/form-data in the usual way that files are uploaded via the browser. 10 MB max size for photos, 50 MB for other files.</li>
|
|
</ol>
|
|
<p><strong>Sending by file_id</strong></p>
|
|
<ul>
|
|
<li>It is not possible to change the file type when resending by <strong>file_id</strong>. I.e. a <a href="#video">video</a> can't be <a href="#sendphoto">sent as a photo</a>, a <a href="#photosize">photo</a> can't be <a href="#senddocument">sent as a document</a>, etc.</li>
|
|
<li>It is not possible to resend thumbnails.</li>
|
|
<li>Resending a photo by <strong>file_id</strong> will send all of its <a href="#photosize">sizes</a>.</li>
|
|
<li><strong>file_id</strong> is unique for each individual bot and <strong>can't</strong> be transferred from one bot to another.</li>
|
|
<li><strong>file_id</strong> uniquely identifies a file, but a file can have different valid <strong>file_id</strong>s even for the same bot.</li>
|
|
</ul>
|
|
<p><strong>Sending by URL</strong></p>
|
|
<ul>
|
|
<li>When sending by URL the target file must have the correct MIME type (e.g., audio/mpeg for <a href="#sendaudio">sendAudio</a>, etc.).</li>
|
|
<li>In <a href="#senddocument">sendDocument</a>, sending by URL will currently only work for <strong>GIF</strong>, <strong>PDF</strong> and <strong>ZIP</strong> files.</li>
|
|
<li>To use <a href="#sendvoice">sendVoice</a>, the file must have the type audio/ogg and be no more than 1MB in size. 1-20MB voice notes will be sent as files.</li>
|
|
<li>Other configurations may work but we can't guarantee that they will.</li>
|
|
</ul>
|
|
<h4><a class="anchor" name="inline-mode-objects" href="#inline-mode-objects"><i class="anchor-icon"></i></a>Inline mode objects</h4>
|
|
<p>Objects and methods used in the inline mode are described in the <a href="#inline-mode">Inline mode section</a>.</p>
|
|
<h3><a class="anchor" name="available-methods" href="#available-methods"><i class="anchor-icon"></i></a>Available methods</h3>
|
|
<blockquote>
|
|
<p>All methods in the Bot API are case-insensitive. We support <strong>GET</strong> and <strong>POST</strong> HTTP methods. Use either <a href="https://en.wikipedia.org/wiki/Query_string">URL query string</a> or <em>application/json</em> or <em>application/x-www-form-urlencoded</em> or <em>multipart/form-data</em> for passing parameters in Bot API requests.<br>On successful call, a JSON-object containing the result will be returned.</p>
|
|
</blockquote>
|
|
<h4><a class="anchor" name="getme" href="#getme"><i class="anchor-icon"></i></a>getMe</h4>
|
|
<p>A simple method for testing your bot's authentication token. Requires no parameters. Returns basic information about the bot in form of a <a href="#user">User</a> object.</p>
|
|
<h4><a class="anchor" name="logout" href="#logout"><i class="anchor-icon"></i></a>logOut</h4>
|
|
<p>Use this method to log out from the cloud Bot API server before launching the bot locally. You <strong>must</strong> log out the bot before running it locally, otherwise there is no guarantee that the bot will receive updates. After a successful call, you can immediately log in on a local server, but will not be able to log in back to the cloud Bot API server for 10 minutes. Returns <em>True</em> on success. Requires no parameters.</p>
|
|
<h4><a class="anchor" name="close" href="#close"><i class="anchor-icon"></i></a>close</h4>
|
|
<p>Use this method to close the bot instance before moving it from one local server to another. You need to delete the webhook before calling this method to ensure that the bot isn't launched again after server restart. The method will return error 429 in the first 10 minutes after the bot is launched. Returns <em>True</em> on success. Requires no parameters.</p>
|
|
<h4><a class="anchor" name="sendmessage" href="#sendmessage"><i class="anchor-icon"></i></a>sendMessage</h4>
|
|
<p>Use this method to send text messages. On success, the sent <a href="#message">Message</a> is returned.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the target chat or username of the target channel (in the format <code>@channelusername</code>)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>message_thread_id</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>Unique identifier for the target message thread (topic) of the forum; for forum supergroups only</td>
|
|
</tr>
|
|
<tr>
|
|
<td>text</td>
|
|
<td>String</td>
|
|
<td>Yes</td>
|
|
<td>Text of the message to be sent, 1-4096 characters after entities parsing</td>
|
|
</tr>
|
|
<tr>
|
|
<td>parse_mode</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>Mode for parsing entities in the message text. See <a href="#formatting-options">formatting options</a> for more details.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>entities</td>
|
|
<td>Array of <a href="#messageentity">MessageEntity</a></td>
|
|
<td>Optional</td>
|
|
<td>A JSON-serialized list of special entities that appear in message text, which can be specified instead of <em>parse_mode</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>disable_web_page_preview</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Disables link previews for links in this message</td>
|
|
</tr>
|
|
<tr>
|
|
<td>disable_notification</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Sends the message <a href="https://telegram.org/blog/channels-2-0#silent-messages">silently</a>. Users will receive a notification with no sound.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>protect_content</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Protects the contents of the sent message from forwarding and saving</td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply_to_message_id</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>If the message is a reply, ID of the original message</td>
|
|
</tr>
|
|
<tr>
|
|
<td>allow_sending_without_reply</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Pass <em>True</em> if the message should be sent even if the specified replied-to message is not found</td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply_markup</td>
|
|
<td><a href="#inlinekeyboardmarkup">InlineKeyboardMarkup</a> or <a href="#replykeyboardmarkup">ReplyKeyboardMarkup</a> or <a href="#replykeyboardremove">ReplyKeyboardRemove</a> or <a href="#forcereply">ForceReply</a></td>
|
|
<td>Optional</td>
|
|
<td>Additional interface options. A JSON-serialized object for an <a href="/bots/features#inline-keyboards">inline keyboard</a>, <a href="/bots/features#keyboards">custom reply keyboard</a>, instructions to remove reply keyboard or to force a reply from the user.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="formatting-options" href="#formatting-options"><i class="anchor-icon"></i></a>Formatting options</h4>
|
|
<p>The Bot API supports basic formatting for messages. You can use bold, italic, underlined, strikethrough, and spoiler text, as well as inline links and pre-formatted code in your bots' messages. Telegram clients will render them accordingly. You can specify text entities directly, or use markdown-style or HTML-style formatting.</p>
|
|
<p>Note that Telegram clients will display an <strong>alert</strong> to the user before opening an inline link ('Open this link?' together with the full URL).</p>
|
|
<p>Message entities can be nested, providing following restrictions are met:<br>- If two entities have common characters, then one of them is fully contained inside another.<br>- <em>bold</em>, <em>italic</em>, <em>underline</em>, <em>strikethrough</em>, and <em>spoiler</em> entities can contain and can be part of any other entities, except <em>pre</em> and <em>code</em>.<br>- All other entities can't contain each other.</p>
|
|
<p>Links <code>tg://user?id=<user_id></code> can be used to mention a user by their ID without using a username. Please note:</p>
|
|
<ul>
|
|
<li>These links will work <strong>only</strong> if they are used inside an inline link or in an inline keyboard button. For example, they will not work, when used in a message text.</li>
|
|
<li>Unless the user is a member of the chat where they were mentioned, these mentions are only guaranteed to work if the user has contacted the bot in private in the past or has sent a callback query to the bot via an inline button and doesn't have Forwarded Messages privacy enabled for the bot.</li>
|
|
</ul>
|
|
<h6><a class="anchor" name="markdownv2-style" href="#markdownv2-style"><i class="anchor-icon"></i></a>MarkdownV2 style</h6>
|
|
<p>To use this mode, pass <em>MarkdownV2</em> in the <em>parse_mode</em> field. Use the following syntax in your message:</p>
|
|
<pre><code>*bold \*text*
|
|
_italic \*text_
|
|
__underline__
|
|
~strikethrough~
|
|
||spoiler||
|
|
*bold _italic bold ~italic bold strikethrough ||italic bold strikethrough spoiler||~ __underline italic bold___ bold*
|
|
[inline URL](http://www.example.com/)
|
|
[inline mention of a user](tg://user?id=123456789)
|
|
![<img class="emoji" src="//telegram.org/img/emoji/40/F09F918D.png" width="20" height="20" alt="👍" />](tg://emoji?id=5368324170671202286)
|
|
`inline fixed-width code`
|
|
```
|
|
pre-formatted fixed-width code block
|
|
```
|
|
```python
|
|
pre-formatted fixed-width code block written in the Python programming language
|
|
```</code></pre>
|
|
<p>Please note:</p>
|
|
<ul>
|
|
<li>Any character with code between 1 and 126 inclusively can be escaped anywhere with a preceding '\' character, in which case it is treated as an ordinary character and not a part of the markup. This implies that '\' character usually must be escaped with a preceding '\' character.</li>
|
|
<li>Inside <code>pre</code> and <code>code</code> entities, all '`' and '\' characters must be escaped with a preceding '\' character.</li>
|
|
<li>Inside the <code>(...)</code> part of the inline link and custom emoji definition, all ')' and '\' must be escaped with a preceding '\' character.</li>
|
|
<li>In all other places characters '_', '*', '[', ']', '(', ')', '~', '`', '>', '#', '+', '-', '=', '|', '{', '}', '.', '!' must be escaped with the preceding character '\'.</li>
|
|
<li>In case of ambiguity between <code>italic</code> and <code>underline</code> entities <code>__</code> is always greadily treated from left to right as beginning or end of <code>underline</code> entity, so instead of <code>___italic underline___</code> use <code>___italic underline_\r__</code>, where <code>\r</code> is a character with code 13, which will be ignored.</li>
|
|
<li>A valid emoji must be provided as an alternative value for the custom emoji. The emoji will be shown instead of the custom emoji in places where a custom emoji cannot be displayed (e.g., system notifications) or if the message is forwarded by a non-premium user. It is recommended to use the emoji from the <strong>emoji</strong> field of the custom emoji <a href="#sticker">sticker</a>.</li>
|
|
<li>Custom emoji entities can only be used by bots that purchased additional usernames on <a href="https://fragment.com">Fragment</a>.</li>
|
|
</ul>
|
|
<h6><a class="anchor" name="html-style" href="#html-style"><i class="anchor-icon"></i></a>HTML style</h6>
|
|
<p>To use this mode, pass <em>HTML</em> in the <em>parse_mode</em> field. The following tags are currently supported:</p>
|
|
<pre><code><b>bold</b>, <strong>bold</strong>
|
|
<i>italic</i>, <em>italic</em>
|
|
<u>underline</u>, <ins>underline</ins>
|
|
<s>strikethrough</s>, <strike>strikethrough</strike>, <del>strikethrough</del>
|
|
<span class="tg-spoiler">spoiler</span>, <tg-spoiler>spoiler</tg-spoiler>
|
|
<b>bold <i>italic bold <s>italic bold strikethrough <span class="tg-spoiler">italic bold strikethrough spoiler</span></s> <u>underline italic bold</u></i> bold</b>
|
|
<a href="http://www.example.com/">inline URL</a>
|
|
<a href="tg://user?id=123456789">inline mention of a user</a>
|
|
<tg-emoji emoji-id="5368324170671202286"><img class="emoji" src="//telegram.org/img/emoji/40/F09F918D.png" width="20" height="20" alt="👍" /></tg-emoji>
|
|
<code>inline fixed-width code</code>
|
|
<pre>pre-formatted fixed-width code block</pre>
|
|
<pre><code class="language-python">pre-formatted fixed-width code block written in the Python programming language</code></pre></code></pre>
|
|
<p>Please note:</p>
|
|
<ul>
|
|
<li>Only the tags mentioned above are currently supported.</li>
|
|
<li>All <code><</code>, <code>></code> and <code>&</code> symbols that are not a part of a tag or an HTML entity must be replaced with the corresponding HTML entities (<code><</code> with <code>&lt;</code>, <code>></code> with <code>&gt;</code> and <code>&</code> with <code>&amp;</code>).</li>
|
|
<li>All numerical HTML entities are supported.</li>
|
|
<li>The API currently supports only the following named HTML entities: <code>&lt;</code>, <code>&gt;</code>, <code>&amp;</code> and <code>&quot;</code>.</li>
|
|
<li>Use nested <code>pre</code> and <code>code</code> tags, to define programming language for <code>pre</code> entity.</li>
|
|
<li>Programming language can't be specified for standalone <code>code</code> tags.</li>
|
|
<li>A valid emoji must be used as the content of the <code>tg-emoji</code> tag. The emoji will be shown instead of the custom emoji in places where a custom emoji cannot be displayed (e.g., system notifications) or if the message is forwarded by a non-premium user. It is recommended to use the emoji from the <strong>emoji</strong> field of the custom emoji <a href="#sticker">sticker</a>.</li>
|
|
<li>Custom emoji entities can only be used by bots that purchased additional usernames on <a href="https://fragment.com">Fragment</a>.</li>
|
|
</ul>
|
|
<h6><a class="anchor" name="markdown-style" href="#markdown-style"><i class="anchor-icon"></i></a>Markdown style</h6>
|
|
<p>This is a legacy mode, retained for backward compatibility. To use this mode, pass <em>Markdown</em> in the <em>parse_mode</em> field. Use the following syntax in your message:</p>
|
|
<pre><code>*bold text*
|
|
_italic text_
|
|
[inline URL](http://www.example.com/)
|
|
[inline mention of a user](tg://user?id=123456789)
|
|
`inline fixed-width code`
|
|
```
|
|
pre-formatted fixed-width code block
|
|
```
|
|
```python
|
|
pre-formatted fixed-width code block written in the Python programming language
|
|
```</code></pre>
|
|
<p>Please note:</p>
|
|
<ul>
|
|
<li>Entities must not be nested, use parse mode <a href="#markdownv2-style">MarkdownV2</a> instead.</li>
|
|
<li>There is no way to specify underline and strikethrough entities, use parse mode <a href="#markdownv2-style">MarkdownV2</a> instead.</li>
|
|
<li>To escape characters '_', '*', '`', '[' outside of an entity, prepend the characters '\' before them.</li>
|
|
<li>Escaping inside entities is not allowed, so entity must be closed first and reopened again: use <code>_snake_\__case_</code> for italic <code>snake_case</code> and <code>*2*\**2=4*</code> for bold <code>2*2=4</code>.</li>
|
|
</ul>
|
|
<h4><a class="anchor" name="forwardmessage" href="#forwardmessage"><i class="anchor-icon"></i></a>forwardMessage</h4>
|
|
<p>Use this method to forward messages of any kind. Service messages can't be forwarded. On success, the sent <a href="#message">Message</a> is returned.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the target chat or username of the target channel (in the format <code>@channelusername</code>)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>message_thread_id</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>Unique identifier for the target message thread (topic) of the forum; for forum supergroups only</td>
|
|
</tr>
|
|
<tr>
|
|
<td>from_chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the chat where the original message was sent (or channel username in the format <code>@channelusername</code>)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>disable_notification</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Sends the message <a href="https://telegram.org/blog/channels-2-0#silent-messages">silently</a>. Users will receive a notification with no sound.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>protect_content</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Protects the contents of the forwarded message from forwarding and saving</td>
|
|
</tr>
|
|
<tr>
|
|
<td>message_id</td>
|
|
<td>Integer</td>
|
|
<td>Yes</td>
|
|
<td>Message identifier in the chat specified in <em>from_chat_id</em></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="copymessage" href="#copymessage"><i class="anchor-icon"></i></a>copyMessage</h4>
|
|
<p>Use this method to copy messages of any kind. Service messages and invoice messages can't be copied. A quiz <a href="#poll">poll</a> can be copied only if the value of the field <em>correct_option_id</em> is known to the bot. The method is analogous to the method <a href="#forwardmessage">forwardMessage</a>, but the copied message doesn't have a link to the original message. Returns the <a href="#messageid">MessageId</a> of the sent message on success.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the target chat or username of the target channel (in the format <code>@channelusername</code>)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>message_thread_id</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>Unique identifier for the target message thread (topic) of the forum; for forum supergroups only</td>
|
|
</tr>
|
|
<tr>
|
|
<td>from_chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the chat where the original message was sent (or channel username in the format <code>@channelusername</code>)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>message_id</td>
|
|
<td>Integer</td>
|
|
<td>Yes</td>
|
|
<td>Message identifier in the chat specified in <em>from_chat_id</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>caption</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>New caption for media, 0-1024 characters after entities parsing. If not specified, the original caption is kept</td>
|
|
</tr>
|
|
<tr>
|
|
<td>parse_mode</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>Mode for parsing entities in the new caption. See <a href="#formatting-options">formatting options</a> for more details.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>caption_entities</td>
|
|
<td>Array of <a href="#messageentity">MessageEntity</a></td>
|
|
<td>Optional</td>
|
|
<td>A JSON-serialized list of special entities that appear in the new caption, which can be specified instead of <em>parse_mode</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>disable_notification</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Sends the message <a href="https://telegram.org/blog/channels-2-0#silent-messages">silently</a>. Users will receive a notification with no sound.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>protect_content</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Protects the contents of the sent message from forwarding and saving</td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply_to_message_id</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>If the message is a reply, ID of the original message</td>
|
|
</tr>
|
|
<tr>
|
|
<td>allow_sending_without_reply</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Pass <em>True</em> if the message should be sent even if the specified replied-to message is not found</td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply_markup</td>
|
|
<td><a href="#inlinekeyboardmarkup">InlineKeyboardMarkup</a> or <a href="#replykeyboardmarkup">ReplyKeyboardMarkup</a> or <a href="#replykeyboardremove">ReplyKeyboardRemove</a> or <a href="#forcereply">ForceReply</a></td>
|
|
<td>Optional</td>
|
|
<td>Additional interface options. A JSON-serialized object for an <a href="/bots/features#inline-keyboards">inline keyboard</a>, <a href="/bots/features#keyboards">custom reply keyboard</a>, instructions to remove reply keyboard or to force a reply from the user.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="sendphoto" href="#sendphoto"><i class="anchor-icon"></i></a>sendPhoto</h4>
|
|
<p>Use this method to send photos. On success, the sent <a href="#message">Message</a> is returned.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the target chat or username of the target channel (in the format <code>@channelusername</code>)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>message_thread_id</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>Unique identifier for the target message thread (topic) of the forum; for forum supergroups only</td>
|
|
</tr>
|
|
<tr>
|
|
<td>photo</td>
|
|
<td><a href="#inputfile">InputFile</a> or String</td>
|
|
<td>Yes</td>
|
|
<td>Photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a photo from the Internet, or upload a new photo using multipart/form-data. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20. <a href="#sending-files">More information on Sending Files »</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td>caption</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>Photo caption (may also be used when resending photos by <em>file_id</em>), 0-1024 characters after entities parsing</td>
|
|
</tr>
|
|
<tr>
|
|
<td>parse_mode</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>Mode for parsing entities in the photo caption. See <a href="#formatting-options">formatting options</a> for more details.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>caption_entities</td>
|
|
<td>Array of <a href="#messageentity">MessageEntity</a></td>
|
|
<td>Optional</td>
|
|
<td>A JSON-serialized list of special entities that appear in the caption, which can be specified instead of <em>parse_mode</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>has_spoiler</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Pass <em>True</em> if the photo needs to be covered with a spoiler animation</td>
|
|
</tr>
|
|
<tr>
|
|
<td>disable_notification</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Sends the message <a href="https://telegram.org/blog/channels-2-0#silent-messages">silently</a>. Users will receive a notification with no sound.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>protect_content</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Protects the contents of the sent message from forwarding and saving</td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply_to_message_id</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>If the message is a reply, ID of the original message</td>
|
|
</tr>
|
|
<tr>
|
|
<td>allow_sending_without_reply</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Pass <em>True</em> if the message should be sent even if the specified replied-to message is not found</td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply_markup</td>
|
|
<td><a href="#inlinekeyboardmarkup">InlineKeyboardMarkup</a> or <a href="#replykeyboardmarkup">ReplyKeyboardMarkup</a> or <a href="#replykeyboardremove">ReplyKeyboardRemove</a> or <a href="#forcereply">ForceReply</a></td>
|
|
<td>Optional</td>
|
|
<td>Additional interface options. A JSON-serialized object for an <a href="/bots/features#inline-keyboards">inline keyboard</a>, <a href="/bots/features#keyboards">custom reply keyboard</a>, instructions to remove reply keyboard or to force a reply from the user.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="sendaudio" href="#sendaudio"><i class="anchor-icon"></i></a>sendAudio</h4>
|
|
<p>Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .MP3 or .M4A format. On success, the sent <a href="#message">Message</a> is returned. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future.</p>
|
|
<p>For sending voice messages, use the <a href="#sendvoice">sendVoice</a> method instead.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the target chat or username of the target channel (in the format <code>@channelusername</code>)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>message_thread_id</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>Unique identifier for the target message thread (topic) of the forum; for forum supergroups only</td>
|
|
</tr>
|
|
<tr>
|
|
<td>audio</td>
|
|
<td><a href="#inputfile">InputFile</a> or String</td>
|
|
<td>Yes</td>
|
|
<td>Audio file to send. Pass a file_id as String to send an audio file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an audio file from the Internet, or upload a new one using multipart/form-data. <a href="#sending-files">More information on Sending Files »</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td>caption</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>Audio caption, 0-1024 characters after entities parsing</td>
|
|
</tr>
|
|
<tr>
|
|
<td>parse_mode</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>Mode for parsing entities in the audio caption. See <a href="#formatting-options">formatting options</a> for more details.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>caption_entities</td>
|
|
<td>Array of <a href="#messageentity">MessageEntity</a></td>
|
|
<td>Optional</td>
|
|
<td>A JSON-serialized list of special entities that appear in the caption, which can be specified instead of <em>parse_mode</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>duration</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>Duration of the audio in seconds</td>
|
|
</tr>
|
|
<tr>
|
|
<td>performer</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>Performer</td>
|
|
</tr>
|
|
<tr>
|
|
<td>title</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>Track name</td>
|
|
</tr>
|
|
<tr>
|
|
<td>thumbnail</td>
|
|
<td><a href="#inputfile">InputFile</a> or String</td>
|
|
<td>Optional</td>
|
|
<td>Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. <a href="#sending-files">More information on Sending Files »</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td>disable_notification</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Sends the message <a href="https://telegram.org/blog/channels-2-0#silent-messages">silently</a>. Users will receive a notification with no sound.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>protect_content</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Protects the contents of the sent message from forwarding and saving</td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply_to_message_id</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>If the message is a reply, ID of the original message</td>
|
|
</tr>
|
|
<tr>
|
|
<td>allow_sending_without_reply</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Pass <em>True</em> if the message should be sent even if the specified replied-to message is not found</td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply_markup</td>
|
|
<td><a href="#inlinekeyboardmarkup">InlineKeyboardMarkup</a> or <a href="#replykeyboardmarkup">ReplyKeyboardMarkup</a> or <a href="#replykeyboardremove">ReplyKeyboardRemove</a> or <a href="#forcereply">ForceReply</a></td>
|
|
<td>Optional</td>
|
|
<td>Additional interface options. A JSON-serialized object for an <a href="/bots/features#inline-keyboards">inline keyboard</a>, <a href="/bots/features#keyboards">custom reply keyboard</a>, instructions to remove reply keyboard or to force a reply from the user.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="senddocument" href="#senddocument"><i class="anchor-icon"></i></a>sendDocument</h4>
|
|
<p>Use this method to send general files. On success, the sent <a href="#message">Message</a> is returned. Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the target chat or username of the target channel (in the format <code>@channelusername</code>)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>message_thread_id</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>Unique identifier for the target message thread (topic) of the forum; for forum supergroups only</td>
|
|
</tr>
|
|
<tr>
|
|
<td>document</td>
|
|
<td><a href="#inputfile">InputFile</a> or String</td>
|
|
<td>Yes</td>
|
|
<td>File to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. <a href="#sending-files">More information on Sending Files »</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td>thumbnail</td>
|
|
<td><a href="#inputfile">InputFile</a> or String</td>
|
|
<td>Optional</td>
|
|
<td>Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. <a href="#sending-files">More information on Sending Files »</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td>caption</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>Document caption (may also be used when resending documents by <em>file_id</em>), 0-1024 characters after entities parsing</td>
|
|
</tr>
|
|
<tr>
|
|
<td>parse_mode</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>Mode for parsing entities in the document caption. See <a href="#formatting-options">formatting options</a> for more details.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>caption_entities</td>
|
|
<td>Array of <a href="#messageentity">MessageEntity</a></td>
|
|
<td>Optional</td>
|
|
<td>A JSON-serialized list of special entities that appear in the caption, which can be specified instead of <em>parse_mode</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>disable_content_type_detection</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Disables automatic server-side content type detection for files uploaded using multipart/form-data</td>
|
|
</tr>
|
|
<tr>
|
|
<td>disable_notification</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Sends the message <a href="https://telegram.org/blog/channels-2-0#silent-messages">silently</a>. Users will receive a notification with no sound.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>protect_content</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Protects the contents of the sent message from forwarding and saving</td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply_to_message_id</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>If the message is a reply, ID of the original message</td>
|
|
</tr>
|
|
<tr>
|
|
<td>allow_sending_without_reply</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Pass <em>True</em> if the message should be sent even if the specified replied-to message is not found</td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply_markup</td>
|
|
<td><a href="#inlinekeyboardmarkup">InlineKeyboardMarkup</a> or <a href="#replykeyboardmarkup">ReplyKeyboardMarkup</a> or <a href="#replykeyboardremove">ReplyKeyboardRemove</a> or <a href="#forcereply">ForceReply</a></td>
|
|
<td>Optional</td>
|
|
<td>Additional interface options. A JSON-serialized object for an <a href="/bots/features#inline-keyboards">inline keyboard</a>, <a href="/bots/features#keyboards">custom reply keyboard</a>, instructions to remove reply keyboard or to force a reply from the user.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="sendvideo" href="#sendvideo"><i class="anchor-icon"></i></a>sendVideo</h4>
|
|
<p>Use this method to send video files, Telegram clients support MPEG4 videos (other formats may be sent as <a href="#document">Document</a>). On success, the sent <a href="#message">Message</a> is returned. Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the target chat or username of the target channel (in the format <code>@channelusername</code>)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>message_thread_id</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>Unique identifier for the target message thread (topic) of the forum; for forum supergroups only</td>
|
|
</tr>
|
|
<tr>
|
|
<td>video</td>
|
|
<td><a href="#inputfile">InputFile</a> or String</td>
|
|
<td>Yes</td>
|
|
<td>Video to send. Pass a file_id as String to send a video that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a video from the Internet, or upload a new video using multipart/form-data. <a href="#sending-files">More information on Sending Files »</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td>duration</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>Duration of sent video in seconds</td>
|
|
</tr>
|
|
<tr>
|
|
<td>width</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>Video width</td>
|
|
</tr>
|
|
<tr>
|
|
<td>height</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>Video height</td>
|
|
</tr>
|
|
<tr>
|
|
<td>thumbnail</td>
|
|
<td><a href="#inputfile">InputFile</a> or String</td>
|
|
<td>Optional</td>
|
|
<td>Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. <a href="#sending-files">More information on Sending Files »</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td>caption</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>Video caption (may also be used when resending videos by <em>file_id</em>), 0-1024 characters after entities parsing</td>
|
|
</tr>
|
|
<tr>
|
|
<td>parse_mode</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>Mode for parsing entities in the video caption. See <a href="#formatting-options">formatting options</a> for more details.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>caption_entities</td>
|
|
<td>Array of <a href="#messageentity">MessageEntity</a></td>
|
|
<td>Optional</td>
|
|
<td>A JSON-serialized list of special entities that appear in the caption, which can be specified instead of <em>parse_mode</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>has_spoiler</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Pass <em>True</em> if the video needs to be covered with a spoiler animation</td>
|
|
</tr>
|
|
<tr>
|
|
<td>supports_streaming</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Pass <em>True</em> if the uploaded video is suitable for streaming</td>
|
|
</tr>
|
|
<tr>
|
|
<td>disable_notification</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Sends the message <a href="https://telegram.org/blog/channels-2-0#silent-messages">silently</a>. Users will receive a notification with no sound.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>protect_content</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Protects the contents of the sent message from forwarding and saving</td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply_to_message_id</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>If the message is a reply, ID of the original message</td>
|
|
</tr>
|
|
<tr>
|
|
<td>allow_sending_without_reply</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Pass <em>True</em> if the message should be sent even if the specified replied-to message is not found</td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply_markup</td>
|
|
<td><a href="#inlinekeyboardmarkup">InlineKeyboardMarkup</a> or <a href="#replykeyboardmarkup">ReplyKeyboardMarkup</a> or <a href="#replykeyboardremove">ReplyKeyboardRemove</a> or <a href="#forcereply">ForceReply</a></td>
|
|
<td>Optional</td>
|
|
<td>Additional interface options. A JSON-serialized object for an <a href="/bots/features#inline-keyboards">inline keyboard</a>, <a href="/bots/features#keyboards">custom reply keyboard</a>, instructions to remove reply keyboard or to force a reply from the user.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="sendanimation" href="#sendanimation"><i class="anchor-icon"></i></a>sendAnimation</h4>
|
|
<p>Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). On success, the sent <a href="#message">Message</a> is returned. Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the target chat or username of the target channel (in the format <code>@channelusername</code>)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>message_thread_id</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>Unique identifier for the target message thread (topic) of the forum; for forum supergroups only</td>
|
|
</tr>
|
|
<tr>
|
|
<td>animation</td>
|
|
<td><a href="#inputfile">InputFile</a> or String</td>
|
|
<td>Yes</td>
|
|
<td>Animation to send. Pass a file_id as String to send an animation that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an animation from the Internet, or upload a new animation using multipart/form-data. <a href="#sending-files">More information on Sending Files »</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td>duration</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>Duration of sent animation in seconds</td>
|
|
</tr>
|
|
<tr>
|
|
<td>width</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>Animation width</td>
|
|
</tr>
|
|
<tr>
|
|
<td>height</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>Animation height</td>
|
|
</tr>
|
|
<tr>
|
|
<td>thumbnail</td>
|
|
<td><a href="#inputfile">InputFile</a> or String</td>
|
|
<td>Optional</td>
|
|
<td>Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. <a href="#sending-files">More information on Sending Files »</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td>caption</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>Animation caption (may also be used when resending animation by <em>file_id</em>), 0-1024 characters after entities parsing</td>
|
|
</tr>
|
|
<tr>
|
|
<td>parse_mode</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>Mode for parsing entities in the animation caption. See <a href="#formatting-options">formatting options</a> for more details.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>caption_entities</td>
|
|
<td>Array of <a href="#messageentity">MessageEntity</a></td>
|
|
<td>Optional</td>
|
|
<td>A JSON-serialized list of special entities that appear in the caption, which can be specified instead of <em>parse_mode</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>has_spoiler</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Pass <em>True</em> if the animation needs to be covered with a spoiler animation</td>
|
|
</tr>
|
|
<tr>
|
|
<td>disable_notification</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Sends the message <a href="https://telegram.org/blog/channels-2-0#silent-messages">silently</a>. Users will receive a notification with no sound.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>protect_content</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Protects the contents of the sent message from forwarding and saving</td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply_to_message_id</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>If the message is a reply, ID of the original message</td>
|
|
</tr>
|
|
<tr>
|
|
<td>allow_sending_without_reply</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Pass <em>True</em> if the message should be sent even if the specified replied-to message is not found</td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply_markup</td>
|
|
<td><a href="#inlinekeyboardmarkup">InlineKeyboardMarkup</a> or <a href="#replykeyboardmarkup">ReplyKeyboardMarkup</a> or <a href="#replykeyboardremove">ReplyKeyboardRemove</a> or <a href="#forcereply">ForceReply</a></td>
|
|
<td>Optional</td>
|
|
<td>Additional interface options. A JSON-serialized object for an <a href="/bots/features#inline-keyboards">inline keyboard</a>, <a href="/bots/features#keyboards">custom reply keyboard</a>, instructions to remove reply keyboard or to force a reply from the user.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="sendvoice" href="#sendvoice"><i class="anchor-icon"></i></a>sendVoice</h4>
|
|
<p>Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS (other formats may be sent as <a href="#audio">Audio</a> or <a href="#document">Document</a>). On success, the sent <a href="#message">Message</a> is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the target chat or username of the target channel (in the format <code>@channelusername</code>)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>message_thread_id</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>Unique identifier for the target message thread (topic) of the forum; for forum supergroups only</td>
|
|
</tr>
|
|
<tr>
|
|
<td>voice</td>
|
|
<td><a href="#inputfile">InputFile</a> or String</td>
|
|
<td>Yes</td>
|
|
<td>Audio file to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. <a href="#sending-files">More information on Sending Files »</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td>caption</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>Voice message caption, 0-1024 characters after entities parsing</td>
|
|
</tr>
|
|
<tr>
|
|
<td>parse_mode</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>Mode for parsing entities in the voice message caption. See <a href="#formatting-options">formatting options</a> for more details.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>caption_entities</td>
|
|
<td>Array of <a href="#messageentity">MessageEntity</a></td>
|
|
<td>Optional</td>
|
|
<td>A JSON-serialized list of special entities that appear in the caption, which can be specified instead of <em>parse_mode</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>duration</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>Duration of the voice message in seconds</td>
|
|
</tr>
|
|
<tr>
|
|
<td>disable_notification</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Sends the message <a href="https://telegram.org/blog/channels-2-0#silent-messages">silently</a>. Users will receive a notification with no sound.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>protect_content</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Protects the contents of the sent message from forwarding and saving</td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply_to_message_id</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>If the message is a reply, ID of the original message</td>
|
|
</tr>
|
|
<tr>
|
|
<td>allow_sending_without_reply</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Pass <em>True</em> if the message should be sent even if the specified replied-to message is not found</td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply_markup</td>
|
|
<td><a href="#inlinekeyboardmarkup">InlineKeyboardMarkup</a> or <a href="#replykeyboardmarkup">ReplyKeyboardMarkup</a> or <a href="#replykeyboardremove">ReplyKeyboardRemove</a> or <a href="#forcereply">ForceReply</a></td>
|
|
<td>Optional</td>
|
|
<td>Additional interface options. A JSON-serialized object for an <a href="/bots/features#inline-keyboards">inline keyboard</a>, <a href="/bots/features#keyboards">custom reply keyboard</a>, instructions to remove reply keyboard or to force a reply from the user.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="sendvideonote" href="#sendvideonote"><i class="anchor-icon"></i></a>sendVideoNote</h4>
|
|
<p>As of <a href="https://telegram.org/blog/video-messages-and-telescope">v.4.0</a>, Telegram clients support rounded square MPEG4 videos of up to 1 minute long. Use this method to send video messages. On success, the sent <a href="#message">Message</a> is returned.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the target chat or username of the target channel (in the format <code>@channelusername</code>)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>message_thread_id</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>Unique identifier for the target message thread (topic) of the forum; for forum supergroups only</td>
|
|
</tr>
|
|
<tr>
|
|
<td>video_note</td>
|
|
<td><a href="#inputfile">InputFile</a> or String</td>
|
|
<td>Yes</td>
|
|
<td>Video note to send. Pass a file_id as String to send a video note that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. <a href="#sending-files">More information on Sending Files »</a>. Sending video notes by a URL is currently unsupported</td>
|
|
</tr>
|
|
<tr>
|
|
<td>duration</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>Duration of sent video in seconds</td>
|
|
</tr>
|
|
<tr>
|
|
<td>length</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>Video width and height, i.e. diameter of the video message</td>
|
|
</tr>
|
|
<tr>
|
|
<td>thumbnail</td>
|
|
<td><a href="#inputfile">InputFile</a> or String</td>
|
|
<td>Optional</td>
|
|
<td>Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. <a href="#sending-files">More information on Sending Files »</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td>disable_notification</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Sends the message <a href="https://telegram.org/blog/channels-2-0#silent-messages">silently</a>. Users will receive a notification with no sound.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>protect_content</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Protects the contents of the sent message from forwarding and saving</td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply_to_message_id</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>If the message is a reply, ID of the original message</td>
|
|
</tr>
|
|
<tr>
|
|
<td>allow_sending_without_reply</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Pass <em>True</em> if the message should be sent even if the specified replied-to message is not found</td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply_markup</td>
|
|
<td><a href="#inlinekeyboardmarkup">InlineKeyboardMarkup</a> or <a href="#replykeyboardmarkup">ReplyKeyboardMarkup</a> or <a href="#replykeyboardremove">ReplyKeyboardRemove</a> or <a href="#forcereply">ForceReply</a></td>
|
|
<td>Optional</td>
|
|
<td>Additional interface options. A JSON-serialized object for an <a href="/bots/features#inline-keyboards">inline keyboard</a>, <a href="/bots/features#keyboards">custom reply keyboard</a>, instructions to remove reply keyboard or to force a reply from the user.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="sendmediagroup" href="#sendmediagroup"><i class="anchor-icon"></i></a>sendMediaGroup</h4>
|
|
<p>Use this method to send a group of photos, videos, documents or audios as an album. Documents and audio files can be only grouped in an album with messages of the same type. On success, an array of <a href="#message">Messages</a> that were sent is returned.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the target chat or username of the target channel (in the format <code>@channelusername</code>)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>message_thread_id</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>Unique identifier for the target message thread (topic) of the forum; for forum supergroups only</td>
|
|
</tr>
|
|
<tr>
|
|
<td>media</td>
|
|
<td>Array of <a href="#inputmediaaudio">InputMediaAudio</a>, <a href="#inputmediadocument">InputMediaDocument</a>, <a href="#inputmediaphoto">InputMediaPhoto</a> and <a href="#inputmediavideo">InputMediaVideo</a></td>
|
|
<td>Yes</td>
|
|
<td>A JSON-serialized array describing messages to be sent, must include 2-10 items</td>
|
|
</tr>
|
|
<tr>
|
|
<td>disable_notification</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Sends messages <a href="https://telegram.org/blog/channels-2-0#silent-messages">silently</a>. Users will receive a notification with no sound.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>protect_content</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Protects the contents of the sent messages from forwarding and saving</td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply_to_message_id</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>If the messages are a reply, ID of the original message</td>
|
|
</tr>
|
|
<tr>
|
|
<td>allow_sending_without_reply</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Pass <em>True</em> if the message should be sent even if the specified replied-to message is not found</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="sendlocation" href="#sendlocation"><i class="anchor-icon"></i></a>sendLocation</h4>
|
|
<p>Use this method to send point on the map. On success, the sent <a href="#message">Message</a> is returned.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the target chat or username of the target channel (in the format <code>@channelusername</code>)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>message_thread_id</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>Unique identifier for the target message thread (topic) of the forum; for forum supergroups only</td>
|
|
</tr>
|
|
<tr>
|
|
<td>latitude</td>
|
|
<td>Float number</td>
|
|
<td>Yes</td>
|
|
<td>Latitude of the location</td>
|
|
</tr>
|
|
<tr>
|
|
<td>longitude</td>
|
|
<td>Float number</td>
|
|
<td>Yes</td>
|
|
<td>Longitude of the location</td>
|
|
</tr>
|
|
<tr>
|
|
<td>horizontal_accuracy</td>
|
|
<td>Float number</td>
|
|
<td>Optional</td>
|
|
<td>The radius of uncertainty for the location, measured in meters; 0-1500</td>
|
|
</tr>
|
|
<tr>
|
|
<td>live_period</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>Period in seconds for which the location will be updated (see <a href="https://telegram.org/blog/live-locations">Live Locations</a>, should be between 60 and 86400.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>heading</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>proximity_alert_radius</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>disable_notification</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Sends the message <a href="https://telegram.org/blog/channels-2-0#silent-messages">silently</a>. Users will receive a notification with no sound.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>protect_content</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Protects the contents of the sent message from forwarding and saving</td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply_to_message_id</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>If the message is a reply, ID of the original message</td>
|
|
</tr>
|
|
<tr>
|
|
<td>allow_sending_without_reply</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Pass <em>True</em> if the message should be sent even if the specified replied-to message is not found</td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply_markup</td>
|
|
<td><a href="#inlinekeyboardmarkup">InlineKeyboardMarkup</a> or <a href="#replykeyboardmarkup">ReplyKeyboardMarkup</a> or <a href="#replykeyboardremove">ReplyKeyboardRemove</a> or <a href="#forcereply">ForceReply</a></td>
|
|
<td>Optional</td>
|
|
<td>Additional interface options. A JSON-serialized object for an <a href="/bots/features#inline-keyboards">inline keyboard</a>, <a href="/bots/features#keyboards">custom reply keyboard</a>, instructions to remove reply keyboard or to force a reply from the user.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="sendvenue" href="#sendvenue"><i class="anchor-icon"></i></a>sendVenue</h4>
|
|
<p>Use this method to send information about a venue. On success, the sent <a href="#message">Message</a> is returned.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the target chat or username of the target channel (in the format <code>@channelusername</code>)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>message_thread_id</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>Unique identifier for the target message thread (topic) of the forum; for forum supergroups only</td>
|
|
</tr>
|
|
<tr>
|
|
<td>latitude</td>
|
|
<td>Float number</td>
|
|
<td>Yes</td>
|
|
<td>Latitude of the venue</td>
|
|
</tr>
|
|
<tr>
|
|
<td>longitude</td>
|
|
<td>Float number</td>
|
|
<td>Yes</td>
|
|
<td>Longitude of the venue</td>
|
|
</tr>
|
|
<tr>
|
|
<td>title</td>
|
|
<td>String</td>
|
|
<td>Yes</td>
|
|
<td>Name of the venue</td>
|
|
</tr>
|
|
<tr>
|
|
<td>address</td>
|
|
<td>String</td>
|
|
<td>Yes</td>
|
|
<td>Address of the venue</td>
|
|
</tr>
|
|
<tr>
|
|
<td>foursquare_id</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>Foursquare identifier of the venue</td>
|
|
</tr>
|
|
<tr>
|
|
<td>foursquare_type</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>google_place_id</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>Google Places identifier of the venue</td>
|
|
</tr>
|
|
<tr>
|
|
<td>google_place_type</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>Google Places type of the venue. (See <a href="https://developers.google.com/places/web-service/supported_types">supported types</a>.)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>disable_notification</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Sends the message <a href="https://telegram.org/blog/channels-2-0#silent-messages">silently</a>. Users will receive a notification with no sound.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>protect_content</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Protects the contents of the sent message from forwarding and saving</td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply_to_message_id</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>If the message is a reply, ID of the original message</td>
|
|
</tr>
|
|
<tr>
|
|
<td>allow_sending_without_reply</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Pass <em>True</em> if the message should be sent even if the specified replied-to message is not found</td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply_markup</td>
|
|
<td><a href="#inlinekeyboardmarkup">InlineKeyboardMarkup</a> or <a href="#replykeyboardmarkup">ReplyKeyboardMarkup</a> or <a href="#replykeyboardremove">ReplyKeyboardRemove</a> or <a href="#forcereply">ForceReply</a></td>
|
|
<td>Optional</td>
|
|
<td>Additional interface options. A JSON-serialized object for an <a href="/bots/features#inline-keyboards">inline keyboard</a>, <a href="/bots/features#keyboards">custom reply keyboard</a>, instructions to remove reply keyboard or to force a reply from the user.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="sendcontact" href="#sendcontact"><i class="anchor-icon"></i></a>sendContact</h4>
|
|
<p>Use this method to send phone contacts. On success, the sent <a href="#message">Message</a> is returned.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the target chat or username of the target channel (in the format <code>@channelusername</code>)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>message_thread_id</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>Unique identifier for the target message thread (topic) of the forum; for forum supergroups only</td>
|
|
</tr>
|
|
<tr>
|
|
<td>phone_number</td>
|
|
<td>String</td>
|
|
<td>Yes</td>
|
|
<td>Contact's phone number</td>
|
|
</tr>
|
|
<tr>
|
|
<td>first_name</td>
|
|
<td>String</td>
|
|
<td>Yes</td>
|
|
<td>Contact's first name</td>
|
|
</tr>
|
|
<tr>
|
|
<td>last_name</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>Contact's last name</td>
|
|
</tr>
|
|
<tr>
|
|
<td>vcard</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>Additional data about the contact in the form of a <a href="https://en.wikipedia.org/wiki/VCard">vCard</a>, 0-2048 bytes</td>
|
|
</tr>
|
|
<tr>
|
|
<td>disable_notification</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Sends the message <a href="https://telegram.org/blog/channels-2-0#silent-messages">silently</a>. Users will receive a notification with no sound.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>protect_content</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Protects the contents of the sent message from forwarding and saving</td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply_to_message_id</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>If the message is a reply, ID of the original message</td>
|
|
</tr>
|
|
<tr>
|
|
<td>allow_sending_without_reply</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Pass <em>True</em> if the message should be sent even if the specified replied-to message is not found</td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply_markup</td>
|
|
<td><a href="#inlinekeyboardmarkup">InlineKeyboardMarkup</a> or <a href="#replykeyboardmarkup">ReplyKeyboardMarkup</a> or <a href="#replykeyboardremove">ReplyKeyboardRemove</a> or <a href="#forcereply">ForceReply</a></td>
|
|
<td>Optional</td>
|
|
<td>Additional interface options. A JSON-serialized object for an <a href="/bots/features#inline-keyboards">inline keyboard</a>, <a href="/bots/features#keyboards">custom reply keyboard</a>, instructions to remove reply keyboard or to force a reply from the user.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="sendpoll" href="#sendpoll"><i class="anchor-icon"></i></a>sendPoll</h4>
|
|
<p>Use this method to send a native poll. On success, the sent <a href="#message">Message</a> is returned.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the target chat or username of the target channel (in the format <code>@channelusername</code>)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>message_thread_id</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>Unique identifier for the target message thread (topic) of the forum; for forum supergroups only</td>
|
|
</tr>
|
|
<tr>
|
|
<td>question</td>
|
|
<td>String</td>
|
|
<td>Yes</td>
|
|
<td>Poll question, 1-300 characters</td>
|
|
</tr>
|
|
<tr>
|
|
<td>options</td>
|
|
<td>Array of String</td>
|
|
<td>Yes</td>
|
|
<td>A JSON-serialized list of answer options, 2-10 strings 1-100 characters each</td>
|
|
</tr>
|
|
<tr>
|
|
<td>is_anonymous</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td><em>True</em>, if the poll needs to be anonymous, defaults to <em>True</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>type</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>Poll type, “quiz” or “regular”, defaults to “regular”</td>
|
|
</tr>
|
|
<tr>
|
|
<td>allows_multiple_answers</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td><em>True</em>, if the poll allows multiple answers, ignored for polls in quiz mode, defaults to <em>False</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>correct_option_id</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>0-based identifier of the correct answer option, required for polls in quiz mode</td>
|
|
</tr>
|
|
<tr>
|
|
<td>explanation</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters with at most 2 line feeds after entities parsing</td>
|
|
</tr>
|
|
<tr>
|
|
<td>explanation_parse_mode</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>Mode for parsing entities in the explanation. See <a href="#formatting-options">formatting options</a> for more details.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>explanation_entities</td>
|
|
<td>Array of <a href="#messageentity">MessageEntity</a></td>
|
|
<td>Optional</td>
|
|
<td>A JSON-serialized list of special entities that appear in the poll explanation, which can be specified instead of <em>parse_mode</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>open_period</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>Amount of time in seconds the poll will be active after creation, 5-600. Can't be used together with <em>close_date</em>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>close_date</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>Point in time (Unix timestamp) when the poll will be automatically closed. Must be at least 5 and no more than 600 seconds in the future. Can't be used together with <em>open_period</em>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>is_closed</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Pass <em>True</em> if the poll needs to be immediately closed. This can be useful for poll preview.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>disable_notification</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Sends the message <a href="https://telegram.org/blog/channels-2-0#silent-messages">silently</a>. Users will receive a notification with no sound.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>protect_content</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Protects the contents of the sent message from forwarding and saving</td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply_to_message_id</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>If the message is a reply, ID of the original message</td>
|
|
</tr>
|
|
<tr>
|
|
<td>allow_sending_without_reply</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Pass <em>True</em> if the message should be sent even if the specified replied-to message is not found</td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply_markup</td>
|
|
<td><a href="#inlinekeyboardmarkup">InlineKeyboardMarkup</a> or <a href="#replykeyboardmarkup">ReplyKeyboardMarkup</a> or <a href="#replykeyboardremove">ReplyKeyboardRemove</a> or <a href="#forcereply">ForceReply</a></td>
|
|
<td>Optional</td>
|
|
<td>Additional interface options. A JSON-serialized object for an <a href="/bots/features#inline-keyboards">inline keyboard</a>, <a href="/bots/features#keyboards">custom reply keyboard</a>, instructions to remove reply keyboard or to force a reply from the user.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="senddice" href="#senddice"><i class="anchor-icon"></i></a>sendDice</h4>
|
|
<p>Use this method to send an animated emoji that will display a random value. On success, the sent <a href="#message">Message</a> is returned.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the target chat or username of the target channel (in the format <code>@channelusername</code>)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>message_thread_id</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>Unique identifier for the target message thread (topic) of the forum; for forum supergroups only</td>
|
|
</tr>
|
|
<tr>
|
|
<td>emoji</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>Emoji on which the dice throw animation is based. Currently, must be one of “<img class="emoji" src="//telegram.org/img/emoji/40/F09F8EB2.png" width="20" height="20" alt="🎲" />”, “<img class="emoji" src="//telegram.org/img/emoji/40/F09F8EAF.png" width="20" height="20" alt="🎯" />”, “<img class="emoji" src="//telegram.org/img/emoji/40/F09F8F80.png" width="20" height="20" alt="🏀" />”, “<img class="emoji" src="//telegram.org/img/emoji/40/E29ABD.png" width="20" height="20" alt="⚽" />”, “<img class="emoji" src="//telegram.org/img/emoji/40/F09F8EB3.png" width="20" height="20" alt="🎳" />”, or “<img class="emoji" src="//telegram.org/img/emoji/40/F09F8EB0.png" width="20" height="20" alt="🎰" />”. Dice can have values 1-6 for “<img class="emoji" src="//telegram.org/img/emoji/40/F09F8EB2.png" width="20" height="20" alt="🎲" />”, “<img class="emoji" src="//telegram.org/img/emoji/40/F09F8EAF.png" width="20" height="20" alt="🎯" />” and “<img class="emoji" src="//telegram.org/img/emoji/40/F09F8EB3.png" width="20" height="20" alt="🎳" />”, values 1-5 for “<img class="emoji" src="//telegram.org/img/emoji/40/F09F8F80.png" width="20" height="20" alt="🏀" />” and “<img class="emoji" src="//telegram.org/img/emoji/40/E29ABD.png" width="20" height="20" alt="⚽" />”, and values 1-64 for “<img class="emoji" src="//telegram.org/img/emoji/40/F09F8EB0.png" width="20" height="20" alt="🎰" />”. Defaults to “<img class="emoji" src="//telegram.org/img/emoji/40/F09F8EB2.png" width="20" height="20" alt="🎲" />”</td>
|
|
</tr>
|
|
<tr>
|
|
<td>disable_notification</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Sends the message <a href="https://telegram.org/blog/channels-2-0#silent-messages">silently</a>. Users will receive a notification with no sound.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>protect_content</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Protects the contents of the sent message from forwarding</td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply_to_message_id</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>If the message is a reply, ID of the original message</td>
|
|
</tr>
|
|
<tr>
|
|
<td>allow_sending_without_reply</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Pass <em>True</em> if the message should be sent even if the specified replied-to message is not found</td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply_markup</td>
|
|
<td><a href="#inlinekeyboardmarkup">InlineKeyboardMarkup</a> or <a href="#replykeyboardmarkup">ReplyKeyboardMarkup</a> or <a href="#replykeyboardremove">ReplyKeyboardRemove</a> or <a href="#forcereply">ForceReply</a></td>
|
|
<td>Optional</td>
|
|
<td>Additional interface options. A JSON-serialized object for an <a href="/bots/features#inline-keyboards">inline keyboard</a>, <a href="/bots/features#keyboards">custom reply keyboard</a>, instructions to remove reply keyboard or to force a reply from the user.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="sendchataction" href="#sendchataction"><i class="anchor-icon"></i></a>sendChatAction</h4>
|
|
<p>Use this method when you need to tell the user that something is happening on the bot's side. The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status). Returns <em>True</em> on success.</p>
|
|
<blockquote>
|
|
<p>Example: The <a href="https://t.me/imagebot">ImageBot</a> needs some time to process a request and upload the image. Instead of sending a text message along the lines of “Retrieving image, please wait…”, the bot may use <a href="#sendchataction">sendChatAction</a> with <em>action</em> = <em>upload_photo</em>. The user will see a “sending photo” status for the bot.</p>
|
|
</blockquote>
|
|
<p>We only recommend using this method when a response from the bot will take a <strong>noticeable</strong> amount of time to arrive.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the target chat or username of the target channel (in the format <code>@channelusername</code>)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>message_thread_id</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>Unique identifier for the target message thread; supergroups only</td>
|
|
</tr>
|
|
<tr>
|
|
<td>action</td>
|
|
<td>String</td>
|
|
<td>Yes</td>
|
|
<td>Type of action to broadcast. Choose one, depending on what the user is about to receive: <em>typing</em> for <a href="#sendmessage">text messages</a>, <em>upload_photo</em> for <a href="#sendphoto">photos</a>, <em>record_video</em> or <em>upload_video</em> for <a href="#sendvideo">videos</a>, <em>record_voice</em> or <em>upload_voice</em> for <a href="#sendvoice">voice notes</a>, <em>upload_document</em> for <a href="#senddocument">general files</a>, <em>choose_sticker</em> for <a href="#sendsticker">stickers</a>, <em>find_location</em> for <a href="#sendlocation">location data</a>, <em>record_video_note</em> or <em>upload_video_note</em> for <a href="#sendvideonote">video notes</a>.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="getuserprofilephotos" href="#getuserprofilephotos"><i class="anchor-icon"></i></a>getUserProfilePhotos</h4>
|
|
<p>Use this method to get a list of profile pictures for a user. Returns a <a href="#userprofilephotos">UserProfilePhotos</a> object.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>user_id</td>
|
|
<td>Integer</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier of the target user</td>
|
|
</tr>
|
|
<tr>
|
|
<td>offset</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>Sequential number of the first photo to be returned. By default, all photos are returned.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>limit</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>Limits the number of photos to be retrieved. Values between 1-100 are accepted. Defaults to 100.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="getfile" href="#getfile"><i class="anchor-icon"></i></a>getFile</h4>
|
|
<p>Use this method to get basic information about a file and prepare it for downloading. For the moment, bots can download files of up to 20MB in size. On success, a <a href="#file">File</a> object is returned. The file can then be downloaded via the link <code>https://api.telegram.org/file/bot<token>/<file_path></code>, where <code><file_path></code> is taken from the response. It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be requested by calling <a href="#getfile">getFile</a> again.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>file_id</td>
|
|
<td>String</td>
|
|
<td>Yes</td>
|
|
<td>File identifier to get information about</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p><strong>Note:</strong> This function may not preserve the original file name and MIME type. You should save the file's MIME type and name (if available) when the File object is received.</p>
|
|
<h4><a class="anchor" name="banchatmember" href="#banchatmember"><i class="anchor-icon"></i></a>banChatMember</h4>
|
|
<p>Use this method to ban a user in a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the chat on their own using invite links, etc., unless <a href="#unbanchatmember">unbanned</a> first. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns <em>True</em> on success.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the target group or username of the target supergroup or channel (in the format <code>@channelusername</code>)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>user_id</td>
|
|
<td>Integer</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier of the target user</td>
|
|
</tr>
|
|
<tr>
|
|
<td>until_date</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>Date when the user will be unbanned, unix time. If user is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever. Applied for supergroups and channels only.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>revoke_messages</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Pass <em>True</em> to delete all messages from the chat for the user that is being removed. If <em>False</em>, the user will be able to see messages in the group that were sent before the user was removed. Always <em>True</em> for supergroups and channels.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="unbanchatmember" href="#unbanchatmember"><i class="anchor-icon"></i></a>unbanChatMember</h4>
|
|
<p>Use this method to unban a previously banned user in a supergroup or channel. The user will <strong>not</strong> return to the group or channel automatically, but will be able to join via link, etc. The bot must be an administrator for this to work. By default, this method guarantees that after the call the user is not a member of the chat, but will be able to join it. So if the user is a member of the chat they will also be <strong>removed</strong> from the chat. If you don't want this, use the parameter <em>only_if_banned</em>. Returns <em>True</em> on success.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the target group or username of the target supergroup or channel (in the format <code>@channelusername</code>)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>user_id</td>
|
|
<td>Integer</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier of the target user</td>
|
|
</tr>
|
|
<tr>
|
|
<td>only_if_banned</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Do nothing if the user is not banned</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="restrictchatmember" href="#restrictchatmember"><i class="anchor-icon"></i></a>restrictChatMember</h4>
|
|
<p>Use this method to restrict a user in a supergroup. The bot must be an administrator in the supergroup for this to work and must have the appropriate administrator rights. Pass <em>True</em> for all permissions to lift restrictions from a user. Returns <em>True</em> on success.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the target chat or username of the target supergroup (in the format <code>@supergroupusername</code>)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>user_id</td>
|
|
<td>Integer</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier of the target user</td>
|
|
</tr>
|
|
<tr>
|
|
<td>permissions</td>
|
|
<td><a href="#chatpermissions">ChatPermissions</a></td>
|
|
<td>Yes</td>
|
|
<td>A JSON-serialized object for new user permissions</td>
|
|
</tr>
|
|
<tr>
|
|
<td>use_independent_chat_permissions</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Pass <em>True</em> if chat permissions are set independently. Otherwise, the <em>can_send_other_messages</em> and <em>can_add_web_page_previews</em> permissions will imply the <em>can_send_messages</em>, <em>can_send_audios</em>, <em>can_send_documents</em>, <em>can_send_photos</em>, <em>can_send_videos</em>, <em>can_send_video_notes</em>, and <em>can_send_voice_notes</em> permissions; the <em>can_send_polls</em> permission will imply the <em>can_send_messages</em> permission.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>until_date</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>Date when restrictions will be lifted for the user, unix time. If user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be restricted forever</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="promotechatmember" href="#promotechatmember"><i class="anchor-icon"></i></a>promoteChatMember</h4>
|
|
<p>Use this method to promote or demote a user in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Pass <em>False</em> for all boolean parameters to demote a user. Returns <em>True</em> on success.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the target chat or username of the target channel (in the format <code>@channelusername</code>)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>user_id</td>
|
|
<td>Integer</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier of the target user</td>
|
|
</tr>
|
|
<tr>
|
|
<td>is_anonymous</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Pass <em>True</em> if the administrator's presence in the chat is hidden</td>
|
|
</tr>
|
|
<tr>
|
|
<td>can_manage_chat</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Pass <em>True</em> if the administrator can access the chat event log, chat statistics, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege</td>
|
|
</tr>
|
|
<tr>
|
|
<td>can_post_messages</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Pass <em>True</em> if the administrator can create channel posts, channels only</td>
|
|
</tr>
|
|
<tr>
|
|
<td>can_edit_messages</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Pass <em>True</em> if the administrator can edit messages of other users and can pin messages, channels only</td>
|
|
</tr>
|
|
<tr>
|
|
<td>can_delete_messages</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Pass <em>True</em> if the administrator can delete messages of other users</td>
|
|
</tr>
|
|
<tr>
|
|
<td>can_manage_video_chats</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Pass <em>True</em> if the administrator can manage video chats</td>
|
|
</tr>
|
|
<tr>
|
|
<td>can_restrict_members</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Pass <em>True</em> if the administrator can restrict, ban or unban chat members</td>
|
|
</tr>
|
|
<tr>
|
|
<td>can_promote_members</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Pass <em>True</em> if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by him)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>can_change_info</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Pass <em>True</em> if the administrator can change chat title, photo and other settings</td>
|
|
</tr>
|
|
<tr>
|
|
<td>can_invite_users</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Pass <em>True</em> if the administrator can invite new users to the chat</td>
|
|
</tr>
|
|
<tr>
|
|
<td>can_pin_messages</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Pass <em>True</em> if the administrator can pin messages, supergroups only</td>
|
|
</tr>
|
|
<tr>
|
|
<td>can_manage_topics</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Pass <em>True</em> if the user is allowed to create, rename, close, and reopen forum topics, supergroups only</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="setchatadministratorcustomtitle" href="#setchatadministratorcustomtitle"><i class="anchor-icon"></i></a>setChatAdministratorCustomTitle</h4>
|
|
<p>Use this method to set a custom title for an administrator in a supergroup promoted by the bot. Returns <em>True</em> on success.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the target chat or username of the target supergroup (in the format <code>@supergroupusername</code>)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>user_id</td>
|
|
<td>Integer</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier of the target user</td>
|
|
</tr>
|
|
<tr>
|
|
<td>custom_title</td>
|
|
<td>String</td>
|
|
<td>Yes</td>
|
|
<td>New custom title for the administrator; 0-16 characters, emoji are not allowed</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="banchatsenderchat" href="#banchatsenderchat"><i class="anchor-icon"></i></a>banChatSenderChat</h4>
|
|
<p>Use this method to ban a channel chat in a supergroup or a channel. Until the chat is <a href="#unbanchatsenderchat">unbanned</a>, the owner of the banned chat won't be able to send messages on behalf of <strong>any of their channels</strong>. The bot must be an administrator in the supergroup or channel for this to work and must have the appropriate administrator rights. Returns <em>True</em> on success.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the target chat or username of the target channel (in the format <code>@channelusername</code>)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>sender_chat_id</td>
|
|
<td>Integer</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier of the target sender chat</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="unbanchatsenderchat" href="#unbanchatsenderchat"><i class="anchor-icon"></i></a>unbanChatSenderChat</h4>
|
|
<p>Use this method to unban a previously banned channel chat in a supergroup or channel. The bot must be an administrator for this to work and must have the appropriate administrator rights. Returns <em>True</em> on success.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the target chat or username of the target channel (in the format <code>@channelusername</code>)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>sender_chat_id</td>
|
|
<td>Integer</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier of the target sender chat</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="setchatpermissions" href="#setchatpermissions"><i class="anchor-icon"></i></a>setChatPermissions</h4>
|
|
<p>Use this method to set default chat permissions for all members. The bot must be an administrator in the group or a supergroup for this to work and must have the <em>can_restrict_members</em> administrator rights. Returns <em>True</em> on success.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the target chat or username of the target supergroup (in the format <code>@supergroupusername</code>)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>permissions</td>
|
|
<td><a href="#chatpermissions">ChatPermissions</a></td>
|
|
<td>Yes</td>
|
|
<td>A JSON-serialized object for new default chat permissions</td>
|
|
</tr>
|
|
<tr>
|
|
<td>use_independent_chat_permissions</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Pass <em>True</em> if chat permissions are set independently. Otherwise, the <em>can_send_other_messages</em> and <em>can_add_web_page_previews</em> permissions will imply the <em>can_send_messages</em>, <em>can_send_audios</em>, <em>can_send_documents</em>, <em>can_send_photos</em>, <em>can_send_videos</em>, <em>can_send_video_notes</em>, and <em>can_send_voice_notes</em> permissions; the <em>can_send_polls</em> permission will imply the <em>can_send_messages</em> permission.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="exportchatinvitelink" href="#exportchatinvitelink"><i class="anchor-icon"></i></a>exportChatInviteLink</h4>
|
|
<p>Use this method to generate a new primary invite link for a chat; any previously generated primary link is revoked. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the new invite link as <em>String</em> on success.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the target chat or username of the target channel (in the format <code>@channelusername</code>)</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<blockquote>
|
|
<p>Note: Each administrator in a chat generates their own invite links. Bots can't use invite links generated by other administrators. If you want your bot to work with invite links, it will need to generate its own link using <a href="#exportchatinvitelink">exportChatInviteLink</a> or by calling the <a href="#getchat">getChat</a> method. If your bot needs to generate a new primary invite link replacing its previous one, use <a href="#exportchatinvitelink">exportChatInviteLink</a> again.</p>
|
|
</blockquote>
|
|
<h4><a class="anchor" name="createchatinvitelink" href="#createchatinvitelink"><i class="anchor-icon"></i></a>createChatInviteLink</h4>
|
|
<p>Use this method to create an additional invite link for a chat. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. The link can be revoked using the method <a href="#revokechatinvitelink">revokeChatInviteLink</a>. Returns the new invite link as <a href="#chatinvitelink">ChatInviteLink</a> object.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the target chat or username of the target channel (in the format <code>@channelusername</code>)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>name</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>Invite link name; 0-32 characters</td>
|
|
</tr>
|
|
<tr>
|
|
<td>expire_date</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>Point in time (Unix timestamp) when the link will expire</td>
|
|
</tr>
|
|
<tr>
|
|
<td>member_limit</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999</td>
|
|
</tr>
|
|
<tr>
|
|
<td>creates_join_request</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td><em>True</em>, if users joining the chat via the link need to be approved by chat administrators. If <em>True</em>, <em>member_limit</em> can't be specified</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="editchatinvitelink" href="#editchatinvitelink"><i class="anchor-icon"></i></a>editChatInviteLink</h4>
|
|
<p>Use this method to edit a non-primary invite link created by the bot. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the edited invite link as a <a href="#chatinvitelink">ChatInviteLink</a> object.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the target chat or username of the target channel (in the format <code>@channelusername</code>)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>invite_link</td>
|
|
<td>String</td>
|
|
<td>Yes</td>
|
|
<td>The invite link to edit</td>
|
|
</tr>
|
|
<tr>
|
|
<td>name</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>Invite link name; 0-32 characters</td>
|
|
</tr>
|
|
<tr>
|
|
<td>expire_date</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>Point in time (Unix timestamp) when the link will expire</td>
|
|
</tr>
|
|
<tr>
|
|
<td>member_limit</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999</td>
|
|
</tr>
|
|
<tr>
|
|
<td>creates_join_request</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td><em>True</em>, if users joining the chat via the link need to be approved by chat administrators. If <em>True</em>, <em>member_limit</em> can't be specified</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="revokechatinvitelink" href="#revokechatinvitelink"><i class="anchor-icon"></i></a>revokeChatInviteLink</h4>
|
|
<p>Use this method to revoke an invite link created by the bot. If the primary link is revoked, a new link is automatically generated. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the revoked invite link as <a href="#chatinvitelink">ChatInviteLink</a> object.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier of the target chat or username of the target channel (in the format <code>@channelusername</code>)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>invite_link</td>
|
|
<td>String</td>
|
|
<td>Yes</td>
|
|
<td>The invite link to revoke</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="approvechatjoinrequest" href="#approvechatjoinrequest"><i class="anchor-icon"></i></a>approveChatJoinRequest</h4>
|
|
<p>Use this method to approve a chat join request. The bot must be an administrator in the chat for this to work and must have the <em>can_invite_users</em> administrator right. Returns <em>True</em> on success.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the target chat or username of the target channel (in the format <code>@channelusername</code>)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>user_id</td>
|
|
<td>Integer</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier of the target user</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="declinechatjoinrequest" href="#declinechatjoinrequest"><i class="anchor-icon"></i></a>declineChatJoinRequest</h4>
|
|
<p>Use this method to decline a chat join request. The bot must be an administrator in the chat for this to work and must have the <em>can_invite_users</em> administrator right. Returns <em>True</em> on success.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the target chat or username of the target channel (in the format <code>@channelusername</code>)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>user_id</td>
|
|
<td>Integer</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier of the target user</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="setchatphoto" href="#setchatphoto"><i class="anchor-icon"></i></a>setChatPhoto</h4>
|
|
<p>Use this method to set a new profile photo for the chat. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns <em>True</em> on success.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the target chat or username of the target channel (in the format <code>@channelusername</code>)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>photo</td>
|
|
<td><a href="#inputfile">InputFile</a></td>
|
|
<td>Yes</td>
|
|
<td>New chat photo, uploaded using multipart/form-data</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="deletechatphoto" href="#deletechatphoto"><i class="anchor-icon"></i></a>deleteChatPhoto</h4>
|
|
<p>Use this method to delete a chat photo. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns <em>True</em> on success.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the target chat or username of the target channel (in the format <code>@channelusername</code>)</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="setchattitle" href="#setchattitle"><i class="anchor-icon"></i></a>setChatTitle</h4>
|
|
<p>Use this method to change the title of a chat. Titles can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns <em>True</em> on success.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the target chat or username of the target channel (in the format <code>@channelusername</code>)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>title</td>
|
|
<td>String</td>
|
|
<td>Yes</td>
|
|
<td>New chat title, 1-128 characters</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="setchatdescription" href="#setchatdescription"><i class="anchor-icon"></i></a>setChatDescription</h4>
|
|
<p>Use this method to change the description of a group, a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns <em>True</em> on success.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the target chat or username of the target channel (in the format <code>@channelusername</code>)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>description</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>New chat description, 0-255 characters</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="pinchatmessage" href="#pinchatmessage"><i class="anchor-icon"></i></a>pinChatMessage</h4>
|
|
<p>Use this method to add a message to the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel. Returns <em>True</em> on success.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the target chat or username of the target channel (in the format <code>@channelusername</code>)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>message_id</td>
|
|
<td>Integer</td>
|
|
<td>Yes</td>
|
|
<td>Identifier of a message to pin</td>
|
|
</tr>
|
|
<tr>
|
|
<td>disable_notification</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Pass <em>True</em> if it is not necessary to send a notification to all chat members about the new pinned message. Notifications are always disabled in channels and private chats.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="unpinchatmessage" href="#unpinchatmessage"><i class="anchor-icon"></i></a>unpinChatMessage</h4>
|
|
<p>Use this method to remove a message from the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel. Returns <em>True</em> on success.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the target chat or username of the target channel (in the format <code>@channelusername</code>)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>message_id</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>Identifier of a message to unpin. If not specified, the most recent pinned message (by sending date) will be unpinned.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="unpinallchatmessages" href="#unpinallchatmessages"><i class="anchor-icon"></i></a>unpinAllChatMessages</h4>
|
|
<p>Use this method to clear the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel. Returns <em>True</em> on success.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the target chat or username of the target channel (in the format <code>@channelusername</code>)</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="leavechat" href="#leavechat"><i class="anchor-icon"></i></a>leaveChat</h4>
|
|
<p>Use this method for your bot to leave a group, supergroup or channel. Returns <em>True</em> on success.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the target chat or username of the target supergroup or channel (in the format <code>@channelusername</code>)</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="getchat" href="#getchat"><i class="anchor-icon"></i></a>getChat</h4>
|
|
<p>Use this method to get up to date information about the chat (current name of the user for one-on-one conversations, current username of a user, group or channel, etc.). Returns a <a href="#chat">Chat</a> object on success.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the target chat or username of the target supergroup or channel (in the format <code>@channelusername</code>)</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="getchatadministrators" href="#getchatadministrators"><i class="anchor-icon"></i></a>getChatAdministrators</h4>
|
|
<p>Use this method to get a list of administrators in a chat, which aren't bots. Returns an Array of <a href="#chatmember">ChatMember</a> objects.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the target chat or username of the target supergroup or channel (in the format <code>@channelusername</code>)</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="getchatmembercount" href="#getchatmembercount"><i class="anchor-icon"></i></a>getChatMemberCount</h4>
|
|
<p>Use this method to get the number of members in a chat. Returns <em>Int</em> on success.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the target chat or username of the target supergroup or channel (in the format <code>@channelusername</code>)</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="getchatmember" href="#getchatmember"><i class="anchor-icon"></i></a>getChatMember</h4>
|
|
<p>Use this method to get information about a member of a chat. The method is only guaranteed to work for other users if the bot is an administrator in the chat. Returns a <a href="#chatmember">ChatMember</a> object on success.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the target chat or username of the target supergroup or channel (in the format <code>@channelusername</code>)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>user_id</td>
|
|
<td>Integer</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier of the target user</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="setchatstickerset" href="#setchatstickerset"><i class="anchor-icon"></i></a>setChatStickerSet</h4>
|
|
<p>Use this method to set a new group sticker set for a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Use the field <em>can_set_sticker_set</em> optionally returned in <a href="#getchat">getChat</a> requests to check if the bot can use this method. Returns <em>True</em> on success.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the target chat or username of the target supergroup (in the format <code>@supergroupusername</code>)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>sticker_set_name</td>
|
|
<td>String</td>
|
|
<td>Yes</td>
|
|
<td>Name of the sticker set to be set as the group sticker set</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="deletechatstickerset" href="#deletechatstickerset"><i class="anchor-icon"></i></a>deleteChatStickerSet</h4>
|
|
<p>Use this method to delete a group sticker set from a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Use the field <em>can_set_sticker_set</em> optionally returned in <a href="#getchat">getChat</a> requests to check if the bot can use this method. Returns <em>True</em> on success.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the target chat or username of the target supergroup (in the format <code>@supergroupusername</code>)</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="getforumtopiciconstickers" href="#getforumtopiciconstickers"><i class="anchor-icon"></i></a>getForumTopicIconStickers</h4>
|
|
<p>Use this method to get custom emoji stickers, which can be used as a forum topic icon by any user. Requires no parameters. Returns an Array of <a href="#sticker">Sticker</a> objects.</p>
|
|
<h4><a class="anchor" name="createforumtopic" href="#createforumtopic"><i class="anchor-icon"></i></a>createForumTopic</h4>
|
|
<p>Use this method to create a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the <em>can_manage_topics</em> administrator rights. Returns information about the created topic as a <a href="#forumtopic">ForumTopic</a> object.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the target chat or username of the target supergroup (in the format <code>@supergroupusername</code>)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>name</td>
|
|
<td>String</td>
|
|
<td>Yes</td>
|
|
<td>Topic name, 1-128 characters</td>
|
|
</tr>
|
|
<tr>
|
|
<td>icon_color</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>Color of the topic icon in RGB format. Currently, must be one of 7322096 (0x6FB9F0), 16766590 (0xFFD67E), 13338331 (0xCB86DB), 9367192 (0x8EEE98), 16749490 (0xFF93B2), or 16478047 (0xFB6F5F)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>icon_custom_emoji_id</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>Unique identifier of the custom emoji shown as the topic icon. Use <a href="#getforumtopiciconstickers">getForumTopicIconStickers</a> to get all allowed custom emoji identifiers.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="editforumtopic" href="#editforumtopic"><i class="anchor-icon"></i></a>editForumTopic</h4>
|
|
<p>Use this method to edit name and icon of a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have <em>can_manage_topics</em> administrator rights, unless it is the creator of the topic. Returns <em>True</em> on success.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the target chat or username of the target supergroup (in the format <code>@supergroupusername</code>)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>message_thread_id</td>
|
|
<td>Integer</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the target message thread of the forum topic</td>
|
|
</tr>
|
|
<tr>
|
|
<td>name</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>New topic name, 0-128 characters. If not specified or empty, the current name of the topic will be kept</td>
|
|
</tr>
|
|
<tr>
|
|
<td>icon_custom_emoji_id</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>New unique identifier of the custom emoji shown as the topic icon. Use <a href="#getforumtopiciconstickers">getForumTopicIconStickers</a> to get all allowed custom emoji identifiers. Pass an empty string to remove the icon. If not specified, the current icon will be kept</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="closeforumtopic" href="#closeforumtopic"><i class="anchor-icon"></i></a>closeForumTopic</h4>
|
|
<p>Use this method to close an open topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the <em>can_manage_topics</em> administrator rights, unless it is the creator of the topic. Returns <em>True</em> on success.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the target chat or username of the target supergroup (in the format <code>@supergroupusername</code>)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>message_thread_id</td>
|
|
<td>Integer</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the target message thread of the forum topic</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="reopenforumtopic" href="#reopenforumtopic"><i class="anchor-icon"></i></a>reopenForumTopic</h4>
|
|
<p>Use this method to reopen a closed topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the <em>can_manage_topics</em> administrator rights, unless it is the creator of the topic. Returns <em>True</em> on success.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the target chat or username of the target supergroup (in the format <code>@supergroupusername</code>)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>message_thread_id</td>
|
|
<td>Integer</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the target message thread of the forum topic</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="deleteforumtopic" href="#deleteforumtopic"><i class="anchor-icon"></i></a>deleteForumTopic</h4>
|
|
<p>Use this method to delete a forum topic along with all its messages in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the <em>can_delete_messages</em> administrator rights. Returns <em>True</em> on success.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the target chat or username of the target supergroup (in the format <code>@supergroupusername</code>)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>message_thread_id</td>
|
|
<td>Integer</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the target message thread of the forum topic</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="unpinallforumtopicmessages" href="#unpinallforumtopicmessages"><i class="anchor-icon"></i></a>unpinAllForumTopicMessages</h4>
|
|
<p>Use this method to clear the list of pinned messages in a forum topic. The bot must be an administrator in the chat for this to work and must have the <em>can_pin_messages</em> administrator right in the supergroup. Returns <em>True</em> on success.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the target chat or username of the target supergroup (in the format <code>@supergroupusername</code>)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>message_thread_id</td>
|
|
<td>Integer</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the target message thread of the forum topic</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="editgeneralforumtopic" href="#editgeneralforumtopic"><i class="anchor-icon"></i></a>editGeneralForumTopic</h4>
|
|
<p>Use this method to edit the name of the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have <em>can_manage_topics</em> administrator rights. Returns <em>True</em> on success.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the target chat or username of the target supergroup (in the format <code>@supergroupusername</code>)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>name</td>
|
|
<td>String</td>
|
|
<td>Yes</td>
|
|
<td>New topic name, 1-128 characters</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="closegeneralforumtopic" href="#closegeneralforumtopic"><i class="anchor-icon"></i></a>closeGeneralForumTopic</h4>
|
|
<p>Use this method to close an open 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the <em>can_manage_topics</em> administrator rights. Returns <em>True</em> on success.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the target chat or username of the target supergroup (in the format <code>@supergroupusername</code>)</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="reopengeneralforumtopic" href="#reopengeneralforumtopic"><i class="anchor-icon"></i></a>reopenGeneralForumTopic</h4>
|
|
<p>Use this method to reopen a closed 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the <em>can_manage_topics</em> administrator rights. The topic will be automatically unhidden if it was hidden. Returns <em>True</em> on success.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the target chat or username of the target supergroup (in the format <code>@supergroupusername</code>)</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="hidegeneralforumtopic" href="#hidegeneralforumtopic"><i class="anchor-icon"></i></a>hideGeneralForumTopic</h4>
|
|
<p>Use this method to hide the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the <em>can_manage_topics</em> administrator rights. The topic will be automatically closed if it was open. Returns <em>True</em> on success.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the target chat or username of the target supergroup (in the format <code>@supergroupusername</code>)</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="unhidegeneralforumtopic" href="#unhidegeneralforumtopic"><i class="anchor-icon"></i></a>unhideGeneralForumTopic</h4>
|
|
<p>Use this method to unhide the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the <em>can_manage_topics</em> administrator rights. Returns <em>True</em> on success.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the target chat or username of the target supergroup (in the format <code>@supergroupusername</code>)</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="answercallbackquery" href="#answercallbackquery"><i class="anchor-icon"></i></a>answerCallbackQuery</h4>
|
|
<p>Use this method to send answers to callback queries sent from <a href="/bots/features#inline-keyboards">inline keyboards</a>. The answer will be displayed to the user as a notification at the top of the chat screen or as an alert. On success, <em>True</em> is returned.</p>
|
|
<blockquote>
|
|
<p>Alternatively, the user can be redirected to the specified Game URL. For this option to work, you must first create a game for your bot via <a href="https://t.me/botfather">@BotFather</a> and accept the terms. Otherwise, you may use links like <code>t.me/your_bot?start=XXXX</code> that open your bot with a parameter.</p>
|
|
</blockquote>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>callback_query_id</td>
|
|
<td>String</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the query to be answered</td>
|
|
</tr>
|
|
<tr>
|
|
<td>text</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>Text of the notification. If not specified, nothing will be shown to the user, 0-200 characters</td>
|
|
</tr>
|
|
<tr>
|
|
<td>show_alert</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>If <em>True</em>, an alert will be shown by the client instead of a notification at the top of the chat screen. Defaults to <em>false</em>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>url</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>URL that will be opened by the user's client. If you have created a <a href="#game">Game</a> and accepted the conditions via <a href="https://t.me/botfather">@BotFather</a>, specify the URL that opens your game - note that this will only work if the query comes from a <a href="#inlinekeyboardbutton"><em>callback_game</em></a> button.<br><br>Otherwise, you may use links like <code>t.me/your_bot?start=XXXX</code> that open your bot with a parameter.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>cache_time</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>The maximum amount of time in seconds that the result of the callback query may be cached client-side. Telegram apps will support caching starting in version 3.14. Defaults to 0.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="setmycommands" href="#setmycommands"><i class="anchor-icon"></i></a>setMyCommands</h4>
|
|
<p>Use this method to change the list of the bot's commands. See <a href="/bots/features#commands">this manual</a> for more details about bot commands. Returns <em>True</em> on success.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>commands</td>
|
|
<td>Array of <a href="#botcommand">BotCommand</a></td>
|
|
<td>Yes</td>
|
|
<td>A JSON-serialized list of bot commands to be set as the list of the bot's commands. At most 100 commands can be specified.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>scope</td>
|
|
<td><a href="#botcommandscope">BotCommandScope</a></td>
|
|
<td>Optional</td>
|
|
<td>A JSON-serialized object, describing scope of users for which the commands are relevant. Defaults to <a href="#botcommandscopedefault">BotCommandScopeDefault</a>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>language_code</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>A two-letter ISO 639-1 language code. If empty, commands will be applied to all users from the given scope, for whose language there are no dedicated commands</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="deletemycommands" href="#deletemycommands"><i class="anchor-icon"></i></a>deleteMyCommands</h4>
|
|
<p>Use this method to delete the list of the bot's commands for the given scope and user language. After deletion, <a href="#determining-list-of-commands">higher level commands</a> will be shown to affected users. Returns <em>True</em> on success.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>scope</td>
|
|
<td><a href="#botcommandscope">BotCommandScope</a></td>
|
|
<td>Optional</td>
|
|
<td>A JSON-serialized object, describing scope of users for which the commands are relevant. Defaults to <a href="#botcommandscopedefault">BotCommandScopeDefault</a>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>language_code</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>A two-letter ISO 639-1 language code. If empty, commands will be applied to all users from the given scope, for whose language there are no dedicated commands</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="getmycommands" href="#getmycommands"><i class="anchor-icon"></i></a>getMyCommands</h4>
|
|
<p>Use this method to get the current list of the bot's commands for the given scope and user language. Returns an Array of <a href="#botcommand">BotCommand</a> objects. If commands aren't set, an empty list is returned.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>scope</td>
|
|
<td><a href="#botcommandscope">BotCommandScope</a></td>
|
|
<td>Optional</td>
|
|
<td>A JSON-serialized object, describing scope of users. Defaults to <a href="#botcommandscopedefault">BotCommandScopeDefault</a>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>language_code</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>A two-letter ISO 639-1 language code or an empty string</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="setmyname" href="#setmyname"><i class="anchor-icon"></i></a>setMyName</h4>
|
|
<p>Use this method to change the bot's name. Returns <em>True</em> on success.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>name</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>New bot name; 0-64 characters. Pass an empty string to remove the dedicated name for the given language.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>language_code</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>A two-letter ISO 639-1 language code. If empty, the name will be shown to all users for whose language there is no dedicated name.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="getmyname" href="#getmyname"><i class="anchor-icon"></i></a>getMyName</h4>
|
|
<p>Use this method to get the current bot name for the given user language. Returns <a href="#botname">BotName</a> on success.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>language_code</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>A two-letter ISO 639-1 language code or an empty string</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="setmydescription" href="#setmydescription"><i class="anchor-icon"></i></a>setMyDescription</h4>
|
|
<p>Use this method to change the bot's description, which is shown in the chat with the bot if the chat is empty. Returns <em>True</em> on success.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>description</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>New bot description; 0-512 characters. Pass an empty string to remove the dedicated description for the given language.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>language_code</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>A two-letter ISO 639-1 language code. If empty, the description will be applied to all users for whose language there is no dedicated description.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="getmydescription" href="#getmydescription"><i class="anchor-icon"></i></a>getMyDescription</h4>
|
|
<p>Use this method to get the current bot description for the given user language. Returns <a href="#botdescription">BotDescription</a> on success.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>language_code</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>A two-letter ISO 639-1 language code or an empty string</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="setmyshortdescription" href="#setmyshortdescription"><i class="anchor-icon"></i></a>setMyShortDescription</h4>
|
|
<p>Use this method to change the bot's short description, which is shown on the bot's profile page and is sent together with the link when users share the bot. Returns <em>True</em> on success.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>short_description</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>New short description for the bot; 0-120 characters. Pass an empty string to remove the dedicated short description for the given language.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>language_code</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>A two-letter ISO 639-1 language code. If empty, the short description will be applied to all users for whose language there is no dedicated short description.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="getmyshortdescription" href="#getmyshortdescription"><i class="anchor-icon"></i></a>getMyShortDescription</h4>
|
|
<p>Use this method to get the current bot short description for the given user language. Returns <a href="#botshortdescription">BotShortDescription</a> on success.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>language_code</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>A two-letter ISO 639-1 language code or an empty string</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="setchatmenubutton" href="#setchatmenubutton"><i class="anchor-icon"></i></a>setChatMenuButton</h4>
|
|
<p>Use this method to change the bot's menu button in a private chat, or the default menu button. Returns <em>True</em> on success.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>Unique identifier for the target private chat. If not specified, default bot's menu button will be changed</td>
|
|
</tr>
|
|
<tr>
|
|
<td>menu_button</td>
|
|
<td><a href="#menubutton">MenuButton</a></td>
|
|
<td>Optional</td>
|
|
<td>A JSON-serialized object for the bot's new menu button. Defaults to <a href="#menubuttondefault">MenuButtonDefault</a></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="getchatmenubutton" href="#getchatmenubutton"><i class="anchor-icon"></i></a>getChatMenuButton</h4>
|
|
<p>Use this method to get the current value of the bot's menu button in a private chat, or the default menu button. Returns <a href="#menubutton">MenuButton</a> on success.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>Unique identifier for the target private chat. If not specified, default bot's menu button will be returned</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="setmydefaultadministratorrights" href="#setmydefaultadministratorrights"><i class="anchor-icon"></i></a>setMyDefaultAdministratorRights</h4>
|
|
<p>Use this method to change the default administrator rights requested by the bot when it's added as an administrator to groups or channels. These rights will be suggested to users, but they are free to modify the list before adding the bot. Returns <em>True</em> on success.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>rights</td>
|
|
<td><a href="#chatadministratorrights">ChatAdministratorRights</a></td>
|
|
<td>Optional</td>
|
|
<td>A JSON-serialized object describing new default administrator rights. If not specified, the default administrator rights will be cleared.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>for_channels</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Pass <em>True</em> to change the default administrator rights of the bot in channels. Otherwise, the default administrator rights of the bot for groups and supergroups will be changed.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="getmydefaultadministratorrights" href="#getmydefaultadministratorrights"><i class="anchor-icon"></i></a>getMyDefaultAdministratorRights</h4>
|
|
<p>Use this method to get the current default administrator rights of the bot. Returns <a href="#chatadministratorrights">ChatAdministratorRights</a> on success.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>for_channels</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Pass <em>True</em> to get default administrator rights of the bot in channels. Otherwise, default administrator rights of the bot for groups and supergroups will be returned.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="inline-mode-methods" href="#inline-mode-methods"><i class="anchor-icon"></i></a>Inline mode methods</h4>
|
|
<p>Methods and objects used in the inline mode are described in the <a href="#inline-mode">Inline mode section</a>.</p>
|
|
<h3><a class="anchor" name="updating-messages" href="#updating-messages"><i class="anchor-icon"></i></a>Updating messages</h3>
|
|
<p>The following methods allow you to change an existing message in the message history instead of sending a new one with a result of an action. This is most useful for messages with <a href="/bots/features#inline-keyboards">inline keyboards</a> using callback queries, but can also help reduce clutter in conversations with regular chat bots.</p>
|
|
<p>Please note, that it is currently only possible to edit messages without <em>reply_markup</em> or with <a href="/bots/features#inline-keyboards">inline keyboards</a>.</p>
|
|
<h4><a class="anchor" name="editmessagetext" href="#editmessagetext"><i class="anchor-icon"></i></a>editMessageText</h4>
|
|
<p>Use this method to edit text and <a href="#games">game</a> messages. On success, if the edited message is not an inline message, the edited <a href="#message">Message</a> is returned, otherwise <em>True</em> is returned.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Optional</td>
|
|
<td>Required if <em>inline_message_id</em> is not specified. Unique identifier for the target chat or username of the target channel (in the format <code>@channelusername</code>)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>message_id</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>Required if <em>inline_message_id</em> is not specified. Identifier of the message to edit</td>
|
|
</tr>
|
|
<tr>
|
|
<td>inline_message_id</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>Required if <em>chat_id</em> and <em>message_id</em> are not specified. Identifier of the inline message</td>
|
|
</tr>
|
|
<tr>
|
|
<td>text</td>
|
|
<td>String</td>
|
|
<td>Yes</td>
|
|
<td>New text of the message, 1-4096 characters after entities parsing</td>
|
|
</tr>
|
|
<tr>
|
|
<td>parse_mode</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>Mode for parsing entities in the message text. See <a href="#formatting-options">formatting options</a> for more details.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>entities</td>
|
|
<td>Array of <a href="#messageentity">MessageEntity</a></td>
|
|
<td>Optional</td>
|
|
<td>A JSON-serialized list of special entities that appear in message text, which can be specified instead of <em>parse_mode</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>disable_web_page_preview</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Disables link previews for links in this message</td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply_markup</td>
|
|
<td><a href="#inlinekeyboardmarkup">InlineKeyboardMarkup</a></td>
|
|
<td>Optional</td>
|
|
<td>A JSON-serialized object for an <a href="/bots/features#inline-keyboards">inline keyboard</a>.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="editmessagecaption" href="#editmessagecaption"><i class="anchor-icon"></i></a>editMessageCaption</h4>
|
|
<p>Use this method to edit captions of messages. On success, if the edited message is not an inline message, the edited <a href="#message">Message</a> is returned, otherwise <em>True</em> is returned.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Optional</td>
|
|
<td>Required if <em>inline_message_id</em> is not specified. Unique identifier for the target chat or username of the target channel (in the format <code>@channelusername</code>)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>message_id</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>Required if <em>inline_message_id</em> is not specified. Identifier of the message to edit</td>
|
|
</tr>
|
|
<tr>
|
|
<td>inline_message_id</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>Required if <em>chat_id</em> and <em>message_id</em> are not specified. Identifier of the inline message</td>
|
|
</tr>
|
|
<tr>
|
|
<td>caption</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>New caption of the message, 0-1024 characters after entities parsing</td>
|
|
</tr>
|
|
<tr>
|
|
<td>parse_mode</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>Mode for parsing entities in the message caption. See <a href="#formatting-options">formatting options</a> for more details.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>caption_entities</td>
|
|
<td>Array of <a href="#messageentity">MessageEntity</a></td>
|
|
<td>Optional</td>
|
|
<td>A JSON-serialized list of special entities that appear in the caption, which can be specified instead of <em>parse_mode</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply_markup</td>
|
|
<td><a href="#inlinekeyboardmarkup">InlineKeyboardMarkup</a></td>
|
|
<td>Optional</td>
|
|
<td>A JSON-serialized object for an <a href="/bots/features#inline-keyboards">inline keyboard</a>.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="editmessagemedia" href="#editmessagemedia"><i class="anchor-icon"></i></a>editMessageMedia</h4>
|
|
<p>Use this method to edit animation, audio, document, photo, or video messages. If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo or a video otherwise. When an inline message is edited, a new file can't be uploaded; use a previously uploaded file via its file_id or specify a URL. On success, if the edited message is not an inline message, the edited <a href="#message">Message</a> is returned, otherwise <em>True</em> is returned.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Optional</td>
|
|
<td>Required if <em>inline_message_id</em> is not specified. Unique identifier for the target chat or username of the target channel (in the format <code>@channelusername</code>)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>message_id</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>Required if <em>inline_message_id</em> is not specified. Identifier of the message to edit</td>
|
|
</tr>
|
|
<tr>
|
|
<td>inline_message_id</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>Required if <em>chat_id</em> and <em>message_id</em> are not specified. Identifier of the inline message</td>
|
|
</tr>
|
|
<tr>
|
|
<td>media</td>
|
|
<td><a href="#inputmedia">InputMedia</a></td>
|
|
<td>Yes</td>
|
|
<td>A JSON-serialized object for a new media content of the message</td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply_markup</td>
|
|
<td><a href="#inlinekeyboardmarkup">InlineKeyboardMarkup</a></td>
|
|
<td>Optional</td>
|
|
<td>A JSON-serialized object for a new <a href="/bots/features#inline-keyboards">inline keyboard</a>.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="editmessagelivelocation" href="#editmessagelivelocation"><i class="anchor-icon"></i></a>editMessageLiveLocation</h4>
|
|
<p>Use this method to edit live location messages. A location can be edited until its <em>live_period</em> expires or editing is explicitly disabled by a call to <a href="#stopmessagelivelocation">stopMessageLiveLocation</a>. On success, if the edited message is not an inline message, the edited <a href="#message">Message</a> is returned, otherwise <em>True</em> is returned.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Optional</td>
|
|
<td>Required if <em>inline_message_id</em> is not specified. Unique identifier for the target chat or username of the target channel (in the format <code>@channelusername</code>)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>message_id</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>Required if <em>inline_message_id</em> is not specified. Identifier of the message to edit</td>
|
|
</tr>
|
|
<tr>
|
|
<td>inline_message_id</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>Required if <em>chat_id</em> and <em>message_id</em> are not specified. Identifier of the inline message</td>
|
|
</tr>
|
|
<tr>
|
|
<td>latitude</td>
|
|
<td>Float number</td>
|
|
<td>Yes</td>
|
|
<td>Latitude of new location</td>
|
|
</tr>
|
|
<tr>
|
|
<td>longitude</td>
|
|
<td>Float number</td>
|
|
<td>Yes</td>
|
|
<td>Longitude of new location</td>
|
|
</tr>
|
|
<tr>
|
|
<td>horizontal_accuracy</td>
|
|
<td>Float number</td>
|
|
<td>Optional</td>
|
|
<td>The radius of uncertainty for the location, measured in meters; 0-1500</td>
|
|
</tr>
|
|
<tr>
|
|
<td>heading</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>Direction in which the user is moving, in degrees. Must be between 1 and 360 if specified.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>proximity_alert_radius</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>The maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply_markup</td>
|
|
<td><a href="#inlinekeyboardmarkup">InlineKeyboardMarkup</a></td>
|
|
<td>Optional</td>
|
|
<td>A JSON-serialized object for a new <a href="/bots/features#inline-keyboards">inline keyboard</a>.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="stopmessagelivelocation" href="#stopmessagelivelocation"><i class="anchor-icon"></i></a>stopMessageLiveLocation</h4>
|
|
<p>Use this method to stop updating a live location message before <em>live_period</em> expires. On success, if the message is not an inline message, the edited <a href="#message">Message</a> is returned, otherwise <em>True</em> is returned.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Optional</td>
|
|
<td>Required if <em>inline_message_id</em> is not specified. Unique identifier for the target chat or username of the target channel (in the format <code>@channelusername</code>)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>message_id</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>Required if <em>inline_message_id</em> is not specified. Identifier of the message with live location to stop</td>
|
|
</tr>
|
|
<tr>
|
|
<td>inline_message_id</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>Required if <em>chat_id</em> and <em>message_id</em> are not specified. Identifier of the inline message</td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply_markup</td>
|
|
<td><a href="#inlinekeyboardmarkup">InlineKeyboardMarkup</a></td>
|
|
<td>Optional</td>
|
|
<td>A JSON-serialized object for a new <a href="/bots/features#inline-keyboards">inline keyboard</a>.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="editmessagereplymarkup" href="#editmessagereplymarkup"><i class="anchor-icon"></i></a>editMessageReplyMarkup</h4>
|
|
<p>Use this method to edit only the reply markup of messages. On success, if the edited message is not an inline message, the edited <a href="#message">Message</a> is returned, otherwise <em>True</em> is returned.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Optional</td>
|
|
<td>Required if <em>inline_message_id</em> is not specified. Unique identifier for the target chat or username of the target channel (in the format <code>@channelusername</code>)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>message_id</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>Required if <em>inline_message_id</em> is not specified. Identifier of the message to edit</td>
|
|
</tr>
|
|
<tr>
|
|
<td>inline_message_id</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>Required if <em>chat_id</em> and <em>message_id</em> are not specified. Identifier of the inline message</td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply_markup</td>
|
|
<td><a href="#inlinekeyboardmarkup">InlineKeyboardMarkup</a></td>
|
|
<td>Optional</td>
|
|
<td>A JSON-serialized object for an <a href="/bots/features#inline-keyboards">inline keyboard</a>.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="stoppoll" href="#stoppoll"><i class="anchor-icon"></i></a>stopPoll</h4>
|
|
<p>Use this method to stop a poll which was sent by the bot. On success, the stopped <a href="#poll">Poll</a> is returned.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the target chat or username of the target channel (in the format <code>@channelusername</code>)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>message_id</td>
|
|
<td>Integer</td>
|
|
<td>Yes</td>
|
|
<td>Identifier of the original message with the poll</td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply_markup</td>
|
|
<td><a href="#inlinekeyboardmarkup">InlineKeyboardMarkup</a></td>
|
|
<td>Optional</td>
|
|
<td>A JSON-serialized object for a new message <a href="/bots/features#inline-keyboards">inline keyboard</a>.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="deletemessage" href="#deletemessage"><i class="anchor-icon"></i></a>deleteMessage</h4>
|
|
<p>Use this method to delete a message, including service messages, with the following limitations:<br>- A message can only be deleted if it was sent less than 48 hours ago.<br>- Service messages about a supergroup, channel, or forum topic creation can't be deleted.<br>- A dice message in a private chat can only be deleted if it was sent more than 24 hours ago.<br>- Bots can delete outgoing messages in private chats, groups, and supergroups.<br>- Bots can delete incoming messages in private chats.<br>- Bots granted <em>can_post_messages</em> permissions can delete outgoing messages in channels.<br>- If the bot is an administrator of a group, it can delete any message there.<br>- If the bot has <em>can_delete_messages</em> permission in a supergroup or a channel, it can delete any message there.<br>Returns <em>True</em> on success.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the target chat or username of the target channel (in the format <code>@channelusername</code>)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>message_id</td>
|
|
<td>Integer</td>
|
|
<td>Yes</td>
|
|
<td>Identifier of the message to delete</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h3><a class="anchor" name="stickers" href="#stickers"><i class="anchor-icon"></i></a>Stickers</h3>
|
|
<p>The following methods and objects allow your bot to handle stickers and sticker sets.</p>
|
|
<h4><a class="anchor" name="sticker" href="#sticker"><i class="anchor-icon"></i></a>Sticker</h4>
|
|
<p>This object represents a sticker.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>file_id</td>
|
|
<td>String</td>
|
|
<td>Identifier for this file, which can be used to download or reuse the file</td>
|
|
</tr>
|
|
<tr>
|
|
<td>file_unique_id</td>
|
|
<td>String</td>
|
|
<td>Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>type</td>
|
|
<td>String</td>
|
|
<td>Type of the sticker, currently one of “regular”, “mask”, “custom_emoji”. The type of the sticker is independent from its format, which is determined by the fields <em>is_animated</em> and <em>is_video</em>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>width</td>
|
|
<td>Integer</td>
|
|
<td>Sticker width</td>
|
|
</tr>
|
|
<tr>
|
|
<td>height</td>
|
|
<td>Integer</td>
|
|
<td>Sticker height</td>
|
|
</tr>
|
|
<tr>
|
|
<td>is_animated</td>
|
|
<td>Boolean</td>
|
|
<td><em>True</em>, if the sticker is <a href="https://telegram.org/blog/animated-stickers">animated</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td>is_video</td>
|
|
<td>Boolean</td>
|
|
<td><em>True</em>, if the sticker is a <a href="https://telegram.org/blog/video-stickers-better-reactions">video sticker</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td>thumbnail</td>
|
|
<td><a href="#photosize">PhotoSize</a></td>
|
|
<td><em>Optional</em>. Sticker thumbnail in the .WEBP or .JPG format</td>
|
|
</tr>
|
|
<tr>
|
|
<td>emoji</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Emoji associated with the sticker</td>
|
|
</tr>
|
|
<tr>
|
|
<td>set_name</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Name of the sticker set to which the sticker belongs</td>
|
|
</tr>
|
|
<tr>
|
|
<td>premium_animation</td>
|
|
<td><a href="#file">File</a></td>
|
|
<td><em>Optional</em>. For premium regular stickers, premium animation for the sticker</td>
|
|
</tr>
|
|
<tr>
|
|
<td>mask_position</td>
|
|
<td><a href="#maskposition">MaskPosition</a></td>
|
|
<td><em>Optional</em>. For mask stickers, the position where the mask should be placed</td>
|
|
</tr>
|
|
<tr>
|
|
<td>custom_emoji_id</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. For custom emoji stickers, unique identifier of the custom emoji</td>
|
|
</tr>
|
|
<tr>
|
|
<td>needs_repainting</td>
|
|
<td>True</td>
|
|
<td><em>Optional</em>. <em>True</em>, if the sticker must be repainted to a text color in messages, the color of the Telegram Premium badge in emoji status, white color on chat photos, or another appropriate color in other places</td>
|
|
</tr>
|
|
<tr>
|
|
<td>file_size</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. File size in bytes</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="stickerset" href="#stickerset"><i class="anchor-icon"></i></a>StickerSet</h4>
|
|
<p>This object represents a sticker set.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>name</td>
|
|
<td>String</td>
|
|
<td>Sticker set name</td>
|
|
</tr>
|
|
<tr>
|
|
<td>title</td>
|
|
<td>String</td>
|
|
<td>Sticker set title</td>
|
|
</tr>
|
|
<tr>
|
|
<td>sticker_type</td>
|
|
<td>String</td>
|
|
<td>Type of stickers in the set, currently one of “regular”, “mask”, “custom_emoji”</td>
|
|
</tr>
|
|
<tr>
|
|
<td>is_animated</td>
|
|
<td>Boolean</td>
|
|
<td><em>True</em>, if the sticker set contains <a href="https://telegram.org/blog/animated-stickers">animated stickers</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td>is_video</td>
|
|
<td>Boolean</td>
|
|
<td><em>True</em>, if the sticker set contains <a href="https://telegram.org/blog/video-stickers-better-reactions">video stickers</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td>stickers</td>
|
|
<td>Array of <a href="#sticker">Sticker</a></td>
|
|
<td>List of all set stickers</td>
|
|
</tr>
|
|
<tr>
|
|
<td>thumbnail</td>
|
|
<td><a href="#photosize">PhotoSize</a></td>
|
|
<td><em>Optional</em>. Sticker set thumbnail in the .WEBP, .TGS, or .WEBM format</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="maskposition" href="#maskposition"><i class="anchor-icon"></i></a>MaskPosition</h4>
|
|
<p>This object describes the position on faces where a mask should be placed by default.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>point</td>
|
|
<td>String</td>
|
|
<td>The part of the face relative to which the mask should be placed. One of “forehead”, “eyes”, “mouth”, or “chin”.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>x_shift</td>
|
|
<td>Float number</td>
|
|
<td>Shift by X-axis measured in widths of the mask scaled to the face size, from left to right. For example, choosing -1.0 will place mask just to the left of the default mask position.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>y_shift</td>
|
|
<td>Float number</td>
|
|
<td>Shift by Y-axis measured in heights of the mask scaled to the face size, from top to bottom. For example, 1.0 will place the mask just below the default mask position.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>scale</td>
|
|
<td>Float number</td>
|
|
<td>Mask scaling coefficient. For example, 2.0 means double size.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="inputsticker" href="#inputsticker"><i class="anchor-icon"></i></a>InputSticker</h4>
|
|
<p>This object describes a sticker to be added to a sticker set.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>sticker</td>
|
|
<td><a href="#inputfile">InputFile</a> or String</td>
|
|
<td>The added sticker. Pass a <em>file_id</em> as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, upload a new one using multipart/form-data, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. Animated and video stickers can't be uploaded via HTTP URL. <a href="#sending-files">More information on Sending Files »</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td>emoji_list</td>
|
|
<td>Array of String</td>
|
|
<td>List of 1-20 emoji associated with the sticker</td>
|
|
</tr>
|
|
<tr>
|
|
<td>mask_position</td>
|
|
<td><a href="#maskposition">MaskPosition</a></td>
|
|
<td><em>Optional</em>. Position where the mask should be placed on faces. For “mask” stickers only.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>keywords</td>
|
|
<td>Array of String</td>
|
|
<td><em>Optional</em>. List of 0-20 search keywords for the sticker with total length of up to 64 characters. For “regular” and “custom_emoji” stickers only.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="sendsticker" href="#sendsticker"><i class="anchor-icon"></i></a>sendSticker</h4>
|
|
<p>Use this method to send static .WEBP, <a href="https://telegram.org/blog/animated-stickers">animated</a> .TGS, or <a href="https://telegram.org/blog/video-stickers-better-reactions">video</a> .WEBM stickers. On success, the sent <a href="#message">Message</a> is returned.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the target chat or username of the target channel (in the format <code>@channelusername</code>)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>message_thread_id</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>Unique identifier for the target message thread (topic) of the forum; for forum supergroups only</td>
|
|
</tr>
|
|
<tr>
|
|
<td>sticker</td>
|
|
<td><a href="#inputfile">InputFile</a> or String</td>
|
|
<td>Yes</td>
|
|
<td>Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP sticker from the Internet, or upload a new .WEBP or .TGS sticker using multipart/form-data. <a href="#sending-files">More information on Sending Files »</a>. Video stickers can only be sent by a file_id. Animated stickers can't be sent via an HTTP URL.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>emoji</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>Emoji associated with the sticker; only for just uploaded stickers</td>
|
|
</tr>
|
|
<tr>
|
|
<td>disable_notification</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Sends the message <a href="https://telegram.org/blog/channels-2-0#silent-messages">silently</a>. Users will receive a notification with no sound.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>protect_content</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Protects the contents of the sent message from forwarding and saving</td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply_to_message_id</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>If the message is a reply, ID of the original message</td>
|
|
</tr>
|
|
<tr>
|
|
<td>allow_sending_without_reply</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Pass <em>True</em> if the message should be sent even if the specified replied-to message is not found</td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply_markup</td>
|
|
<td><a href="#inlinekeyboardmarkup">InlineKeyboardMarkup</a> or <a href="#replykeyboardmarkup">ReplyKeyboardMarkup</a> or <a href="#replykeyboardremove">ReplyKeyboardRemove</a> or <a href="#forcereply">ForceReply</a></td>
|
|
<td>Optional</td>
|
|
<td>Additional interface options. A JSON-serialized object for an <a href="/bots/features#inline-keyboards">inline keyboard</a>, <a href="/bots/features#keyboards">custom reply keyboard</a>, instructions to remove reply keyboard or to force a reply from the user.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="getstickerset" href="#getstickerset"><i class="anchor-icon"></i></a>getStickerSet</h4>
|
|
<p>Use this method to get a sticker set. On success, a <a href="#stickerset">StickerSet</a> object is returned.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>name</td>
|
|
<td>String</td>
|
|
<td>Yes</td>
|
|
<td>Name of the sticker set</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="getcustomemojistickers" href="#getcustomemojistickers"><i class="anchor-icon"></i></a>getCustomEmojiStickers</h4>
|
|
<p>Use this method to get information about custom emoji stickers by their identifiers. Returns an Array of <a href="#sticker">Sticker</a> objects.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>custom_emoji_ids</td>
|
|
<td>Array of String</td>
|
|
<td>Yes</td>
|
|
<td>List of custom emoji identifiers. At most 200 custom emoji identifiers can be specified.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="uploadstickerfile" href="#uploadstickerfile"><i class="anchor-icon"></i></a>uploadStickerFile</h4>
|
|
<p>Use this method to upload a file with a sticker for later use in the <a href="#createnewstickerset">createNewStickerSet</a> and <a href="#addstickertoset">addStickerToSet</a> methods (the file can be used multiple times). Returns the uploaded <a href="#file">File</a> on success.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>user_id</td>
|
|
<td>Integer</td>
|
|
<td>Yes</td>
|
|
<td>User identifier of sticker file owner</td>
|
|
</tr>
|
|
<tr>
|
|
<td>sticker</td>
|
|
<td><a href="#inputfile">InputFile</a></td>
|
|
<td>Yes</td>
|
|
<td>A file with the sticker in .WEBP, .PNG, .TGS, or .WEBM format. See <a href="/stickers"><a href="https://core.telegram.org/stickers">https://core.telegram.org/stickers</a></a> for technical requirements. <a href="#sending-files">More information on Sending Files »</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td>sticker_format</td>
|
|
<td>String</td>
|
|
<td>Yes</td>
|
|
<td>Format of the sticker, must be one of “static”, “animated”, “video”</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="createnewstickerset" href="#createnewstickerset"><i class="anchor-icon"></i></a>createNewStickerSet</h4>
|
|
<p>Use this method to create a new sticker set owned by a user. The bot will be able to edit the sticker set thus created. Returns <em>True</em> on success.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>user_id</td>
|
|
<td>Integer</td>
|
|
<td>Yes</td>
|
|
<td>User identifier of created sticker set owner</td>
|
|
</tr>
|
|
<tr>
|
|
<td>name</td>
|
|
<td>String</td>
|
|
<td>Yes</td>
|
|
<td>Short name of sticker set, to be used in <code>t.me/addstickers/</code> URLs (e.g., <em>animals</em>). Can contain only English letters, digits and underscores. Must begin with a letter, can't contain consecutive underscores and must end in <code>"_by_<bot_username>"</code>. <code><bot_username></code> is case insensitive. 1-64 characters.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>title</td>
|
|
<td>String</td>
|
|
<td>Yes</td>
|
|
<td>Sticker set title, 1-64 characters</td>
|
|
</tr>
|
|
<tr>
|
|
<td>stickers</td>
|
|
<td>Array of <a href="#inputsticker">InputSticker</a></td>
|
|
<td>Yes</td>
|
|
<td>A JSON-serialized list of 1-50 initial stickers to be added to the sticker set</td>
|
|
</tr>
|
|
<tr>
|
|
<td>sticker_format</td>
|
|
<td>String</td>
|
|
<td>Yes</td>
|
|
<td>Format of stickers in the set, must be one of “static”, “animated”, “video”</td>
|
|
</tr>
|
|
<tr>
|
|
<td>sticker_type</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>Type of stickers in the set, pass “regular”, “mask”, or “custom_emoji”. By default, a regular sticker set is created.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>needs_repainting</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Pass <em>True</em> if stickers in the sticker set must be repainted to the color of text when used in messages, the accent color if used as emoji status, white on chat photos, or another appropriate color based on context; for custom emoji sticker sets only</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="addstickertoset" href="#addstickertoset"><i class="anchor-icon"></i></a>addStickerToSet</h4>
|
|
<p>Use this method to add a new sticker to a set created by the bot. The format of the added sticker must match the format of the other stickers in the set. Emoji sticker sets can have up to 200 stickers. Animated and video sticker sets can have up to 50 stickers. Static sticker sets can have up to 120 stickers. Returns <em>True</em> on success.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>user_id</td>
|
|
<td>Integer</td>
|
|
<td>Yes</td>
|
|
<td>User identifier of sticker set owner</td>
|
|
</tr>
|
|
<tr>
|
|
<td>name</td>
|
|
<td>String</td>
|
|
<td>Yes</td>
|
|
<td>Sticker set name</td>
|
|
</tr>
|
|
<tr>
|
|
<td>sticker</td>
|
|
<td><a href="#inputsticker">InputSticker</a></td>
|
|
<td>Yes</td>
|
|
<td>A JSON-serialized object with information about the added sticker. If exactly the same sticker had already been added to the set, then the set isn't changed.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="setstickerpositioninset" href="#setstickerpositioninset"><i class="anchor-icon"></i></a>setStickerPositionInSet</h4>
|
|
<p>Use this method to move a sticker in a set created by the bot to a specific position. Returns <em>True</em> on success.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>sticker</td>
|
|
<td>String</td>
|
|
<td>Yes</td>
|
|
<td>File identifier of the sticker</td>
|
|
</tr>
|
|
<tr>
|
|
<td>position</td>
|
|
<td>Integer</td>
|
|
<td>Yes</td>
|
|
<td>New sticker position in the set, zero-based</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="deletestickerfromset" href="#deletestickerfromset"><i class="anchor-icon"></i></a>deleteStickerFromSet</h4>
|
|
<p>Use this method to delete a sticker from a set created by the bot. Returns <em>True</em> on success.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>sticker</td>
|
|
<td>String</td>
|
|
<td>Yes</td>
|
|
<td>File identifier of the sticker</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="setstickeremojilist" href="#setstickeremojilist"><i class="anchor-icon"></i></a>setStickerEmojiList</h4>
|
|
<p>Use this method to change the list of emoji assigned to a regular or custom emoji sticker. The sticker must belong to a sticker set created by the bot. Returns <em>True</em> on success.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>sticker</td>
|
|
<td>String</td>
|
|
<td>Yes</td>
|
|
<td>File identifier of the sticker</td>
|
|
</tr>
|
|
<tr>
|
|
<td>emoji_list</td>
|
|
<td>Array of String</td>
|
|
<td>Yes</td>
|
|
<td>A JSON-serialized list of 1-20 emoji associated with the sticker</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="setstickerkeywords" href="#setstickerkeywords"><i class="anchor-icon"></i></a>setStickerKeywords</h4>
|
|
<p>Use this method to change search keywords assigned to a regular or custom emoji sticker. The sticker must belong to a sticker set created by the bot. Returns <em>True</em> on success.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>sticker</td>
|
|
<td>String</td>
|
|
<td>Yes</td>
|
|
<td>File identifier of the sticker</td>
|
|
</tr>
|
|
<tr>
|
|
<td>keywords</td>
|
|
<td>Array of String</td>
|
|
<td>Optional</td>
|
|
<td>A JSON-serialized list of 0-20 search keywords for the sticker with total length of up to 64 characters</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="setstickermaskposition" href="#setstickermaskposition"><i class="anchor-icon"></i></a>setStickerMaskPosition</h4>
|
|
<p>Use this method to change the <a href="#maskposition">mask position</a> of a mask sticker. The sticker must belong to a sticker set that was created by the bot. Returns <em>True</em> on success.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>sticker</td>
|
|
<td>String</td>
|
|
<td>Yes</td>
|
|
<td>File identifier of the sticker</td>
|
|
</tr>
|
|
<tr>
|
|
<td>mask_position</td>
|
|
<td><a href="#maskposition">MaskPosition</a></td>
|
|
<td>Optional</td>
|
|
<td>A JSON-serialized object with the position where the mask should be placed on faces. Omit the parameter to remove the mask position.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="setstickersettitle" href="#setstickersettitle"><i class="anchor-icon"></i></a>setStickerSetTitle</h4>
|
|
<p>Use this method to set the title of a created sticker set. Returns <em>True</em> on success.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>name</td>
|
|
<td>String</td>
|
|
<td>Yes</td>
|
|
<td>Sticker set name</td>
|
|
</tr>
|
|
<tr>
|
|
<td>title</td>
|
|
<td>String</td>
|
|
<td>Yes</td>
|
|
<td>Sticker set title, 1-64 characters</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="setstickersetthumbnail" href="#setstickersetthumbnail"><i class="anchor-icon"></i></a>setStickerSetThumbnail</h4>
|
|
<p>Use this method to set the thumbnail of a regular or mask sticker set. The format of the thumbnail file must match the format of the stickers in the set. Returns <em>True</em> on success.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>name</td>
|
|
<td>String</td>
|
|
<td>Yes</td>
|
|
<td>Sticker set name</td>
|
|
</tr>
|
|
<tr>
|
|
<td>user_id</td>
|
|
<td>Integer</td>
|
|
<td>Yes</td>
|
|
<td>User identifier of the sticker set owner</td>
|
|
</tr>
|
|
<tr>
|
|
<td>thumbnail</td>
|
|
<td><a href="#inputfile">InputFile</a> or String</td>
|
|
<td>Optional</td>
|
|
<td>A <strong>.WEBP</strong> or <strong>.PNG</strong> image with the thumbnail, must be up to 128 kilobytes in size and have a width and height of exactly 100px, or a <strong>.TGS</strong> animation with a thumbnail up to 32 kilobytes in size (see <a href="/stickers#animated-sticker-requirements"><a href="https://core.telegram.org/stickers#animated-sticker-requirements">https://core.telegram.org/stickers#animated-sticker-requirements</a></a> for animated sticker technical requirements), or a <strong>WEBM</strong> video with the thumbnail up to 32 kilobytes in size; see <a href="/stickers#video-sticker-requirements"><a href="https://core.telegram.org/stickers#video-sticker-requirements">https://core.telegram.org/stickers#video-sticker-requirements</a></a> for video sticker technical requirements. Pass a <em>file_id</em> as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. <a href="#sending-files">More information on Sending Files »</a>. Animated and video sticker set thumbnails can't be uploaded via HTTP URL. If omitted, then the thumbnail is dropped and the first sticker is used as the thumbnail.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="setcustomemojistickersetthumbnail" href="#setcustomemojistickersetthumbnail"><i class="anchor-icon"></i></a>setCustomEmojiStickerSetThumbnail</h4>
|
|
<p>Use this method to set the thumbnail of a custom emoji sticker set. Returns <em>True</em> on success.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>name</td>
|
|
<td>String</td>
|
|
<td>Yes</td>
|
|
<td>Sticker set name</td>
|
|
</tr>
|
|
<tr>
|
|
<td>custom_emoji_id</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>Custom emoji identifier of a sticker from the sticker set; pass an empty string to drop the thumbnail and use the first sticker as the thumbnail.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="deletestickerset" href="#deletestickerset"><i class="anchor-icon"></i></a>deleteStickerSet</h4>
|
|
<p>Use this method to delete a sticker set that was created by the bot. Returns <em>True</em> on success.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>name</td>
|
|
<td>String</td>
|
|
<td>Yes</td>
|
|
<td>Sticker set name</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h3><a class="anchor" name="inline-mode" href="#inline-mode"><i class="anchor-icon"></i></a>Inline mode</h3>
|
|
<p>The following methods and objects allow your bot to work in <a href="/bots/inline">inline mode</a>.<br>Please see our <a href="/bots/inline">Introduction to Inline bots</a> for more details.</p>
|
|
<p>To enable this option, send the <code>/setinline</code> command to <a href="https://t.me/botfather">@BotFather</a> and provide the placeholder text that the user will see in the input field after typing your bot's name.</p>
|
|
<h4><a class="anchor" name="inlinequery" href="#inlinequery"><i class="anchor-icon"></i></a>InlineQuery</h4>
|
|
<p>This object represents an incoming inline query. When the user sends an empty query, your bot could return some default or trending results.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>id</td>
|
|
<td>String</td>
|
|
<td>Unique identifier for this query</td>
|
|
</tr>
|
|
<tr>
|
|
<td>from</td>
|
|
<td><a href="#user">User</a></td>
|
|
<td>Sender</td>
|
|
</tr>
|
|
<tr>
|
|
<td>query</td>
|
|
<td>String</td>
|
|
<td>Text of the query (up to 256 characters)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>offset</td>
|
|
<td>String</td>
|
|
<td>Offset of the results to be returned, can be controlled by the bot</td>
|
|
</tr>
|
|
<tr>
|
|
<td>chat_type</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Type of the chat from which the inline query was sent. Can be either “sender” for a private chat with the inline query sender, “private”, “group”, “supergroup”, or “channel”. The chat type should be always known for requests sent from official clients and most third-party clients, unless the request was sent from a secret chat</td>
|
|
</tr>
|
|
<tr>
|
|
<td>location</td>
|
|
<td><a href="#location">Location</a></td>
|
|
<td><em>Optional</em>. Sender location, only for bots that request user location</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="answerinlinequery" href="#answerinlinequery"><i class="anchor-icon"></i></a>answerInlineQuery</h4>
|
|
<p>Use this method to send answers to an inline query. On success, <em>True</em> is returned.<br>No more than <strong>50</strong> results per query are allowed.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>inline_query_id</td>
|
|
<td>String</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the answered query</td>
|
|
</tr>
|
|
<tr>
|
|
<td>results</td>
|
|
<td>Array of <a href="#inlinequeryresult">InlineQueryResult</a></td>
|
|
<td>Yes</td>
|
|
<td>A JSON-serialized array of results for the inline query</td>
|
|
</tr>
|
|
<tr>
|
|
<td>cache_time</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>The maximum amount of time in seconds that the result of the inline query may be cached on the server. Defaults to 300.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>is_personal</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Pass <em>True</em> if results may be cached on the server side only for the user that sent the query. By default, results may be returned to any user who sends the same query.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>next_offset</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>Pass the offset that a client should send in the next query with the same text to receive more results. Pass an empty string if there are no more results or if you don't support pagination. Offset length can't exceed 64 bytes.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>button</td>
|
|
<td><a href="#inlinequeryresultsbutton">InlineQueryResultsButton</a></td>
|
|
<td>Optional</td>
|
|
<td>A JSON-serialized object describing a button to be shown above inline query results</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="inlinequeryresultsbutton" href="#inlinequeryresultsbutton"><i class="anchor-icon"></i></a>InlineQueryResultsButton</h4>
|
|
<p>This object represents a button to be shown above inline query results. You <strong>must</strong> use exactly one of the optional fields.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>text</td>
|
|
<td>String</td>
|
|
<td>Label text on the button</td>
|
|
</tr>
|
|
<tr>
|
|
<td>web_app</td>
|
|
<td><a href="#webappinfo">WebAppInfo</a></td>
|
|
<td><em>Optional</em>. Description of the <a href="/bots/webapps">Web App</a> that will be launched when the user presses the button. The Web App will be able to switch back to the inline mode using the method <a href="/bots/webapps#initializing-web-apps">switchInlineQuery</a> inside the Web App.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>start_parameter</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. <a href="/bots/features#deep-linking">Deep-linking</a> parameter for the /start message sent to the bot when a user presses the button. 1-64 characters, only <code>A-Z</code>, <code>a-z</code>, <code>0-9</code>, <code>_</code> and <code>-</code> are allowed.<br><br><em>Example:</em> An inline bot that sends YouTube videos can ask the user to connect the bot to their YouTube account to adapt search results accordingly. To do this, it displays a 'Connect your YouTube account' button above the results, or even before showing any. The user presses the button, switches to a private chat with the bot and, in doing so, passes a start parameter that instructs the bot to return an OAuth link. Once done, the bot can offer a <a href="#inlinekeyboardmarkup"><em>switch_inline</em></a> button so that the user can easily return to the chat where they wanted to use the bot's inline capabilities.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="inlinequeryresult" href="#inlinequeryresult"><i class="anchor-icon"></i></a>InlineQueryResult</h4>
|
|
<p>This object represents one result of an inline query. Telegram clients currently support results of the following 20 types:</p>
|
|
<ul>
|
|
<li><a href="#inlinequeryresultcachedaudio">InlineQueryResultCachedAudio</a></li>
|
|
<li><a href="#inlinequeryresultcacheddocument">InlineQueryResultCachedDocument</a></li>
|
|
<li><a href="#inlinequeryresultcachedgif">InlineQueryResultCachedGif</a></li>
|
|
<li><a href="#inlinequeryresultcachedmpeg4gif">InlineQueryResultCachedMpeg4Gif</a></li>
|
|
<li><a href="#inlinequeryresultcachedphoto">InlineQueryResultCachedPhoto</a></li>
|
|
<li><a href="#inlinequeryresultcachedsticker">InlineQueryResultCachedSticker</a></li>
|
|
<li><a href="#inlinequeryresultcachedvideo">InlineQueryResultCachedVideo</a></li>
|
|
<li><a href="#inlinequeryresultcachedvoice">InlineQueryResultCachedVoice</a></li>
|
|
<li><a href="#inlinequeryresultarticle">InlineQueryResultArticle</a></li>
|
|
<li><a href="#inlinequeryresultaudio">InlineQueryResultAudio</a></li>
|
|
<li><a href="#inlinequeryresultcontact">InlineQueryResultContact</a></li>
|
|
<li><a href="#inlinequeryresultgame">InlineQueryResultGame</a></li>
|
|
<li><a href="#inlinequeryresultdocument">InlineQueryResultDocument</a></li>
|
|
<li><a href="#inlinequeryresultgif">InlineQueryResultGif</a></li>
|
|
<li><a href="#inlinequeryresultlocation">InlineQueryResultLocation</a></li>
|
|
<li><a href="#inlinequeryresultmpeg4gif">InlineQueryResultMpeg4Gif</a></li>
|
|
<li><a href="#inlinequeryresultphoto">InlineQueryResultPhoto</a></li>
|
|
<li><a href="#inlinequeryresultvenue">InlineQueryResultVenue</a></li>
|
|
<li><a href="#inlinequeryresultvideo">InlineQueryResultVideo</a></li>
|
|
<li><a href="#inlinequeryresultvoice">InlineQueryResultVoice</a></li>
|
|
</ul>
|
|
<p><strong>Note:</strong> All URLs passed in inline query results will be available to end users and therefore must be assumed to be <strong>public</strong>.</p>
|
|
<h4><a class="anchor" name="inlinequeryresultarticle" href="#inlinequeryresultarticle"><i class="anchor-icon"></i></a>InlineQueryResultArticle</h4>
|
|
<p>Represents a link to an article or web page.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>type</td>
|
|
<td>String</td>
|
|
<td>Type of the result, must be <em>article</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>id</td>
|
|
<td>String</td>
|
|
<td>Unique identifier for this result, 1-64 Bytes</td>
|
|
</tr>
|
|
<tr>
|
|
<td>title</td>
|
|
<td>String</td>
|
|
<td>Title of the result</td>
|
|
</tr>
|
|
<tr>
|
|
<td>input_message_content</td>
|
|
<td><a href="#inputmessagecontent">InputMessageContent</a></td>
|
|
<td>Content of the message to be sent</td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply_markup</td>
|
|
<td><a href="#inlinekeyboardmarkup">InlineKeyboardMarkup</a></td>
|
|
<td><em>Optional</em>. <a href="/bots/features#inline-keyboards">Inline keyboard</a> attached to the message</td>
|
|
</tr>
|
|
<tr>
|
|
<td>url</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. URL of the result</td>
|
|
</tr>
|
|
<tr>
|
|
<td>hide_url</td>
|
|
<td>Boolean</td>
|
|
<td><em>Optional</em>. Pass <em>True</em> if you don't want the URL to be shown in the message</td>
|
|
</tr>
|
|
<tr>
|
|
<td>description</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Short description of the result</td>
|
|
</tr>
|
|
<tr>
|
|
<td>thumbnail_url</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Url of the thumbnail for the result</td>
|
|
</tr>
|
|
<tr>
|
|
<td>thumbnail_width</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. Thumbnail width</td>
|
|
</tr>
|
|
<tr>
|
|
<td>thumbnail_height</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. Thumbnail height</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="inlinequeryresultphoto" href="#inlinequeryresultphoto"><i class="anchor-icon"></i></a>InlineQueryResultPhoto</h4>
|
|
<p>Represents a link to a photo. By default, this photo will be sent by the user with optional caption. Alternatively, you can use <em>input_message_content</em> to send a message with the specified content instead of the photo.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>type</td>
|
|
<td>String</td>
|
|
<td>Type of the result, must be <em>photo</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>id</td>
|
|
<td>String</td>
|
|
<td>Unique identifier for this result, 1-64 bytes</td>
|
|
</tr>
|
|
<tr>
|
|
<td>photo_url</td>
|
|
<td>String</td>
|
|
<td>A valid URL of the photo. Photo must be in <strong>JPEG</strong> format. Photo size must not exceed 5MB</td>
|
|
</tr>
|
|
<tr>
|
|
<td>thumbnail_url</td>
|
|
<td>String</td>
|
|
<td>URL of the thumbnail for the photo</td>
|
|
</tr>
|
|
<tr>
|
|
<td>photo_width</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. Width of the photo</td>
|
|
</tr>
|
|
<tr>
|
|
<td>photo_height</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. Height of the photo</td>
|
|
</tr>
|
|
<tr>
|
|
<td>title</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Title for the result</td>
|
|
</tr>
|
|
<tr>
|
|
<td>description</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Short description of the result</td>
|
|
</tr>
|
|
<tr>
|
|
<td>caption</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Caption of the photo to be sent, 0-1024 characters after entities parsing</td>
|
|
</tr>
|
|
<tr>
|
|
<td>parse_mode</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Mode for parsing entities in the photo caption. See <a href="#formatting-options">formatting options</a> for more details.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>caption_entities</td>
|
|
<td>Array of <a href="#messageentity">MessageEntity</a></td>
|
|
<td><em>Optional</em>. List of special entities that appear in the caption, which can be specified instead of <em>parse_mode</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply_markup</td>
|
|
<td><a href="#inlinekeyboardmarkup">InlineKeyboardMarkup</a></td>
|
|
<td><em>Optional</em>. <a href="/bots/features#inline-keyboards">Inline keyboard</a> attached to the message</td>
|
|
</tr>
|
|
<tr>
|
|
<td>input_message_content</td>
|
|
<td><a href="#inputmessagecontent">InputMessageContent</a></td>
|
|
<td><em>Optional</em>. Content of the message to be sent instead of the photo</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="inlinequeryresultgif" href="#inlinequeryresultgif"><i class="anchor-icon"></i></a>InlineQueryResultGif</h4>
|
|
<p>Represents a link to an animated GIF file. By default, this animated GIF file will be sent by the user with optional caption. Alternatively, you can use <em>input_message_content</em> to send a message with the specified content instead of the animation.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>type</td>
|
|
<td>String</td>
|
|
<td>Type of the result, must be <em>gif</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>id</td>
|
|
<td>String</td>
|
|
<td>Unique identifier for this result, 1-64 bytes</td>
|
|
</tr>
|
|
<tr>
|
|
<td>gif_url</td>
|
|
<td>String</td>
|
|
<td>A valid URL for the GIF file. File size must not exceed 1MB</td>
|
|
</tr>
|
|
<tr>
|
|
<td>gif_width</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. Width of the GIF</td>
|
|
</tr>
|
|
<tr>
|
|
<td>gif_height</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. Height of the GIF</td>
|
|
</tr>
|
|
<tr>
|
|
<td>gif_duration</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. Duration of the GIF in seconds</td>
|
|
</tr>
|
|
<tr>
|
|
<td>thumbnail_url</td>
|
|
<td>String</td>
|
|
<td>URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result</td>
|
|
</tr>
|
|
<tr>
|
|
<td>thumbnail_mime_type</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”, or “video/mp4”. Defaults to “image/jpeg”</td>
|
|
</tr>
|
|
<tr>
|
|
<td>title</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Title for the result</td>
|
|
</tr>
|
|
<tr>
|
|
<td>caption</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Caption of the GIF file to be sent, 0-1024 characters after entities parsing</td>
|
|
</tr>
|
|
<tr>
|
|
<td>parse_mode</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Mode for parsing entities in the caption. See <a href="#formatting-options">formatting options</a> for more details.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>caption_entities</td>
|
|
<td>Array of <a href="#messageentity">MessageEntity</a></td>
|
|
<td><em>Optional</em>. List of special entities that appear in the caption, which can be specified instead of <em>parse_mode</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply_markup</td>
|
|
<td><a href="#inlinekeyboardmarkup">InlineKeyboardMarkup</a></td>
|
|
<td><em>Optional</em>. <a href="/bots/features#inline-keyboards">Inline keyboard</a> attached to the message</td>
|
|
</tr>
|
|
<tr>
|
|
<td>input_message_content</td>
|
|
<td><a href="#inputmessagecontent">InputMessageContent</a></td>
|
|
<td><em>Optional</em>. Content of the message to be sent instead of the GIF animation</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="inlinequeryresultmpeg4gif" href="#inlinequeryresultmpeg4gif"><i class="anchor-icon"></i></a>InlineQueryResultMpeg4Gif</h4>
|
|
<p>Represents a link to a video animation (H.264/MPEG-4 AVC video without sound). By default, this animated MPEG-4 file will be sent by the user with optional caption. Alternatively, you can use <em>input_message_content</em> to send a message with the specified content instead of the animation.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>type</td>
|
|
<td>String</td>
|
|
<td>Type of the result, must be <em>mpeg4_gif</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>id</td>
|
|
<td>String</td>
|
|
<td>Unique identifier for this result, 1-64 bytes</td>
|
|
</tr>
|
|
<tr>
|
|
<td>mpeg4_url</td>
|
|
<td>String</td>
|
|
<td>A valid URL for the MPEG4 file. File size must not exceed 1MB</td>
|
|
</tr>
|
|
<tr>
|
|
<td>mpeg4_width</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. Video width</td>
|
|
</tr>
|
|
<tr>
|
|
<td>mpeg4_height</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. Video height</td>
|
|
</tr>
|
|
<tr>
|
|
<td>mpeg4_duration</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. Video duration in seconds</td>
|
|
</tr>
|
|
<tr>
|
|
<td>thumbnail_url</td>
|
|
<td>String</td>
|
|
<td>URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result</td>
|
|
</tr>
|
|
<tr>
|
|
<td>thumbnail_mime_type</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”, or “video/mp4”. Defaults to “image/jpeg”</td>
|
|
</tr>
|
|
<tr>
|
|
<td>title</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Title for the result</td>
|
|
</tr>
|
|
<tr>
|
|
<td>caption</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing</td>
|
|
</tr>
|
|
<tr>
|
|
<td>parse_mode</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Mode for parsing entities in the caption. See <a href="#formatting-options">formatting options</a> for more details.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>caption_entities</td>
|
|
<td>Array of <a href="#messageentity">MessageEntity</a></td>
|
|
<td><em>Optional</em>. List of special entities that appear in the caption, which can be specified instead of <em>parse_mode</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply_markup</td>
|
|
<td><a href="#inlinekeyboardmarkup">InlineKeyboardMarkup</a></td>
|
|
<td><em>Optional</em>. <a href="/bots/features#inline-keyboards">Inline keyboard</a> attached to the message</td>
|
|
</tr>
|
|
<tr>
|
|
<td>input_message_content</td>
|
|
<td><a href="#inputmessagecontent">InputMessageContent</a></td>
|
|
<td><em>Optional</em>. Content of the message to be sent instead of the video animation</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="inlinequeryresultvideo" href="#inlinequeryresultvideo"><i class="anchor-icon"></i></a>InlineQueryResultVideo</h4>
|
|
<p>Represents a link to a page containing an embedded video player or a video file. By default, this video file will be sent by the user with an optional caption. Alternatively, you can use <em>input_message_content</em> to send a message with the specified content instead of the video.</p>
|
|
<blockquote>
|
|
<p>If an InlineQueryResultVideo message contains an embedded video (e.g., YouTube), you <strong>must</strong> replace its content using <em>input_message_content</em>.</p>
|
|
</blockquote>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>type</td>
|
|
<td>String</td>
|
|
<td>Type of the result, must be <em>video</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>id</td>
|
|
<td>String</td>
|
|
<td>Unique identifier for this result, 1-64 bytes</td>
|
|
</tr>
|
|
<tr>
|
|
<td>video_url</td>
|
|
<td>String</td>
|
|
<td>A valid URL for the embedded video player or video file</td>
|
|
</tr>
|
|
<tr>
|
|
<td>mime_type</td>
|
|
<td>String</td>
|
|
<td>MIME type of the content of the video URL, “text/html” or “video/mp4”</td>
|
|
</tr>
|
|
<tr>
|
|
<td>thumbnail_url</td>
|
|
<td>String</td>
|
|
<td>URL of the thumbnail (JPEG only) for the video</td>
|
|
</tr>
|
|
<tr>
|
|
<td>title</td>
|
|
<td>String</td>
|
|
<td>Title for the result</td>
|
|
</tr>
|
|
<tr>
|
|
<td>caption</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Caption of the video to be sent, 0-1024 characters after entities parsing</td>
|
|
</tr>
|
|
<tr>
|
|
<td>parse_mode</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Mode for parsing entities in the video caption. See <a href="#formatting-options">formatting options</a> for more details.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>caption_entities</td>
|
|
<td>Array of <a href="#messageentity">MessageEntity</a></td>
|
|
<td><em>Optional</em>. List of special entities that appear in the caption, which can be specified instead of <em>parse_mode</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>video_width</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. Video width</td>
|
|
</tr>
|
|
<tr>
|
|
<td>video_height</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. Video height</td>
|
|
</tr>
|
|
<tr>
|
|
<td>video_duration</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. Video duration in seconds</td>
|
|
</tr>
|
|
<tr>
|
|
<td>description</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Short description of the result</td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply_markup</td>
|
|
<td><a href="#inlinekeyboardmarkup">InlineKeyboardMarkup</a></td>
|
|
<td><em>Optional</em>. <a href="/bots/features#inline-keyboards">Inline keyboard</a> attached to the message</td>
|
|
</tr>
|
|
<tr>
|
|
<td>input_message_content</td>
|
|
<td><a href="#inputmessagecontent">InputMessageContent</a></td>
|
|
<td><em>Optional</em>. Content of the message to be sent instead of the video. This field is <strong>required</strong> if InlineQueryResultVideo is used to send an HTML-page as a result (e.g., a YouTube video).</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="inlinequeryresultaudio" href="#inlinequeryresultaudio"><i class="anchor-icon"></i></a>InlineQueryResultAudio</h4>
|
|
<p>Represents a link to an MP3 audio file. By default, this audio file will be sent by the user. Alternatively, you can use <em>input_message_content</em> to send a message with the specified content instead of the audio.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>type</td>
|
|
<td>String</td>
|
|
<td>Type of the result, must be <em>audio</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>id</td>
|
|
<td>String</td>
|
|
<td>Unique identifier for this result, 1-64 bytes</td>
|
|
</tr>
|
|
<tr>
|
|
<td>audio_url</td>
|
|
<td>String</td>
|
|
<td>A valid URL for the audio file</td>
|
|
</tr>
|
|
<tr>
|
|
<td>title</td>
|
|
<td>String</td>
|
|
<td>Title</td>
|
|
</tr>
|
|
<tr>
|
|
<td>caption</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Caption, 0-1024 characters after entities parsing</td>
|
|
</tr>
|
|
<tr>
|
|
<td>parse_mode</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Mode for parsing entities in the audio caption. See <a href="#formatting-options">formatting options</a> for more details.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>caption_entities</td>
|
|
<td>Array of <a href="#messageentity">MessageEntity</a></td>
|
|
<td><em>Optional</em>. List of special entities that appear in the caption, which can be specified instead of <em>parse_mode</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>performer</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Performer</td>
|
|
</tr>
|
|
<tr>
|
|
<td>audio_duration</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. Audio duration in seconds</td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply_markup</td>
|
|
<td><a href="#inlinekeyboardmarkup">InlineKeyboardMarkup</a></td>
|
|
<td><em>Optional</em>. <a href="/bots/features#inline-keyboards">Inline keyboard</a> attached to the message</td>
|
|
</tr>
|
|
<tr>
|
|
<td>input_message_content</td>
|
|
<td><a href="#inputmessagecontent">InputMessageContent</a></td>
|
|
<td><em>Optional</em>. Content of the message to be sent instead of the audio</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p><strong>Note:</strong> This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.</p>
|
|
<h4><a class="anchor" name="inlinequeryresultvoice" href="#inlinequeryresultvoice"><i class="anchor-icon"></i></a>InlineQueryResultVoice</h4>
|
|
<p>Represents a link to a voice recording in an .OGG container encoded with OPUS. By default, this voice recording will be sent by the user. Alternatively, you can use <em>input_message_content</em> to send a message with the specified content instead of the the voice message.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>type</td>
|
|
<td>String</td>
|
|
<td>Type of the result, must be <em>voice</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>id</td>
|
|
<td>String</td>
|
|
<td>Unique identifier for this result, 1-64 bytes</td>
|
|
</tr>
|
|
<tr>
|
|
<td>voice_url</td>
|
|
<td>String</td>
|
|
<td>A valid URL for the voice recording</td>
|
|
</tr>
|
|
<tr>
|
|
<td>title</td>
|
|
<td>String</td>
|
|
<td>Recording title</td>
|
|
</tr>
|
|
<tr>
|
|
<td>caption</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Caption, 0-1024 characters after entities parsing</td>
|
|
</tr>
|
|
<tr>
|
|
<td>parse_mode</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Mode for parsing entities in the voice message caption. See <a href="#formatting-options">formatting options</a> for more details.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>caption_entities</td>
|
|
<td>Array of <a href="#messageentity">MessageEntity</a></td>
|
|
<td><em>Optional</em>. List of special entities that appear in the caption, which can be specified instead of <em>parse_mode</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>voice_duration</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. Recording duration in seconds</td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply_markup</td>
|
|
<td><a href="#inlinekeyboardmarkup">InlineKeyboardMarkup</a></td>
|
|
<td><em>Optional</em>. <a href="/bots/features#inline-keyboards">Inline keyboard</a> attached to the message</td>
|
|
</tr>
|
|
<tr>
|
|
<td>input_message_content</td>
|
|
<td><a href="#inputmessagecontent">InputMessageContent</a></td>
|
|
<td><em>Optional</em>. Content of the message to be sent instead of the voice recording</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p><strong>Note:</strong> This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.</p>
|
|
<h4><a class="anchor" name="inlinequeryresultdocument" href="#inlinequeryresultdocument"><i class="anchor-icon"></i></a>InlineQueryResultDocument</h4>
|
|
<p>Represents a link to a file. By default, this file will be sent by the user with an optional caption. Alternatively, you can use <em>input_message_content</em> to send a message with the specified content instead of the file. Currently, only <strong>.PDF</strong> and <strong>.ZIP</strong> files can be sent using this method.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>type</td>
|
|
<td>String</td>
|
|
<td>Type of the result, must be <em>document</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>id</td>
|
|
<td>String</td>
|
|
<td>Unique identifier for this result, 1-64 bytes</td>
|
|
</tr>
|
|
<tr>
|
|
<td>title</td>
|
|
<td>String</td>
|
|
<td>Title for the result</td>
|
|
</tr>
|
|
<tr>
|
|
<td>caption</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Caption of the document to be sent, 0-1024 characters after entities parsing</td>
|
|
</tr>
|
|
<tr>
|
|
<td>parse_mode</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Mode for parsing entities in the document caption. See <a href="#formatting-options">formatting options</a> for more details.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>caption_entities</td>
|
|
<td>Array of <a href="#messageentity">MessageEntity</a></td>
|
|
<td><em>Optional</em>. List of special entities that appear in the caption, which can be specified instead of <em>parse_mode</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>document_url</td>
|
|
<td>String</td>
|
|
<td>A valid URL for the file</td>
|
|
</tr>
|
|
<tr>
|
|
<td>mime_type</td>
|
|
<td>String</td>
|
|
<td>MIME type of the content of the file, either “application/pdf” or “application/zip”</td>
|
|
</tr>
|
|
<tr>
|
|
<td>description</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Short description of the result</td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply_markup</td>
|
|
<td><a href="#inlinekeyboardmarkup">InlineKeyboardMarkup</a></td>
|
|
<td><em>Optional</em>. Inline keyboard attached to the message</td>
|
|
</tr>
|
|
<tr>
|
|
<td>input_message_content</td>
|
|
<td><a href="#inputmessagecontent">InputMessageContent</a></td>
|
|
<td><em>Optional</em>. Content of the message to be sent instead of the file</td>
|
|
</tr>
|
|
<tr>
|
|
<td>thumbnail_url</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. URL of the thumbnail (JPEG only) for the file</td>
|
|
</tr>
|
|
<tr>
|
|
<td>thumbnail_width</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. Thumbnail width</td>
|
|
</tr>
|
|
<tr>
|
|
<td>thumbnail_height</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. Thumbnail height</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p><strong>Note:</strong> This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.</p>
|
|
<h4><a class="anchor" name="inlinequeryresultlocation" href="#inlinequeryresultlocation"><i class="anchor-icon"></i></a>InlineQueryResultLocation</h4>
|
|
<p>Represents a location on a map. By default, the location will be sent by the user. Alternatively, you can use <em>input_message_content</em> to send a message with the specified content instead of the location.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>type</td>
|
|
<td>String</td>
|
|
<td>Type of the result, must be <em>location</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>id</td>
|
|
<td>String</td>
|
|
<td>Unique identifier for this result, 1-64 Bytes</td>
|
|
</tr>
|
|
<tr>
|
|
<td>latitude</td>
|
|
<td>Float number</td>
|
|
<td>Location latitude in degrees</td>
|
|
</tr>
|
|
<tr>
|
|
<td>longitude</td>
|
|
<td>Float number</td>
|
|
<td>Location longitude in degrees</td>
|
|
</tr>
|
|
<tr>
|
|
<td>title</td>
|
|
<td>String</td>
|
|
<td>Location title</td>
|
|
</tr>
|
|
<tr>
|
|
<td>horizontal_accuracy</td>
|
|
<td>Float number</td>
|
|
<td><em>Optional</em>. The radius of uncertainty for the location, measured in meters; 0-1500</td>
|
|
</tr>
|
|
<tr>
|
|
<td>live_period</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. Period in seconds for which the location can be updated, should be between 60 and 86400.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>heading</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>proximity_alert_radius</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply_markup</td>
|
|
<td><a href="#inlinekeyboardmarkup">InlineKeyboardMarkup</a></td>
|
|
<td><em>Optional</em>. <a href="/bots/features#inline-keyboards">Inline keyboard</a> attached to the message</td>
|
|
</tr>
|
|
<tr>
|
|
<td>input_message_content</td>
|
|
<td><a href="#inputmessagecontent">InputMessageContent</a></td>
|
|
<td><em>Optional</em>. Content of the message to be sent instead of the location</td>
|
|
</tr>
|
|
<tr>
|
|
<td>thumbnail_url</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Url of the thumbnail for the result</td>
|
|
</tr>
|
|
<tr>
|
|
<td>thumbnail_width</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. Thumbnail width</td>
|
|
</tr>
|
|
<tr>
|
|
<td>thumbnail_height</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. Thumbnail height</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p><strong>Note:</strong> This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.</p>
|
|
<h4><a class="anchor" name="inlinequeryresultvenue" href="#inlinequeryresultvenue"><i class="anchor-icon"></i></a>InlineQueryResultVenue</h4>
|
|
<p>Represents a venue. By default, the venue will be sent by the user. Alternatively, you can use <em>input_message_content</em> to send a message with the specified content instead of the venue.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>type</td>
|
|
<td>String</td>
|
|
<td>Type of the result, must be <em>venue</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>id</td>
|
|
<td>String</td>
|
|
<td>Unique identifier for this result, 1-64 Bytes</td>
|
|
</tr>
|
|
<tr>
|
|
<td>latitude</td>
|
|
<td>Float</td>
|
|
<td>Latitude of the venue location in degrees</td>
|
|
</tr>
|
|
<tr>
|
|
<td>longitude</td>
|
|
<td>Float</td>
|
|
<td>Longitude of the venue location in degrees</td>
|
|
</tr>
|
|
<tr>
|
|
<td>title</td>
|
|
<td>String</td>
|
|
<td>Title of the venue</td>
|
|
</tr>
|
|
<tr>
|
|
<td>address</td>
|
|
<td>String</td>
|
|
<td>Address of the venue</td>
|
|
</tr>
|
|
<tr>
|
|
<td>foursquare_id</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Foursquare identifier of the venue if known</td>
|
|
</tr>
|
|
<tr>
|
|
<td>foursquare_type</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>google_place_id</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Google Places identifier of the venue</td>
|
|
</tr>
|
|
<tr>
|
|
<td>google_place_type</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Google Places type of the venue. (See <a href="https://developers.google.com/places/web-service/supported_types">supported types</a>.)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply_markup</td>
|
|
<td><a href="#inlinekeyboardmarkup">InlineKeyboardMarkup</a></td>
|
|
<td><em>Optional</em>. <a href="/bots/features#inline-keyboards">Inline keyboard</a> attached to the message</td>
|
|
</tr>
|
|
<tr>
|
|
<td>input_message_content</td>
|
|
<td><a href="#inputmessagecontent">InputMessageContent</a></td>
|
|
<td><em>Optional</em>. Content of the message to be sent instead of the venue</td>
|
|
</tr>
|
|
<tr>
|
|
<td>thumbnail_url</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Url of the thumbnail for the result</td>
|
|
</tr>
|
|
<tr>
|
|
<td>thumbnail_width</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. Thumbnail width</td>
|
|
</tr>
|
|
<tr>
|
|
<td>thumbnail_height</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. Thumbnail height</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p><strong>Note:</strong> This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.</p>
|
|
<h4><a class="anchor" name="inlinequeryresultcontact" href="#inlinequeryresultcontact"><i class="anchor-icon"></i></a>InlineQueryResultContact</h4>
|
|
<p>Represents a contact with a phone number. By default, this contact will be sent by the user. Alternatively, you can use <em>input_message_content</em> to send a message with the specified content instead of the contact.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>type</td>
|
|
<td>String</td>
|
|
<td>Type of the result, must be <em>contact</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>id</td>
|
|
<td>String</td>
|
|
<td>Unique identifier for this result, 1-64 Bytes</td>
|
|
</tr>
|
|
<tr>
|
|
<td>phone_number</td>
|
|
<td>String</td>
|
|
<td>Contact's phone number</td>
|
|
</tr>
|
|
<tr>
|
|
<td>first_name</td>
|
|
<td>String</td>
|
|
<td>Contact's first name</td>
|
|
</tr>
|
|
<tr>
|
|
<td>last_name</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Contact's last name</td>
|
|
</tr>
|
|
<tr>
|
|
<td>vcard</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Additional data about the contact in the form of a <a href="https://en.wikipedia.org/wiki/VCard">vCard</a>, 0-2048 bytes</td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply_markup</td>
|
|
<td><a href="#inlinekeyboardmarkup">InlineKeyboardMarkup</a></td>
|
|
<td><em>Optional</em>. <a href="/bots/features#inline-keyboards">Inline keyboard</a> attached to the message</td>
|
|
</tr>
|
|
<tr>
|
|
<td>input_message_content</td>
|
|
<td><a href="#inputmessagecontent">InputMessageContent</a></td>
|
|
<td><em>Optional</em>. Content of the message to be sent instead of the contact</td>
|
|
</tr>
|
|
<tr>
|
|
<td>thumbnail_url</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Url of the thumbnail for the result</td>
|
|
</tr>
|
|
<tr>
|
|
<td>thumbnail_width</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. Thumbnail width</td>
|
|
</tr>
|
|
<tr>
|
|
<td>thumbnail_height</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. Thumbnail height</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p><strong>Note:</strong> This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.</p>
|
|
<h4><a class="anchor" name="inlinequeryresultgame" href="#inlinequeryresultgame"><i class="anchor-icon"></i></a>InlineQueryResultGame</h4>
|
|
<p>Represents a <a href="#games">Game</a>.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>type</td>
|
|
<td>String</td>
|
|
<td>Type of the result, must be <em>game</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>id</td>
|
|
<td>String</td>
|
|
<td>Unique identifier for this result, 1-64 bytes</td>
|
|
</tr>
|
|
<tr>
|
|
<td>game_short_name</td>
|
|
<td>String</td>
|
|
<td>Short name of the game</td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply_markup</td>
|
|
<td><a href="#inlinekeyboardmarkup">InlineKeyboardMarkup</a></td>
|
|
<td><em>Optional</em>. <a href="/bots/features#inline-keyboards">Inline keyboard</a> attached to the message</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p><strong>Note:</strong> This will only work in Telegram versions released after October 1, 2016. Older clients will not display any inline results if a game result is among them.</p>
|
|
<h4><a class="anchor" name="inlinequeryresultcachedphoto" href="#inlinequeryresultcachedphoto"><i class="anchor-icon"></i></a>InlineQueryResultCachedPhoto</h4>
|
|
<p>Represents a link to a photo stored on the Telegram servers. By default, this photo will be sent by the user with an optional caption. Alternatively, you can use <em>input_message_content</em> to send a message with the specified content instead of the photo.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>type</td>
|
|
<td>String</td>
|
|
<td>Type of the result, must be <em>photo</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>id</td>
|
|
<td>String</td>
|
|
<td>Unique identifier for this result, 1-64 bytes</td>
|
|
</tr>
|
|
<tr>
|
|
<td>photo_file_id</td>
|
|
<td>String</td>
|
|
<td>A valid file identifier of the photo</td>
|
|
</tr>
|
|
<tr>
|
|
<td>title</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Title for the result</td>
|
|
</tr>
|
|
<tr>
|
|
<td>description</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Short description of the result</td>
|
|
</tr>
|
|
<tr>
|
|
<td>caption</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Caption of the photo to be sent, 0-1024 characters after entities parsing</td>
|
|
</tr>
|
|
<tr>
|
|
<td>parse_mode</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Mode for parsing entities in the photo caption. See <a href="#formatting-options">formatting options</a> for more details.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>caption_entities</td>
|
|
<td>Array of <a href="#messageentity">MessageEntity</a></td>
|
|
<td><em>Optional</em>. List of special entities that appear in the caption, which can be specified instead of <em>parse_mode</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply_markup</td>
|
|
<td><a href="#inlinekeyboardmarkup">InlineKeyboardMarkup</a></td>
|
|
<td><em>Optional</em>. <a href="/bots/features#inline-keyboards">Inline keyboard</a> attached to the message</td>
|
|
</tr>
|
|
<tr>
|
|
<td>input_message_content</td>
|
|
<td><a href="#inputmessagecontent">InputMessageContent</a></td>
|
|
<td><em>Optional</em>. Content of the message to be sent instead of the photo</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="inlinequeryresultcachedgif" href="#inlinequeryresultcachedgif"><i class="anchor-icon"></i></a>InlineQueryResultCachedGif</h4>
|
|
<p>Represents a link to an animated GIF file stored on the Telegram servers. By default, this animated GIF file will be sent by the user with an optional caption. Alternatively, you can use <em>input_message_content</em> to send a message with specified content instead of the animation.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>type</td>
|
|
<td>String</td>
|
|
<td>Type of the result, must be <em>gif</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>id</td>
|
|
<td>String</td>
|
|
<td>Unique identifier for this result, 1-64 bytes</td>
|
|
</tr>
|
|
<tr>
|
|
<td>gif_file_id</td>
|
|
<td>String</td>
|
|
<td>A valid file identifier for the GIF file</td>
|
|
</tr>
|
|
<tr>
|
|
<td>title</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Title for the result</td>
|
|
</tr>
|
|
<tr>
|
|
<td>caption</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Caption of the GIF file to be sent, 0-1024 characters after entities parsing</td>
|
|
</tr>
|
|
<tr>
|
|
<td>parse_mode</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Mode for parsing entities in the caption. See <a href="#formatting-options">formatting options</a> for more details.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>caption_entities</td>
|
|
<td>Array of <a href="#messageentity">MessageEntity</a></td>
|
|
<td><em>Optional</em>. List of special entities that appear in the caption, which can be specified instead of <em>parse_mode</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply_markup</td>
|
|
<td><a href="#inlinekeyboardmarkup">InlineKeyboardMarkup</a></td>
|
|
<td><em>Optional</em>. <a href="/bots/features#inline-keyboards">Inline keyboard</a> attached to the message</td>
|
|
</tr>
|
|
<tr>
|
|
<td>input_message_content</td>
|
|
<td><a href="#inputmessagecontent">InputMessageContent</a></td>
|
|
<td><em>Optional</em>. Content of the message to be sent instead of the GIF animation</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="inlinequeryresultcachedmpeg4gif" href="#inlinequeryresultcachedmpeg4gif"><i class="anchor-icon"></i></a>InlineQueryResultCachedMpeg4Gif</h4>
|
|
<p>Represents a link to a video animation (H.264/MPEG-4 AVC video without sound) stored on the Telegram servers. By default, this animated MPEG-4 file will be sent by the user with an optional caption. Alternatively, you can use <em>input_message_content</em> to send a message with the specified content instead of the animation.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>type</td>
|
|
<td>String</td>
|
|
<td>Type of the result, must be <em>mpeg4_gif</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>id</td>
|
|
<td>String</td>
|
|
<td>Unique identifier for this result, 1-64 bytes</td>
|
|
</tr>
|
|
<tr>
|
|
<td>mpeg4_file_id</td>
|
|
<td>String</td>
|
|
<td>A valid file identifier for the MPEG4 file</td>
|
|
</tr>
|
|
<tr>
|
|
<td>title</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Title for the result</td>
|
|
</tr>
|
|
<tr>
|
|
<td>caption</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing</td>
|
|
</tr>
|
|
<tr>
|
|
<td>parse_mode</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Mode for parsing entities in the caption. See <a href="#formatting-options">formatting options</a> for more details.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>caption_entities</td>
|
|
<td>Array of <a href="#messageentity">MessageEntity</a></td>
|
|
<td><em>Optional</em>. List of special entities that appear in the caption, which can be specified instead of <em>parse_mode</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply_markup</td>
|
|
<td><a href="#inlinekeyboardmarkup">InlineKeyboardMarkup</a></td>
|
|
<td><em>Optional</em>. <a href="/bots/features#inline-keyboards">Inline keyboard</a> attached to the message</td>
|
|
</tr>
|
|
<tr>
|
|
<td>input_message_content</td>
|
|
<td><a href="#inputmessagecontent">InputMessageContent</a></td>
|
|
<td><em>Optional</em>. Content of the message to be sent instead of the video animation</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="inlinequeryresultcachedsticker" href="#inlinequeryresultcachedsticker"><i class="anchor-icon"></i></a>InlineQueryResultCachedSticker</h4>
|
|
<p>Represents a link to a sticker stored on the Telegram servers. By default, this sticker will be sent by the user. Alternatively, you can use <em>input_message_content</em> to send a message with the specified content instead of the sticker.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>type</td>
|
|
<td>String</td>
|
|
<td>Type of the result, must be <em>sticker</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>id</td>
|
|
<td>String</td>
|
|
<td>Unique identifier for this result, 1-64 bytes</td>
|
|
</tr>
|
|
<tr>
|
|
<td>sticker_file_id</td>
|
|
<td>String</td>
|
|
<td>A valid file identifier of the sticker</td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply_markup</td>
|
|
<td><a href="#inlinekeyboardmarkup">InlineKeyboardMarkup</a></td>
|
|
<td><em>Optional</em>. <a href="/bots/features#inline-keyboards">Inline keyboard</a> attached to the message</td>
|
|
</tr>
|
|
<tr>
|
|
<td>input_message_content</td>
|
|
<td><a href="#inputmessagecontent">InputMessageContent</a></td>
|
|
<td><em>Optional</em>. Content of the message to be sent instead of the sticker</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p><strong>Note:</strong> This will only work in Telegram versions released after 9 April, 2016 for static stickers and after 06 July, 2019 for <a href="https://telegram.org/blog/animated-stickers">animated stickers</a>. Older clients will ignore them.</p>
|
|
<h4><a class="anchor" name="inlinequeryresultcacheddocument" href="#inlinequeryresultcacheddocument"><i class="anchor-icon"></i></a>InlineQueryResultCachedDocument</h4>
|
|
<p>Represents a link to a file stored on the Telegram servers. By default, this file will be sent by the user with an optional caption. Alternatively, you can use <em>input_message_content</em> to send a message with the specified content instead of the file.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>type</td>
|
|
<td>String</td>
|
|
<td>Type of the result, must be <em>document</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>id</td>
|
|
<td>String</td>
|
|
<td>Unique identifier for this result, 1-64 bytes</td>
|
|
</tr>
|
|
<tr>
|
|
<td>title</td>
|
|
<td>String</td>
|
|
<td>Title for the result</td>
|
|
</tr>
|
|
<tr>
|
|
<td>document_file_id</td>
|
|
<td>String</td>
|
|
<td>A valid file identifier for the file</td>
|
|
</tr>
|
|
<tr>
|
|
<td>description</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Short description of the result</td>
|
|
</tr>
|
|
<tr>
|
|
<td>caption</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Caption of the document to be sent, 0-1024 characters after entities parsing</td>
|
|
</tr>
|
|
<tr>
|
|
<td>parse_mode</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Mode for parsing entities in the document caption. See <a href="#formatting-options">formatting options</a> for more details.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>caption_entities</td>
|
|
<td>Array of <a href="#messageentity">MessageEntity</a></td>
|
|
<td><em>Optional</em>. List of special entities that appear in the caption, which can be specified instead of <em>parse_mode</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply_markup</td>
|
|
<td><a href="#inlinekeyboardmarkup">InlineKeyboardMarkup</a></td>
|
|
<td><em>Optional</em>. <a href="/bots/features#inline-keyboards">Inline keyboard</a> attached to the message</td>
|
|
</tr>
|
|
<tr>
|
|
<td>input_message_content</td>
|
|
<td><a href="#inputmessagecontent">InputMessageContent</a></td>
|
|
<td><em>Optional</em>. Content of the message to be sent instead of the file</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p><strong>Note:</strong> This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.</p>
|
|
<h4><a class="anchor" name="inlinequeryresultcachedvideo" href="#inlinequeryresultcachedvideo"><i class="anchor-icon"></i></a>InlineQueryResultCachedVideo</h4>
|
|
<p>Represents a link to a video file stored on the Telegram servers. By default, this video file will be sent by the user with an optional caption. Alternatively, you can use <em>input_message_content</em> to send a message with the specified content instead of the video.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>type</td>
|
|
<td>String</td>
|
|
<td>Type of the result, must be <em>video</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>id</td>
|
|
<td>String</td>
|
|
<td>Unique identifier for this result, 1-64 bytes</td>
|
|
</tr>
|
|
<tr>
|
|
<td>video_file_id</td>
|
|
<td>String</td>
|
|
<td>A valid file identifier for the video file</td>
|
|
</tr>
|
|
<tr>
|
|
<td>title</td>
|
|
<td>String</td>
|
|
<td>Title for the result</td>
|
|
</tr>
|
|
<tr>
|
|
<td>description</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Short description of the result</td>
|
|
</tr>
|
|
<tr>
|
|
<td>caption</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Caption of the video to be sent, 0-1024 characters after entities parsing</td>
|
|
</tr>
|
|
<tr>
|
|
<td>parse_mode</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Mode for parsing entities in the video caption. See <a href="#formatting-options">formatting options</a> for more details.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>caption_entities</td>
|
|
<td>Array of <a href="#messageentity">MessageEntity</a></td>
|
|
<td><em>Optional</em>. List of special entities that appear in the caption, which can be specified instead of <em>parse_mode</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply_markup</td>
|
|
<td><a href="#inlinekeyboardmarkup">InlineKeyboardMarkup</a></td>
|
|
<td><em>Optional</em>. <a href="/bots/features#inline-keyboards">Inline keyboard</a> attached to the message</td>
|
|
</tr>
|
|
<tr>
|
|
<td>input_message_content</td>
|
|
<td><a href="#inputmessagecontent">InputMessageContent</a></td>
|
|
<td><em>Optional</em>. Content of the message to be sent instead of the video</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="inlinequeryresultcachedvoice" href="#inlinequeryresultcachedvoice"><i class="anchor-icon"></i></a>InlineQueryResultCachedVoice</h4>
|
|
<p>Represents a link to a voice message stored on the Telegram servers. By default, this voice message will be sent by the user. Alternatively, you can use <em>input_message_content</em> to send a message with the specified content instead of the voice message.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>type</td>
|
|
<td>String</td>
|
|
<td>Type of the result, must be <em>voice</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>id</td>
|
|
<td>String</td>
|
|
<td>Unique identifier for this result, 1-64 bytes</td>
|
|
</tr>
|
|
<tr>
|
|
<td>voice_file_id</td>
|
|
<td>String</td>
|
|
<td>A valid file identifier for the voice message</td>
|
|
</tr>
|
|
<tr>
|
|
<td>title</td>
|
|
<td>String</td>
|
|
<td>Voice message title</td>
|
|
</tr>
|
|
<tr>
|
|
<td>caption</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Caption, 0-1024 characters after entities parsing</td>
|
|
</tr>
|
|
<tr>
|
|
<td>parse_mode</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Mode for parsing entities in the voice message caption. See <a href="#formatting-options">formatting options</a> for more details.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>caption_entities</td>
|
|
<td>Array of <a href="#messageentity">MessageEntity</a></td>
|
|
<td><em>Optional</em>. List of special entities that appear in the caption, which can be specified instead of <em>parse_mode</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply_markup</td>
|
|
<td><a href="#inlinekeyboardmarkup">InlineKeyboardMarkup</a></td>
|
|
<td><em>Optional</em>. <a href="/bots/features#inline-keyboards">Inline keyboard</a> attached to the message</td>
|
|
</tr>
|
|
<tr>
|
|
<td>input_message_content</td>
|
|
<td><a href="#inputmessagecontent">InputMessageContent</a></td>
|
|
<td><em>Optional</em>. Content of the message to be sent instead of the voice message</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p><strong>Note:</strong> This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.</p>
|
|
<h4><a class="anchor" name="inlinequeryresultcachedaudio" href="#inlinequeryresultcachedaudio"><i class="anchor-icon"></i></a>InlineQueryResultCachedAudio</h4>
|
|
<p>Represents a link to an MP3 audio file stored on the Telegram servers. By default, this audio file will be sent by the user. Alternatively, you can use <em>input_message_content</em> to send a message with the specified content instead of the audio.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>type</td>
|
|
<td>String</td>
|
|
<td>Type of the result, must be <em>audio</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>id</td>
|
|
<td>String</td>
|
|
<td>Unique identifier for this result, 1-64 bytes</td>
|
|
</tr>
|
|
<tr>
|
|
<td>audio_file_id</td>
|
|
<td>String</td>
|
|
<td>A valid file identifier for the audio file</td>
|
|
</tr>
|
|
<tr>
|
|
<td>caption</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Caption, 0-1024 characters after entities parsing</td>
|
|
</tr>
|
|
<tr>
|
|
<td>parse_mode</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Mode for parsing entities in the audio caption. See <a href="#formatting-options">formatting options</a> for more details.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>caption_entities</td>
|
|
<td>Array of <a href="#messageentity">MessageEntity</a></td>
|
|
<td><em>Optional</em>. List of special entities that appear in the caption, which can be specified instead of <em>parse_mode</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply_markup</td>
|
|
<td><a href="#inlinekeyboardmarkup">InlineKeyboardMarkup</a></td>
|
|
<td><em>Optional</em>. <a href="/bots/features#inline-keyboards">Inline keyboard</a> attached to the message</td>
|
|
</tr>
|
|
<tr>
|
|
<td>input_message_content</td>
|
|
<td><a href="#inputmessagecontent">InputMessageContent</a></td>
|
|
<td><em>Optional</em>. Content of the message to be sent instead of the audio</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p><strong>Note:</strong> This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.</p>
|
|
<h4><a class="anchor" name="inputmessagecontent" href="#inputmessagecontent"><i class="anchor-icon"></i></a>InputMessageContent</h4>
|
|
<p>This object represents the content of a message to be sent as a result of an inline query. Telegram clients currently support the following 5 types:</p>
|
|
<ul>
|
|
<li><a href="#inputtextmessagecontent">InputTextMessageContent</a></li>
|
|
<li><a href="#inputlocationmessagecontent">InputLocationMessageContent</a></li>
|
|
<li><a href="#inputvenuemessagecontent">InputVenueMessageContent</a></li>
|
|
<li><a href="#inputcontactmessagecontent">InputContactMessageContent</a></li>
|
|
<li><a href="#inputinvoicemessagecontent">InputInvoiceMessageContent</a></li>
|
|
</ul>
|
|
<h4><a class="anchor" name="inputtextmessagecontent" href="#inputtextmessagecontent"><i class="anchor-icon"></i></a>InputTextMessageContent</h4>
|
|
<p>Represents the <a href="#inputmessagecontent">content</a> of a text message to be sent as the result of an inline query.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>message_text</td>
|
|
<td>String</td>
|
|
<td>Text of the message to be sent, 1-4096 characters</td>
|
|
</tr>
|
|
<tr>
|
|
<td>parse_mode</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Mode for parsing entities in the message text. See <a href="#formatting-options">formatting options</a> for more details.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>entities</td>
|
|
<td>Array of <a href="#messageentity">MessageEntity</a></td>
|
|
<td><em>Optional</em>. List of special entities that appear in message text, which can be specified instead of <em>parse_mode</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>disable_web_page_preview</td>
|
|
<td>Boolean</td>
|
|
<td><em>Optional</em>. Disables link previews for links in the sent message</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="inputlocationmessagecontent" href="#inputlocationmessagecontent"><i class="anchor-icon"></i></a>InputLocationMessageContent</h4>
|
|
<p>Represents the <a href="#inputmessagecontent">content</a> of a location message to be sent as the result of an inline query.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>latitude</td>
|
|
<td>Float</td>
|
|
<td>Latitude of the location in degrees</td>
|
|
</tr>
|
|
<tr>
|
|
<td>longitude</td>
|
|
<td>Float</td>
|
|
<td>Longitude of the location in degrees</td>
|
|
</tr>
|
|
<tr>
|
|
<td>horizontal_accuracy</td>
|
|
<td>Float number</td>
|
|
<td><em>Optional</em>. The radius of uncertainty for the location, measured in meters; 0-1500</td>
|
|
</tr>
|
|
<tr>
|
|
<td>live_period</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. Period in seconds for which the location can be updated, should be between 60 and 86400.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>heading</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>proximity_alert_radius</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="inputvenuemessagecontent" href="#inputvenuemessagecontent"><i class="anchor-icon"></i></a>InputVenueMessageContent</h4>
|
|
<p>Represents the <a href="#inputmessagecontent">content</a> of a venue message to be sent as the result of an inline query.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>latitude</td>
|
|
<td>Float</td>
|
|
<td>Latitude of the venue in degrees</td>
|
|
</tr>
|
|
<tr>
|
|
<td>longitude</td>
|
|
<td>Float</td>
|
|
<td>Longitude of the venue in degrees</td>
|
|
</tr>
|
|
<tr>
|
|
<td>title</td>
|
|
<td>String</td>
|
|
<td>Name of the venue</td>
|
|
</tr>
|
|
<tr>
|
|
<td>address</td>
|
|
<td>String</td>
|
|
<td>Address of the venue</td>
|
|
</tr>
|
|
<tr>
|
|
<td>foursquare_id</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Foursquare identifier of the venue, if known</td>
|
|
</tr>
|
|
<tr>
|
|
<td>foursquare_type</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>google_place_id</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Google Places identifier of the venue</td>
|
|
</tr>
|
|
<tr>
|
|
<td>google_place_type</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Google Places type of the venue. (See <a href="https://developers.google.com/places/web-service/supported_types">supported types</a>.)</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="inputcontactmessagecontent" href="#inputcontactmessagecontent"><i class="anchor-icon"></i></a>InputContactMessageContent</h4>
|
|
<p>Represents the <a href="#inputmessagecontent">content</a> of a contact message to be sent as the result of an inline query.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>phone_number</td>
|
|
<td>String</td>
|
|
<td>Contact's phone number</td>
|
|
</tr>
|
|
<tr>
|
|
<td>first_name</td>
|
|
<td>String</td>
|
|
<td>Contact's first name</td>
|
|
</tr>
|
|
<tr>
|
|
<td>last_name</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Contact's last name</td>
|
|
</tr>
|
|
<tr>
|
|
<td>vcard</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Additional data about the contact in the form of a <a href="https://en.wikipedia.org/wiki/VCard">vCard</a>, 0-2048 bytes</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="inputinvoicemessagecontent" href="#inputinvoicemessagecontent"><i class="anchor-icon"></i></a>InputInvoiceMessageContent</h4>
|
|
<p>Represents the <a href="#inputmessagecontent">content</a> of an invoice message to be sent as the result of an inline query.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>title</td>
|
|
<td>String</td>
|
|
<td>Product name, 1-32 characters</td>
|
|
</tr>
|
|
<tr>
|
|
<td>description</td>
|
|
<td>String</td>
|
|
<td>Product description, 1-255 characters</td>
|
|
</tr>
|
|
<tr>
|
|
<td>payload</td>
|
|
<td>String</td>
|
|
<td>Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>provider_token</td>
|
|
<td>String</td>
|
|
<td>Payment provider token, obtained via <a href="https://t.me/botfather">@BotFather</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td>currency</td>
|
|
<td>String</td>
|
|
<td>Three-letter ISO 4217 currency code, see <a href="/bots/payments#supported-currencies">more on currencies</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td>prices</td>
|
|
<td>Array of <a href="#labeledprice">LabeledPrice</a></td>
|
|
<td>Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>max_tip_amount</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. The maximum accepted amount for tips in the <em>smallest units</em> of the currency (integer, <strong>not</strong> float/double). For example, for a maximum tip of <code>US$ 1.45</code> pass <code>max_tip_amount = 145</code>. See the <em>exp</em> parameter in <a href="/bots/payments/currencies.json">currencies.json</a>, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0</td>
|
|
</tr>
|
|
<tr>
|
|
<td>suggested_tip_amounts</td>
|
|
<td>Array of Integer</td>
|
|
<td><em>Optional</em>. A JSON-serialized array of suggested amounts of tip in the <em>smallest units</em> of the currency (integer, <strong>not</strong> float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed <em>max_tip_amount</em>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>provider_data</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. A JSON-serialized object for data about the invoice, which will be shared with the payment provider. A detailed description of the required fields should be provided by the payment provider.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>photo_url</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>photo_size</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. Photo size in bytes</td>
|
|
</tr>
|
|
<tr>
|
|
<td>photo_width</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. Photo width</td>
|
|
</tr>
|
|
<tr>
|
|
<td>photo_height</td>
|
|
<td>Integer</td>
|
|
<td><em>Optional</em>. Photo height</td>
|
|
</tr>
|
|
<tr>
|
|
<td>need_name</td>
|
|
<td>Boolean</td>
|
|
<td><em>Optional</em>. Pass <em>True</em> if you require the user's full name to complete the order</td>
|
|
</tr>
|
|
<tr>
|
|
<td>need_phone_number</td>
|
|
<td>Boolean</td>
|
|
<td><em>Optional</em>. Pass <em>True</em> if you require the user's phone number to complete the order</td>
|
|
</tr>
|
|
<tr>
|
|
<td>need_email</td>
|
|
<td>Boolean</td>
|
|
<td><em>Optional</em>. Pass <em>True</em> if you require the user's email address to complete the order</td>
|
|
</tr>
|
|
<tr>
|
|
<td>need_shipping_address</td>
|
|
<td>Boolean</td>
|
|
<td><em>Optional</em>. Pass <em>True</em> if you require the user's shipping address to complete the order</td>
|
|
</tr>
|
|
<tr>
|
|
<td>send_phone_number_to_provider</td>
|
|
<td>Boolean</td>
|
|
<td><em>Optional</em>. Pass <em>True</em> if the user's phone number should be sent to provider</td>
|
|
</tr>
|
|
<tr>
|
|
<td>send_email_to_provider</td>
|
|
<td>Boolean</td>
|
|
<td><em>Optional</em>. Pass <em>True</em> if the user's email address should be sent to provider</td>
|
|
</tr>
|
|
<tr>
|
|
<td>is_flexible</td>
|
|
<td>Boolean</td>
|
|
<td><em>Optional</em>. Pass <em>True</em> if the final price depends on the shipping method</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="choseninlineresult" href="#choseninlineresult"><i class="anchor-icon"></i></a>ChosenInlineResult</h4>
|
|
<p>Represents a <a href="#inlinequeryresult">result</a> of an inline query that was chosen by the user and sent to their chat partner.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>result_id</td>
|
|
<td>String</td>
|
|
<td>The unique identifier for the result that was chosen</td>
|
|
</tr>
|
|
<tr>
|
|
<td>from</td>
|
|
<td><a href="#user">User</a></td>
|
|
<td>The user that chose the result</td>
|
|
</tr>
|
|
<tr>
|
|
<td>location</td>
|
|
<td><a href="#location">Location</a></td>
|
|
<td><em>Optional</em>. Sender location, only for bots that require user location</td>
|
|
</tr>
|
|
<tr>
|
|
<td>inline_message_id</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Identifier of the sent inline message. Available only if there is an <a href="#inlinekeyboardmarkup">inline keyboard</a> attached to the message. Will be also received in <a href="#callbackquery">callback queries</a> and can be used to <a href="#updating-messages">edit</a> the message.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>query</td>
|
|
<td>String</td>
|
|
<td>The query that was used to obtain the result</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p><strong>Note:</strong> It is necessary to enable <a href="/bots/inline#collecting-feedback">inline feedback</a> via <a href="https://t.me/botfather">@BotFather</a> in order to receive these objects in updates.</p>
|
|
<h4><a class="anchor" name="answerwebappquery" href="#answerwebappquery"><i class="anchor-icon"></i></a>answerWebAppQuery</h4>
|
|
<p>Use this method to set the result of an interaction with a <a href="/bots/webapps">Web App</a> and send a corresponding message on behalf of the user to the chat from which the query originated. On success, a <a href="#sentwebappmessage">SentWebAppMessage</a> object is returned.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>web_app_query_id</td>
|
|
<td>String</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the query to be answered</td>
|
|
</tr>
|
|
<tr>
|
|
<td>result</td>
|
|
<td><a href="#inlinequeryresult">InlineQueryResult</a></td>
|
|
<td>Yes</td>
|
|
<td>A JSON-serialized object describing the message to be sent</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="sentwebappmessage" href="#sentwebappmessage"><i class="anchor-icon"></i></a>SentWebAppMessage</h4>
|
|
<p>Describes an inline message sent by a <a href="/bots/webapps">Web App</a> on behalf of a user.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>inline_message_id</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Identifier of the sent inline message. Available only if there is an <a href="#inlinekeyboardmarkup">inline keyboard</a> attached to the message.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h3><a class="anchor" name="payments" href="#payments"><i class="anchor-icon"></i></a>Payments</h3>
|
|
<p>Your bot can accept payments from Telegram users. Please see the <a href="/bots/payments">introduction to payments</a> for more details on the process and how to set up payments for your bot. Please note that users will need Telegram v.4.0 or higher to use payments (released on May 18, 2017).</p>
|
|
<h4><a class="anchor" name="sendinvoice" href="#sendinvoice"><i class="anchor-icon"></i></a>sendInvoice</h4>
|
|
<p>Use this method to send invoices. On success, the sent <a href="#message">Message</a> is returned.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer or String</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the target chat or username of the target channel (in the format <code>@channelusername</code>)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>message_thread_id</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>Unique identifier for the target message thread (topic) of the forum; for forum supergroups only</td>
|
|
</tr>
|
|
<tr>
|
|
<td>title</td>
|
|
<td>String</td>
|
|
<td>Yes</td>
|
|
<td>Product name, 1-32 characters</td>
|
|
</tr>
|
|
<tr>
|
|
<td>description</td>
|
|
<td>String</td>
|
|
<td>Yes</td>
|
|
<td>Product description, 1-255 characters</td>
|
|
</tr>
|
|
<tr>
|
|
<td>payload</td>
|
|
<td>String</td>
|
|
<td>Yes</td>
|
|
<td>Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>provider_token</td>
|
|
<td>String</td>
|
|
<td>Yes</td>
|
|
<td>Payment provider token, obtained via <a href="https://t.me/botfather">@BotFather</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td>currency</td>
|
|
<td>String</td>
|
|
<td>Yes</td>
|
|
<td>Three-letter ISO 4217 currency code, see <a href="/bots/payments#supported-currencies">more on currencies</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td>prices</td>
|
|
<td>Array of <a href="#labeledprice">LabeledPrice</a></td>
|
|
<td>Yes</td>
|
|
<td>Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>max_tip_amount</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>The maximum accepted amount for tips in the <em>smallest units</em> of the currency (integer, <strong>not</strong> float/double). For example, for a maximum tip of <code>US$ 1.45</code> pass <code>max_tip_amount = 145</code>. See the <em>exp</em> parameter in <a href="/bots/payments/currencies.json">currencies.json</a>, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0</td>
|
|
</tr>
|
|
<tr>
|
|
<td>suggested_tip_amounts</td>
|
|
<td>Array of Integer</td>
|
|
<td>Optional</td>
|
|
<td>A JSON-serialized array of suggested amounts of tips in the <em>smallest units</em> of the currency (integer, <strong>not</strong> float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed <em>max_tip_amount</em>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>start_parameter</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>Unique deep-linking parameter. If left empty, <strong>forwarded copies</strong> of the sent message will have a <em>Pay</em> button, allowing multiple users to pay directly from the forwarded message, using the same invoice. If non-empty, forwarded copies of the sent message will have a <em>URL</em> button with a deep link to the bot (instead of a <em>Pay</em> button), with the value used as the start parameter</td>
|
|
</tr>
|
|
<tr>
|
|
<td>provider_data</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>JSON-serialized data about the invoice, which will be shared with the payment provider. A detailed description of required fields should be provided by the payment provider.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>photo_url</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service. People like it better when they see what they are paying for.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>photo_size</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>Photo size in bytes</td>
|
|
</tr>
|
|
<tr>
|
|
<td>photo_width</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>Photo width</td>
|
|
</tr>
|
|
<tr>
|
|
<td>photo_height</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>Photo height</td>
|
|
</tr>
|
|
<tr>
|
|
<td>need_name</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Pass <em>True</em> if you require the user's full name to complete the order</td>
|
|
</tr>
|
|
<tr>
|
|
<td>need_phone_number</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Pass <em>True</em> if you require the user's phone number to complete the order</td>
|
|
</tr>
|
|
<tr>
|
|
<td>need_email</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Pass <em>True</em> if you require the user's email address to complete the order</td>
|
|
</tr>
|
|
<tr>
|
|
<td>need_shipping_address</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Pass <em>True</em> if you require the user's shipping address to complete the order</td>
|
|
</tr>
|
|
<tr>
|
|
<td>send_phone_number_to_provider</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Pass <em>True</em> if the user's phone number should be sent to provider</td>
|
|
</tr>
|
|
<tr>
|
|
<td>send_email_to_provider</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Pass <em>True</em> if the user's email address should be sent to provider</td>
|
|
</tr>
|
|
<tr>
|
|
<td>is_flexible</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Pass <em>True</em> if the final price depends on the shipping method</td>
|
|
</tr>
|
|
<tr>
|
|
<td>disable_notification</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Sends the message <a href="https://telegram.org/blog/channels-2-0#silent-messages">silently</a>. Users will receive a notification with no sound.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>protect_content</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Protects the contents of the sent message from forwarding and saving</td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply_to_message_id</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>If the message is a reply, ID of the original message</td>
|
|
</tr>
|
|
<tr>
|
|
<td>allow_sending_without_reply</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Pass <em>True</em> if the message should be sent even if the specified replied-to message is not found</td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply_markup</td>
|
|
<td><a href="#inlinekeyboardmarkup">InlineKeyboardMarkup</a></td>
|
|
<td>Optional</td>
|
|
<td>A JSON-serialized object for an <a href="/bots/features#inline-keyboards">inline keyboard</a>. If empty, one 'Pay <code>total price</code>' button will be shown. If not empty, the first button must be a Pay button.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="createinvoicelink" href="#createinvoicelink"><i class="anchor-icon"></i></a>createInvoiceLink</h4>
|
|
<p>Use this method to create a link for an invoice. Returns the created invoice link as <em>String</em> on success.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>title</td>
|
|
<td>String</td>
|
|
<td>Yes</td>
|
|
<td>Product name, 1-32 characters</td>
|
|
</tr>
|
|
<tr>
|
|
<td>description</td>
|
|
<td>String</td>
|
|
<td>Yes</td>
|
|
<td>Product description, 1-255 characters</td>
|
|
</tr>
|
|
<tr>
|
|
<td>payload</td>
|
|
<td>String</td>
|
|
<td>Yes</td>
|
|
<td>Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>provider_token</td>
|
|
<td>String</td>
|
|
<td>Yes</td>
|
|
<td>Payment provider token, obtained via <a href="https://t.me/botfather">BotFather</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td>currency</td>
|
|
<td>String</td>
|
|
<td>Yes</td>
|
|
<td>Three-letter ISO 4217 currency code, see <a href="/bots/payments#supported-currencies">more on currencies</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td>prices</td>
|
|
<td>Array of <a href="#labeledprice">LabeledPrice</a></td>
|
|
<td>Yes</td>
|
|
<td>Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>max_tip_amount</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>The maximum accepted amount for tips in the <em>smallest units</em> of the currency (integer, <strong>not</strong> float/double). For example, for a maximum tip of <code>US$ 1.45</code> pass <code>max_tip_amount = 145</code>. See the <em>exp</em> parameter in <a href="/bots/payments/currencies.json">currencies.json</a>, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0</td>
|
|
</tr>
|
|
<tr>
|
|
<td>suggested_tip_amounts</td>
|
|
<td>Array of Integer</td>
|
|
<td>Optional</td>
|
|
<td>A JSON-serialized array of suggested amounts of tips in the <em>smallest units</em> of the currency (integer, <strong>not</strong> float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed <em>max_tip_amount</em>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>provider_data</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>JSON-serialized data about the invoice, which will be shared with the payment provider. A detailed description of required fields should be provided by the payment provider.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>photo_url</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>photo_size</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>Photo size in bytes</td>
|
|
</tr>
|
|
<tr>
|
|
<td>photo_width</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>Photo width</td>
|
|
</tr>
|
|
<tr>
|
|
<td>photo_height</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>Photo height</td>
|
|
</tr>
|
|
<tr>
|
|
<td>need_name</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Pass <em>True</em> if you require the user's full name to complete the order</td>
|
|
</tr>
|
|
<tr>
|
|
<td>need_phone_number</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Pass <em>True</em> if you require the user's phone number to complete the order</td>
|
|
</tr>
|
|
<tr>
|
|
<td>need_email</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Pass <em>True</em> if you require the user's email address to complete the order</td>
|
|
</tr>
|
|
<tr>
|
|
<td>need_shipping_address</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Pass <em>True</em> if you require the user's shipping address to complete the order</td>
|
|
</tr>
|
|
<tr>
|
|
<td>send_phone_number_to_provider</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Pass <em>True</em> if the user's phone number should be sent to the provider</td>
|
|
</tr>
|
|
<tr>
|
|
<td>send_email_to_provider</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Pass <em>True</em> if the user's email address should be sent to the provider</td>
|
|
</tr>
|
|
<tr>
|
|
<td>is_flexible</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Pass <em>True</em> if the final price depends on the shipping method</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="answershippingquery" href="#answershippingquery"><i class="anchor-icon"></i></a>answerShippingQuery</h4>
|
|
<p>If you sent an invoice requesting a shipping address and the parameter <em>is_flexible</em> was specified, the Bot API will send an <a href="#update">Update</a> with a <em>shipping_query</em> field to the bot. Use this method to reply to shipping queries. On success, <em>True</em> is returned.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>shipping_query_id</td>
|
|
<td>String</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the query to be answered</td>
|
|
</tr>
|
|
<tr>
|
|
<td>ok</td>
|
|
<td>Boolean</td>
|
|
<td>Yes</td>
|
|
<td>Pass <em>True</em> if delivery to the specified address is possible and <em>False</em> if there are any problems (for example, if delivery to the specified address is not possible)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>shipping_options</td>
|
|
<td>Array of <a href="#shippingoption">ShippingOption</a></td>
|
|
<td>Optional</td>
|
|
<td>Required if <em>ok</em> is <em>True</em>. A JSON-serialized array of available shipping options.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>error_message</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>Required if <em>ok</em> is <em>False</em>. Error message in human readable form that explains why it is impossible to complete the order (e.g. "Sorry, delivery to your desired address is unavailable'). Telegram will display this message to the user.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="answerprecheckoutquery" href="#answerprecheckoutquery"><i class="anchor-icon"></i></a>answerPreCheckoutQuery</h4>
|
|
<p>Once the user has confirmed their payment and shipping details, the Bot API sends the final confirmation in the form of an <a href="#update">Update</a> with the field <em>pre_checkout_query</em>. Use this method to respond to such pre-checkout queries. On success, <em>True</em> is returned. <strong>Note:</strong> The Bot API must receive an answer within 10 seconds after the pre-checkout query was sent.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>pre_checkout_query_id</td>
|
|
<td>String</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the query to be answered</td>
|
|
</tr>
|
|
<tr>
|
|
<td>ok</td>
|
|
<td>Boolean</td>
|
|
<td>Yes</td>
|
|
<td>Specify <em>True</em> if everything is alright (goods are available, etc.) and the bot is ready to proceed with the order. Use <em>False</em> if there are any problems.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>error_message</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>Required if <em>ok</em> is <em>False</em>. Error message in human readable form that explains the reason for failure to proceed with the checkout (e.g. "Sorry, somebody just bought the last of our amazing black T-shirts while you were busy filling out your payment details. Please choose a different color or garment!"). Telegram will display this message to the user.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="labeledprice" href="#labeledprice"><i class="anchor-icon"></i></a>LabeledPrice</h4>
|
|
<p>This object represents a portion of the price for goods or services.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>label</td>
|
|
<td>String</td>
|
|
<td>Portion label</td>
|
|
</tr>
|
|
<tr>
|
|
<td>amount</td>
|
|
<td>Integer</td>
|
|
<td>Price of the product in the <em>smallest units</em> of the <a href="/bots/payments#supported-currencies">currency</a> (integer, <strong>not</strong> float/double). For example, for a price of <code>US$ 1.45</code> pass <code>amount = 145</code>. See the <em>exp</em> parameter in <a href="/bots/payments/currencies.json">currencies.json</a>, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="invoice" href="#invoice"><i class="anchor-icon"></i></a>Invoice</h4>
|
|
<p>This object contains basic information about an invoice.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>title</td>
|
|
<td>String</td>
|
|
<td>Product name</td>
|
|
</tr>
|
|
<tr>
|
|
<td>description</td>
|
|
<td>String</td>
|
|
<td>Product description</td>
|
|
</tr>
|
|
<tr>
|
|
<td>start_parameter</td>
|
|
<td>String</td>
|
|
<td>Unique bot deep-linking parameter that can be used to generate this invoice</td>
|
|
</tr>
|
|
<tr>
|
|
<td>currency</td>
|
|
<td>String</td>
|
|
<td>Three-letter ISO 4217 <a href="/bots/payments#supported-currencies">currency</a> code</td>
|
|
</tr>
|
|
<tr>
|
|
<td>total_amount</td>
|
|
<td>Integer</td>
|
|
<td>Total price in the <em>smallest units</em> of the currency (integer, <strong>not</strong> float/double). For example, for a price of <code>US$ 1.45</code> pass <code>amount = 145</code>. See the <em>exp</em> parameter in <a href="/bots/payments/currencies.json">currencies.json</a>, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="shippingaddress" href="#shippingaddress"><i class="anchor-icon"></i></a>ShippingAddress</h4>
|
|
<p>This object represents a shipping address.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>country_code</td>
|
|
<td>String</td>
|
|
<td>Two-letter ISO 3166-1 alpha-2 country code</td>
|
|
</tr>
|
|
<tr>
|
|
<td>state</td>
|
|
<td>String</td>
|
|
<td>State, if applicable</td>
|
|
</tr>
|
|
<tr>
|
|
<td>city</td>
|
|
<td>String</td>
|
|
<td>City</td>
|
|
</tr>
|
|
<tr>
|
|
<td>street_line1</td>
|
|
<td>String</td>
|
|
<td>First line for the address</td>
|
|
</tr>
|
|
<tr>
|
|
<td>street_line2</td>
|
|
<td>String</td>
|
|
<td>Second line for the address</td>
|
|
</tr>
|
|
<tr>
|
|
<td>post_code</td>
|
|
<td>String</td>
|
|
<td>Address post code</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="orderinfo" href="#orderinfo"><i class="anchor-icon"></i></a>OrderInfo</h4>
|
|
<p>This object represents information about an order.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>name</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. User name</td>
|
|
</tr>
|
|
<tr>
|
|
<td>phone_number</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. User's phone number</td>
|
|
</tr>
|
|
<tr>
|
|
<td>email</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. User email</td>
|
|
</tr>
|
|
<tr>
|
|
<td>shipping_address</td>
|
|
<td><a href="#shippingaddress">ShippingAddress</a></td>
|
|
<td><em>Optional</em>. User shipping address</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="shippingoption" href="#shippingoption"><i class="anchor-icon"></i></a>ShippingOption</h4>
|
|
<p>This object represents one shipping option.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>id</td>
|
|
<td>String</td>
|
|
<td>Shipping option identifier</td>
|
|
</tr>
|
|
<tr>
|
|
<td>title</td>
|
|
<td>String</td>
|
|
<td>Option title</td>
|
|
</tr>
|
|
<tr>
|
|
<td>prices</td>
|
|
<td>Array of <a href="#labeledprice">LabeledPrice</a></td>
|
|
<td>List of price portions</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="successfulpayment" href="#successfulpayment"><i class="anchor-icon"></i></a>SuccessfulPayment</h4>
|
|
<p>This object contains basic information about a successful payment.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>currency</td>
|
|
<td>String</td>
|
|
<td>Three-letter ISO 4217 <a href="/bots/payments#supported-currencies">currency</a> code</td>
|
|
</tr>
|
|
<tr>
|
|
<td>total_amount</td>
|
|
<td>Integer</td>
|
|
<td>Total price in the <em>smallest units</em> of the currency (integer, <strong>not</strong> float/double). For example, for a price of <code>US$ 1.45</code> pass <code>amount = 145</code>. See the <em>exp</em> parameter in <a href="/bots/payments/currencies.json">currencies.json</a>, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).</td>
|
|
</tr>
|
|
<tr>
|
|
<td>invoice_payload</td>
|
|
<td>String</td>
|
|
<td>Bot specified invoice payload</td>
|
|
</tr>
|
|
<tr>
|
|
<td>shipping_option_id</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Identifier of the shipping option chosen by the user</td>
|
|
</tr>
|
|
<tr>
|
|
<td>order_info</td>
|
|
<td><a href="#orderinfo">OrderInfo</a></td>
|
|
<td><em>Optional</em>. Order information provided by the user</td>
|
|
</tr>
|
|
<tr>
|
|
<td>telegram_payment_charge_id</td>
|
|
<td>String</td>
|
|
<td>Telegram payment identifier</td>
|
|
</tr>
|
|
<tr>
|
|
<td>provider_payment_charge_id</td>
|
|
<td>String</td>
|
|
<td>Provider payment identifier</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="shippingquery" href="#shippingquery"><i class="anchor-icon"></i></a>ShippingQuery</h4>
|
|
<p>This object contains information about an incoming shipping query.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>id</td>
|
|
<td>String</td>
|
|
<td>Unique query identifier</td>
|
|
</tr>
|
|
<tr>
|
|
<td>from</td>
|
|
<td><a href="#user">User</a></td>
|
|
<td>User who sent the query</td>
|
|
</tr>
|
|
<tr>
|
|
<td>invoice_payload</td>
|
|
<td>String</td>
|
|
<td>Bot specified invoice payload</td>
|
|
</tr>
|
|
<tr>
|
|
<td>shipping_address</td>
|
|
<td><a href="#shippingaddress">ShippingAddress</a></td>
|
|
<td>User specified shipping address</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="precheckoutquery" href="#precheckoutquery"><i class="anchor-icon"></i></a>PreCheckoutQuery</h4>
|
|
<p>This object contains information about an incoming pre-checkout query.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>id</td>
|
|
<td>String</td>
|
|
<td>Unique query identifier</td>
|
|
</tr>
|
|
<tr>
|
|
<td>from</td>
|
|
<td><a href="#user">User</a></td>
|
|
<td>User who sent the query</td>
|
|
</tr>
|
|
<tr>
|
|
<td>currency</td>
|
|
<td>String</td>
|
|
<td>Three-letter ISO 4217 <a href="/bots/payments#supported-currencies">currency</a> code</td>
|
|
</tr>
|
|
<tr>
|
|
<td>total_amount</td>
|
|
<td>Integer</td>
|
|
<td>Total price in the <em>smallest units</em> of the currency (integer, <strong>not</strong> float/double). For example, for a price of <code>US$ 1.45</code> pass <code>amount = 145</code>. See the <em>exp</em> parameter in <a href="/bots/payments/currencies.json">currencies.json</a>, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).</td>
|
|
</tr>
|
|
<tr>
|
|
<td>invoice_payload</td>
|
|
<td>String</td>
|
|
<td>Bot specified invoice payload</td>
|
|
</tr>
|
|
<tr>
|
|
<td>shipping_option_id</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Identifier of the shipping option chosen by the user</td>
|
|
</tr>
|
|
<tr>
|
|
<td>order_info</td>
|
|
<td><a href="#orderinfo">OrderInfo</a></td>
|
|
<td><em>Optional</em>. Order information provided by the user</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h3><a class="anchor" name="telegram-passport" href="#telegram-passport"><i class="anchor-icon"></i></a>Telegram Passport</h3>
|
|
<p><strong>Telegram Passport</strong> is a unified authorization method for services that require personal identification. Users can upload their documents once, then instantly share their data with services that require real-world ID (finance, ICOs, etc.). Please see the <a href="/passport">manual</a> for details.</p>
|
|
<h4><a class="anchor" name="passportdata" href="#passportdata"><i class="anchor-icon"></i></a>PassportData</h4>
|
|
<p>Describes Telegram Passport data shared with the bot by the user.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>data</td>
|
|
<td>Array of <a href="#encryptedpassportelement">EncryptedPassportElement</a></td>
|
|
<td>Array with information about documents and other Telegram Passport elements that was shared with the bot</td>
|
|
</tr>
|
|
<tr>
|
|
<td>credentials</td>
|
|
<td><a href="#encryptedcredentials">EncryptedCredentials</a></td>
|
|
<td>Encrypted credentials required to decrypt the data</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="passportfile" href="#passportfile"><i class="anchor-icon"></i></a>PassportFile</h4>
|
|
<p>This object represents a file uploaded to Telegram Passport. Currently all Telegram Passport files are in JPEG format when decrypted and don't exceed 10MB.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>file_id</td>
|
|
<td>String</td>
|
|
<td>Identifier for this file, which can be used to download or reuse the file</td>
|
|
</tr>
|
|
<tr>
|
|
<td>file_unique_id</td>
|
|
<td>String</td>
|
|
<td>Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>file_size</td>
|
|
<td>Integer</td>
|
|
<td>File size in bytes</td>
|
|
</tr>
|
|
<tr>
|
|
<td>file_date</td>
|
|
<td>Integer</td>
|
|
<td>Unix time when the file was uploaded</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="encryptedpassportelement" href="#encryptedpassportelement"><i class="anchor-icon"></i></a>EncryptedPassportElement</h4>
|
|
<p>Describes documents or other Telegram Passport elements shared with the bot by the user.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>type</td>
|
|
<td>String</td>
|
|
<td>Element type. One of “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport”, “address”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”, “phone_number”, “email”.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>data</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Base64-encoded encrypted Telegram Passport element data provided by the user, available for “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport” and “address” types. Can be decrypted and verified using the accompanying <a href="#encryptedcredentials">EncryptedCredentials</a>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>phone_number</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. User's verified phone number, available only for “phone_number” type</td>
|
|
</tr>
|
|
<tr>
|
|
<td>email</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. User's verified email address, available only for “email” type</td>
|
|
</tr>
|
|
<tr>
|
|
<td>files</td>
|
|
<td>Array of <a href="#passportfile">PassportFile</a></td>
|
|
<td><em>Optional</em>. Array of encrypted files with documents provided by the user, available for “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration” and “temporary_registration” types. Files can be decrypted and verified using the accompanying <a href="#encryptedcredentials">EncryptedCredentials</a>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>front_side</td>
|
|
<td><a href="#passportfile">PassportFile</a></td>
|
|
<td><em>Optional</em>. Encrypted file with the front side of the document, provided by the user. Available for “passport”, “driver_license”, “identity_card” and “internal_passport”. The file can be decrypted and verified using the accompanying <a href="#encryptedcredentials">EncryptedCredentials</a>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>reverse_side</td>
|
|
<td><a href="#passportfile">PassportFile</a></td>
|
|
<td><em>Optional</em>. Encrypted file with the reverse side of the document, provided by the user. Available for “driver_license” and “identity_card”. The file can be decrypted and verified using the accompanying <a href="#encryptedcredentials">EncryptedCredentials</a>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>selfie</td>
|
|
<td><a href="#passportfile">PassportFile</a></td>
|
|
<td><em>Optional</em>. Encrypted file with the selfie of the user holding a document, provided by the user; available for “passport”, “driver_license”, “identity_card” and “internal_passport”. The file can be decrypted and verified using the accompanying <a href="#encryptedcredentials">EncryptedCredentials</a>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>translation</td>
|
|
<td>Array of <a href="#passportfile">PassportFile</a></td>
|
|
<td><em>Optional</em>. Array of encrypted files with translated versions of documents provided by the user. Available if requested for “passport”, “driver_license”, “identity_card”, “internal_passport”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration” and “temporary_registration” types. Files can be decrypted and verified using the accompanying <a href="#encryptedcredentials">EncryptedCredentials</a>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>hash</td>
|
|
<td>String</td>
|
|
<td>Base64-encoded element hash for using in <a href="#passportelementerrorunspecified">PassportElementErrorUnspecified</a></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="encryptedcredentials" href="#encryptedcredentials"><i class="anchor-icon"></i></a>EncryptedCredentials</h4>
|
|
<p>Describes data required for decrypting and authenticating <a href="#encryptedpassportelement">EncryptedPassportElement</a>. See the <a href="/passport#receiving-information">Telegram Passport Documentation</a> for a complete description of the data decryption and authentication processes.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>data</td>
|
|
<td>String</td>
|
|
<td>Base64-encoded encrypted JSON-serialized data with unique user's payload, data hashes and secrets required for <a href="#encryptedpassportelement">EncryptedPassportElement</a> decryption and authentication</td>
|
|
</tr>
|
|
<tr>
|
|
<td>hash</td>
|
|
<td>String</td>
|
|
<td>Base64-encoded data hash for data authentication</td>
|
|
</tr>
|
|
<tr>
|
|
<td>secret</td>
|
|
<td>String</td>
|
|
<td>Base64-encoded secret, encrypted with the bot's public RSA key, required for data decryption</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="setpassportdataerrors" href="#setpassportdataerrors"><i class="anchor-icon"></i></a>setPassportDataErrors</h4>
|
|
<p>Informs a user that some of the Telegram Passport elements they provided contains errors. The user will not be able to re-submit their Passport to you until the errors are fixed (the contents of the field for which you returned the error must change). Returns <em>True</em> on success.</p>
|
|
<p>Use this if the data submitted by the user doesn't satisfy the standards your service requires for any reason. For example, if a birthday date seems invalid, a submitted document is blurry, a scan shows evidence of tampering, etc. Supply some details in the error message to make sure the user knows how to correct the issues.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>user_id</td>
|
|
<td>Integer</td>
|
|
<td>Yes</td>
|
|
<td>User identifier</td>
|
|
</tr>
|
|
<tr>
|
|
<td>errors</td>
|
|
<td>Array of <a href="#passportelementerror">PassportElementError</a></td>
|
|
<td>Yes</td>
|
|
<td>A JSON-serialized array describing the errors</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="passportelementerror" href="#passportelementerror"><i class="anchor-icon"></i></a>PassportElementError</h4>
|
|
<p>This object represents an error in the Telegram Passport element which was submitted that should be resolved by the user. It should be one of:</p>
|
|
<ul>
|
|
<li><a href="#passportelementerrordatafield">PassportElementErrorDataField</a></li>
|
|
<li><a href="#passportelementerrorfrontside">PassportElementErrorFrontSide</a></li>
|
|
<li><a href="#passportelementerrorreverseside">PassportElementErrorReverseSide</a></li>
|
|
<li><a href="#passportelementerrorselfie">PassportElementErrorSelfie</a></li>
|
|
<li><a href="#passportelementerrorfile">PassportElementErrorFile</a></li>
|
|
<li><a href="#passportelementerrorfiles">PassportElementErrorFiles</a></li>
|
|
<li><a href="#passportelementerrortranslationfile">PassportElementErrorTranslationFile</a></li>
|
|
<li><a href="#passportelementerrortranslationfiles">PassportElementErrorTranslationFiles</a></li>
|
|
<li><a href="#passportelementerrorunspecified">PassportElementErrorUnspecified</a></li>
|
|
</ul>
|
|
<h4><a class="anchor" name="passportelementerrordatafield" href="#passportelementerrordatafield"><i class="anchor-icon"></i></a>PassportElementErrorDataField</h4>
|
|
<p>Represents an issue in one of the data fields that was provided by the user. The error is considered resolved when the field's value changes.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>source</td>
|
|
<td>String</td>
|
|
<td>Error source, must be <em>data</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>type</td>
|
|
<td>String</td>
|
|
<td>The section of the user's Telegram Passport which has the error, one of “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport”, “address”</td>
|
|
</tr>
|
|
<tr>
|
|
<td>field_name</td>
|
|
<td>String</td>
|
|
<td>Name of the data field which has the error</td>
|
|
</tr>
|
|
<tr>
|
|
<td>data_hash</td>
|
|
<td>String</td>
|
|
<td>Base64-encoded data hash</td>
|
|
</tr>
|
|
<tr>
|
|
<td>message</td>
|
|
<td>String</td>
|
|
<td>Error message</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="passportelementerrorfrontside" href="#passportelementerrorfrontside"><i class="anchor-icon"></i></a>PassportElementErrorFrontSide</h4>
|
|
<p>Represents an issue with the front side of a document. The error is considered resolved when the file with the front side of the document changes.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>source</td>
|
|
<td>String</td>
|
|
<td>Error source, must be <em>front_side</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>type</td>
|
|
<td>String</td>
|
|
<td>The section of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport”</td>
|
|
</tr>
|
|
<tr>
|
|
<td>file_hash</td>
|
|
<td>String</td>
|
|
<td>Base64-encoded hash of the file with the front side of the document</td>
|
|
</tr>
|
|
<tr>
|
|
<td>message</td>
|
|
<td>String</td>
|
|
<td>Error message</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="passportelementerrorreverseside" href="#passportelementerrorreverseside"><i class="anchor-icon"></i></a>PassportElementErrorReverseSide</h4>
|
|
<p>Represents an issue with the reverse side of a document. The error is considered resolved when the file with reverse side of the document changes.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>source</td>
|
|
<td>String</td>
|
|
<td>Error source, must be <em>reverse_side</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>type</td>
|
|
<td>String</td>
|
|
<td>The section of the user's Telegram Passport which has the issue, one of “driver_license”, “identity_card”</td>
|
|
</tr>
|
|
<tr>
|
|
<td>file_hash</td>
|
|
<td>String</td>
|
|
<td>Base64-encoded hash of the file with the reverse side of the document</td>
|
|
</tr>
|
|
<tr>
|
|
<td>message</td>
|
|
<td>String</td>
|
|
<td>Error message</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="passportelementerrorselfie" href="#passportelementerrorselfie"><i class="anchor-icon"></i></a>PassportElementErrorSelfie</h4>
|
|
<p>Represents an issue with the selfie with a document. The error is considered resolved when the file with the selfie changes.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>source</td>
|
|
<td>String</td>
|
|
<td>Error source, must be <em>selfie</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>type</td>
|
|
<td>String</td>
|
|
<td>The section of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport”</td>
|
|
</tr>
|
|
<tr>
|
|
<td>file_hash</td>
|
|
<td>String</td>
|
|
<td>Base64-encoded hash of the file with the selfie</td>
|
|
</tr>
|
|
<tr>
|
|
<td>message</td>
|
|
<td>String</td>
|
|
<td>Error message</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="passportelementerrorfile" href="#passportelementerrorfile"><i class="anchor-icon"></i></a>PassportElementErrorFile</h4>
|
|
<p>Represents an issue with a document scan. The error is considered resolved when the file with the document scan changes.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>source</td>
|
|
<td>String</td>
|
|
<td>Error source, must be <em>file</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>type</td>
|
|
<td>String</td>
|
|
<td>The section of the user's Telegram Passport which has the issue, one of “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”</td>
|
|
</tr>
|
|
<tr>
|
|
<td>file_hash</td>
|
|
<td>String</td>
|
|
<td>Base64-encoded file hash</td>
|
|
</tr>
|
|
<tr>
|
|
<td>message</td>
|
|
<td>String</td>
|
|
<td>Error message</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="passportelementerrorfiles" href="#passportelementerrorfiles"><i class="anchor-icon"></i></a>PassportElementErrorFiles</h4>
|
|
<p>Represents an issue with a list of scans. The error is considered resolved when the list of files containing the scans changes.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>source</td>
|
|
<td>String</td>
|
|
<td>Error source, must be <em>files</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>type</td>
|
|
<td>String</td>
|
|
<td>The section of the user's Telegram Passport which has the issue, one of “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”</td>
|
|
</tr>
|
|
<tr>
|
|
<td>file_hashes</td>
|
|
<td>Array of String</td>
|
|
<td>List of base64-encoded file hashes</td>
|
|
</tr>
|
|
<tr>
|
|
<td>message</td>
|
|
<td>String</td>
|
|
<td>Error message</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="passportelementerrortranslationfile" href="#passportelementerrortranslationfile"><i class="anchor-icon"></i></a>PassportElementErrorTranslationFile</h4>
|
|
<p>Represents an issue with one of the files that constitute the translation of a document. The error is considered resolved when the file changes.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>source</td>
|
|
<td>String</td>
|
|
<td>Error source, must be <em>translation_file</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>type</td>
|
|
<td>String</td>
|
|
<td>Type of element of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”</td>
|
|
</tr>
|
|
<tr>
|
|
<td>file_hash</td>
|
|
<td>String</td>
|
|
<td>Base64-encoded file hash</td>
|
|
</tr>
|
|
<tr>
|
|
<td>message</td>
|
|
<td>String</td>
|
|
<td>Error message</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="passportelementerrortranslationfiles" href="#passportelementerrortranslationfiles"><i class="anchor-icon"></i></a>PassportElementErrorTranslationFiles</h4>
|
|
<p>Represents an issue with the translated version of a document. The error is considered resolved when a file with the document translation change.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>source</td>
|
|
<td>String</td>
|
|
<td>Error source, must be <em>translation_files</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>type</td>
|
|
<td>String</td>
|
|
<td>Type of element of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”</td>
|
|
</tr>
|
|
<tr>
|
|
<td>file_hashes</td>
|
|
<td>Array of String</td>
|
|
<td>List of base64-encoded file hashes</td>
|
|
</tr>
|
|
<tr>
|
|
<td>message</td>
|
|
<td>String</td>
|
|
<td>Error message</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="passportelementerrorunspecified" href="#passportelementerrorunspecified"><i class="anchor-icon"></i></a>PassportElementErrorUnspecified</h4>
|
|
<p>Represents an issue in an unspecified place. The error is considered resolved when new data is added.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>source</td>
|
|
<td>String</td>
|
|
<td>Error source, must be <em>unspecified</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td>type</td>
|
|
<td>String</td>
|
|
<td>Type of element of the user's Telegram Passport which has the issue</td>
|
|
</tr>
|
|
<tr>
|
|
<td>element_hash</td>
|
|
<td>String</td>
|
|
<td>Base64-encoded element hash</td>
|
|
</tr>
|
|
<tr>
|
|
<td>message</td>
|
|
<td>String</td>
|
|
<td>Error message</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h3><a class="anchor" name="games" href="#games"><i class="anchor-icon"></i></a>Games</h3>
|
|
<p>Your bot can offer users <strong>HTML5 games</strong> to play solo or to compete against each other in groups and one-on-one chats. Create games via <a href="https://t.me/botfather">@BotFather</a> using the <em>/newgame</em> command. Please note that this kind of power requires responsibility: you will need to accept the terms for each game that your bots will be offering.</p>
|
|
<ul>
|
|
<li>Games are a new type of content on Telegram, represented by the <a href="#game">Game</a> and <a href="#inlinequeryresultgame">InlineQueryResultGame</a> objects.</li>
|
|
<li>Once you've created a game via <a href="https://t.me/botfather">BotFather</a>, you can send games to chats as regular messages using the <a href="#sendgame">sendGame</a> method, or use <a href="#inline-mode">inline mode</a> with <a href="#inlinequeryresultgame">InlineQueryResultGame</a>.</li>
|
|
<li>If you send the game message without any buttons, it will automatically have a 'Play <em>GameName</em>' button. When this button is pressed, your bot gets a <a href="#callbackquery">CallbackQuery</a> with the <em>game_short_name</em> of the requested game. You provide the correct URL for this particular user and the app opens the game in the in-app browser.</li>
|
|
<li>You can manually add multiple buttons to your game message. Please note that the first button in the first row <strong>must always</strong> launch the game, using the field <em>callback_game</em> in <a href="#inlinekeyboardbutton">InlineKeyboardButton</a>. You can add extra buttons according to taste: e.g., for a description of the rules, or to open the game's official community.</li>
|
|
<li>To make your game more attractive, you can upload a GIF animation that demostrates the game to the users via <a href="https://t.me/botfather">BotFather</a> (see <a href="https://t.me/gamebot?game=lumberjack">Lumberjack</a> for example).</li>
|
|
<li>A game message will also display high scores for the current chat. Use <a href="#setgamescore">setGameScore</a> to post high scores to the chat with the game, add the <em>edit_message</em> parameter to automatically update the message with the current scoreboard.</li>
|
|
<li>Use <a href="#getgamehighscores">getGameHighScores</a> to get data for in-game high score tables.</li>
|
|
<li>You can also add an extra <a href="/bots/games#sharing-your-game-to-telegram-chats">sharing button</a> for users to share their best score to different chats.</li>
|
|
<li>For examples of what can be done using this new stuff, check the <a href="https://t.me/gamebot">@gamebot</a> and <a href="https://t.me/gamee">@gamee</a> bots.</li>
|
|
</ul>
|
|
<h4><a class="anchor" name="sendgame" href="#sendgame"><i class="anchor-icon"></i></a>sendGame</h4>
|
|
<p>Use this method to send a game. On success, the sent <a href="#message">Message</a> is returned.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer</td>
|
|
<td>Yes</td>
|
|
<td>Unique identifier for the target chat</td>
|
|
</tr>
|
|
<tr>
|
|
<td>message_thread_id</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>Unique identifier for the target message thread (topic) of the forum; for forum supergroups only</td>
|
|
</tr>
|
|
<tr>
|
|
<td>game_short_name</td>
|
|
<td>String</td>
|
|
<td>Yes</td>
|
|
<td>Short name of the game, serves as the unique identifier for the game. Set up your games via <a href="https://t.me/botfather">@BotFather</a>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>disable_notification</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Sends the message <a href="https://telegram.org/blog/channels-2-0#silent-messages">silently</a>. Users will receive a notification with no sound.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>protect_content</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Protects the contents of the sent message from forwarding and saving</td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply_to_message_id</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>If the message is a reply, ID of the original message</td>
|
|
</tr>
|
|
<tr>
|
|
<td>allow_sending_without_reply</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Pass <em>True</em> if the message should be sent even if the specified replied-to message is not found</td>
|
|
</tr>
|
|
<tr>
|
|
<td>reply_markup</td>
|
|
<td><a href="#inlinekeyboardmarkup">InlineKeyboardMarkup</a></td>
|
|
<td>Optional</td>
|
|
<td>A JSON-serialized object for an <a href="/bots/features#inline-keyboards">inline keyboard</a>. If empty, one 'Play game_title' button will be shown. If not empty, the first button must launch the game.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="game" href="#game"><i class="anchor-icon"></i></a>Game</h4>
|
|
<p>This object represents a game. Use BotFather to create and edit games, their short names will act as unique identifiers.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>title</td>
|
|
<td>String</td>
|
|
<td>Title of the game</td>
|
|
</tr>
|
|
<tr>
|
|
<td>description</td>
|
|
<td>String</td>
|
|
<td>Description of the game</td>
|
|
</tr>
|
|
<tr>
|
|
<td>photo</td>
|
|
<td>Array of <a href="#photosize">PhotoSize</a></td>
|
|
<td>Photo that will be displayed in the game message in chats.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>text</td>
|
|
<td>String</td>
|
|
<td><em>Optional</em>. Brief description of the game or high scores included in the game message. Can be automatically edited to include current high scores for the game when the bot calls <a href="#setgamescore">setGameScore</a>, or manually edited using <a href="#editmessagetext">editMessageText</a>. 0-4096 characters.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>text_entities</td>
|
|
<td>Array of <a href="#messageentity">MessageEntity</a></td>
|
|
<td><em>Optional</em>. Special entities that appear in <em>text</em>, such as usernames, URLs, bot commands, etc.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>animation</td>
|
|
<td><a href="#animation">Animation</a></td>
|
|
<td><em>Optional</em>. Animation that will be displayed in the game message in chats. Upload via <a href="https://t.me/botfather">BotFather</a></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="callbackgame" href="#callbackgame"><i class="anchor-icon"></i></a>CallbackGame</h4>
|
|
<p>A placeholder, currently holds no information. Use <a href="https://t.me/botfather">BotFather</a> to set up your game.</p>
|
|
<h4><a class="anchor" name="setgamescore" href="#setgamescore"><i class="anchor-icon"></i></a>setGameScore</h4>
|
|
<p>Use this method to set the score of the specified user in a game message. On success, if the message is not an inline message, the <a href="#message">Message</a> is returned, otherwise <em>True</em> is returned. Returns an error, if the new score is not greater than the user's current score in the chat and <em>force</em> is <em>False</em>.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>user_id</td>
|
|
<td>Integer</td>
|
|
<td>Yes</td>
|
|
<td>User identifier</td>
|
|
</tr>
|
|
<tr>
|
|
<td>score</td>
|
|
<td>Integer</td>
|
|
<td>Yes</td>
|
|
<td>New score, must be non-negative</td>
|
|
</tr>
|
|
<tr>
|
|
<td>force</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Pass <em>True</em> if the high score is allowed to decrease. This can be useful when fixing mistakes or banning cheaters</td>
|
|
</tr>
|
|
<tr>
|
|
<td>disable_edit_message</td>
|
|
<td>Boolean</td>
|
|
<td>Optional</td>
|
|
<td>Pass <em>True</em> if the game message should not be automatically edited to include the current scoreboard</td>
|
|
</tr>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>Required if <em>inline_message_id</em> is not specified. Unique identifier for the target chat</td>
|
|
</tr>
|
|
<tr>
|
|
<td>message_id</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>Required if <em>inline_message_id</em> is not specified. Identifier of the sent message</td>
|
|
</tr>
|
|
<tr>
|
|
<td>inline_message_id</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>Required if <em>chat_id</em> and <em>message_id</em> are not specified. Identifier of the inline message</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="getgamehighscores" href="#getgamehighscores"><i class="anchor-icon"></i></a>getGameHighScores</h4>
|
|
<p>Use this method to get data for high score tables. Will return the score of the specified user and several of their neighbors in a game. Returns an Array of <a href="#gamehighscore">GameHighScore</a> objects.</p>
|
|
<blockquote>
|
|
<p>This method will currently return scores for the target user, plus two of their closest neighbors on each side. Will also return the top three users if the user and their neighbors are not among them. Please note that this behavior is subject to change.</p>
|
|
</blockquote>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>user_id</td>
|
|
<td>Integer</td>
|
|
<td>Yes</td>
|
|
<td>Target user id</td>
|
|
</tr>
|
|
<tr>
|
|
<td>chat_id</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>Required if <em>inline_message_id</em> is not specified. Unique identifier for the target chat</td>
|
|
</tr>
|
|
<tr>
|
|
<td>message_id</td>
|
|
<td>Integer</td>
|
|
<td>Optional</td>
|
|
<td>Required if <em>inline_message_id</em> is not specified. Identifier of the sent message</td>
|
|
</tr>
|
|
<tr>
|
|
<td>inline_message_id</td>
|
|
<td>String</td>
|
|
<td>Optional</td>
|
|
<td>Required if <em>chat_id</em> and <em>message_id</em> are not specified. Identifier of the inline message</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h4><a class="anchor" name="gamehighscore" href="#gamehighscore"><i class="anchor-icon"></i></a>GameHighScore</h4>
|
|
<p>This object represents one row of the high scores table for a game.</p>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>position</td>
|
|
<td>Integer</td>
|
|
<td>Position in high score table for the game</td>
|
|
</tr>
|
|
<tr>
|
|
<td>user</td>
|
|
<td><a href="#user">User</a></td>
|
|
<td>User</td>
|
|
</tr>
|
|
<tr>
|
|
<td>score</td>
|
|
<td>Integer</td>
|
|
<td>Score</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<hr>
|
|
<p>And that's about all we've got for now.<br>If you've got any questions, please check out our <a href="/bots/faq"><strong>Bot FAQ »</strong></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>
|
|
|