The Bot API is an HTTP-based interface created for developers keen on building bots for Telegram.
机器人 API 是一个基于 HTTP 的接口,专为希望为 Telegram 开发机器人的开发者创建。
To learn how to create and set up a bot, please consult our Introduction to Bots and Bot FAQ.
要了解如何创建和设置机器人,请查阅我们的《机器人介绍》和《机器人常见问题解答》。
Subscribe to @BotNews to be the first to know about the latest updates and join the discussion in @BotTalk
订阅@BotNews 以第一时间了解最新更新,并在@BotTalk 中加入讨论
Bot API 8.3
Bot API 8.2
Bot API 8.1
Bot API 8.0
Bot API 8.0 introduces 10 powerful new features for Mini Apps - including the ability to enter full-screen mode, launch from home screen shortcuts, offer subscription plans and more. Check out all the details in our dedicated blog and Mini App documentation.
Bot API 8.0 为小程序引入了 10 个强大的新功能 - 包括进入全屏模式、从主屏幕快捷方式启动、提供订阅计划等。请查看我们专门的博客和小程序文档以获取所有详情。
Star Subscriptions 星级订阅
Full-screen Mode 全屏模式
Homescreen Shortcuts 主屏幕快捷方式
Emoji Status 表情符号状态
Media Sharing and File Downloads
媒体共享和文件下载
Geolocation Access 地理位置访问
Device Motion Tracking 设备运动跟踪
Gifts 礼物
Loading Screen Customization
加载屏幕自定义
Hardware-specific Optimizations
硬件特定优化
General 通用
WARNING!
![]()
警告!
![]()
Starting December 1, 2024 messages with video that are sent, copied or forwarded to groups and channels with a sufficiently large audience can be automatically scheduled by the server until the respective video is reencoded. Such messages will have 0 as their message identifier and can't be used before they are actually sent.
从 2024 年 12 月 1 日起,发送、复制或转发到具有足够大受众的群组和频道的带视频的消息可以由服务器自动安排,直到相应的视频被重新编码。此类消息的标识符为 0,在实际发送前无法使用。
Each bot is given a unique authentication token when it is created. The token looks something like 123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11
, but we'll use simply <token> in this document instead. You can learn about obtaining tokens and generating new ones in this document.
每个机器人在创建时都会获得一个唯一的身份验证令牌。令牌看起来像 123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11
,但在本文档中我们将简单地使用代替。你可以在这个文档中了解如何获取令牌和生成新的令牌。
All queries to the Telegram Bot API must be served over HTTPS and need to be presented in this form: https://api.telegram.org/bot<token>/METHOD_NAME
. Like this for example:
所有对 Telegram Bot API 的查询必须通过 HTTPS 进行,并且需要以这种形式呈现: https://api.telegram.org/bot<token>/METHOD_NAME
。例如像这样:
https://api.telegram.org/bot123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11/getMe
We support GET and POST HTTP methods. We support four ways of passing parameters in Bot API requests:
我们支持 GET 和 POST HTTP 方法。我们支持在 Bot API 请求中传递参数的四种方式:
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 True, 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 ResponseParameters, which can help to automatically handle the error.
响应包含一个 JSON 对象,该对象始终有一个布尔字段'ok',并且可能有一个可选的字符串字段'description',其中包含结果的人类可读描述。如果'ok'等于 True,则请求成功,查询结果可以在'result'字段中找到。在请求不成功的情况下,'ok'等于 false,错误会在'description'中解释。还会返回一个整数'error_code'字段,但其内容将来可能会更改。某些错误还可能有一个可选字段'parameters',类型为 ResponseParameters,这可以帮助自动处理错误。
If you're using webhooks, you can perform a request to the Bot API while sending an answer to the webhook. Use either application/json or application/x-www-form-urlencoded or multipart/form-data response content type for passing parameters. Specify the method to be invoked in the method parameter of the request. It's not possible to know that such a request was successful or get its result.
如果您使用网络钩子,您可以在发送网络钩子的回答时向 Bot API 发起请求。使用 application/json 或 application/x-www-form-urlencoded 或 multipart/form-data 响应内容类型来传递参数。在请求的 method 参数中指定要调用的方法。无法得知此类请求是否成功或获取其结果。
Please see our FAQ for examples.
请查看我们的常见问题解答以获取示例。
The Bot API server source code is available at telegram-bot-api. You can run it locally and send the requests to your own server instead of https://api.telegram.org
. If you switch to a local Bot API server, your bot will be able to:
Bot API 服务器源代码可在 telegram-bot-api 获取。您可以本地运行它,并将请求发送到您自己的服务器,而不是 https://api.telegram.org
。如果您切换到本地 Bot API 服务器,您的机器人将能够:
The majority of bots will be OK with the default configuration, running on our servers. But if you feel that you need one of these features, you're welcome to switch to your own at any time.
大多数机器人使用默认配置在我们的服务器上运行是可以的。但是,如果您觉得需要这些功能中的一个,随时可以切换到您自己的服务器。
There are two mutually exclusive ways of receiving updates for your bot - the getUpdates method on one hand and webhooks 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.
接收机器人更新有两种互斥的方式 - 一方面是 getUpdates 方法,另一方面是 webhooks。不管哪种方式,传入的更新都会存储在服务器上,直到机器人接收到它们为止,但这些更新不会被保留超过 24 小时。
Regardless of which option you choose, you will receive JSON-serialized Update objects as a result.
无论您选择哪种选项,您都会收到 JSON 序列化的 Update 对象作为结果。
This object represents an incoming update.
此对象代表一个传入的更新。
At most one of the optional parameters can be present in any given update.
在任何给定的更新中,最多只能有一个可选参数存在。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
update_id 更新 ID | Integer 整数 | The update's unique identifier. Update identifiers start from a certain positive number and increase sequentially. This identifier becomes especially handy if you're using webhooks, 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. 更新的唯一标识符。更新标识符从某个正数开始并按顺序增加。如果使用 webhook,此标识符特别有用,因为它允许您忽略重复的更新,或者在更新顺序出现混乱时恢复正确的更新顺序。如果至少一周没有新更新,那么下一个更新的标识符将随机选择而不是按顺序选择。 |
message 消息 | Message 消息 | Optional. New incoming message of any kind - text, photo, sticker, etc. 可选。任何类型的新传入消息 - 文本、照片、贴纸等。 |
edited_message 编辑后的消息 | Message 消息 | Optional. New version of a message that is known to the bot and was edited. This update may at times be triggered by changes to message fields that are either unavailable or not actively used by your bot. 可选。已知且被编辑的消息的新版本。此更新有时可能由消息字段的更改触发,这些字段要么不可用,要么未被您的机器人主动使用。 |
channel_post 频道帖子 | Message 消息 | Optional. New incoming channel post of any kind - text, photo, sticker, etc. 可选。任何类型的新传入频道帖子 - 文本、照片、贴纸等。 |
edited_channel_post 编辑的频道帖子 | Message 消息 | Optional. New version of a channel post that is known to the bot and was edited. This update may at times be triggered by changes to message fields that are either unavailable or not actively used by your bot. 可选。机器人已知的频道帖子的新版本,已被编辑。此更新有时可能由机器人不可用或未主动使用的消息字段的更改触发。 |
business_connection 业务连接 | BusinessConnection | Optional. The bot was connected to or disconnected from a business account, or a user edited an existing connection with the bot 可选。机器人已连接或断开与业务账户的连接,或用户编辑了与机器人的现有连接 |
business_message 业务消息 | Message 消息 | Optional. New message from a connected business account 可选。来自已连接业务账户的新消息 |
edited_business_message 编辑后的业务消息 | Message 消息 | Optional. New version of a message from a connected business account 可选。来自连接的业务账户的新版本消息 |
deleted_business_messages | BusinessMessagesDeleted | Optional. Messages were deleted from a connected business account 可选。来自连接的业务账户的消息已被删除 |
message_reaction 消息反应 | MessageReactionUpdated 消息反应更新 | Optional. A reaction to a message was changed by a user. The bot must be an administrator in the chat and must explicitly specify "message_reaction" in the list of allowed_updates to receive these updates. The update isn't received for reactions set by bots.可选。用户更改了对消息的反应。机器人必须是聊天中的管理员,并且必须在允许的更新列表中明确指定 "message_reaction" 才能接收这些更新。对于机器人设置的反应不会接收更新。 |
message_reaction_count 消息反应计数 | MessageReactionCountUpdated 消息反应计数更新 |
Optional. Reactions to a message with anonymous reactions were changed. The bot must be an administrator in the chat and must explicitly specify "message_reaction_count" in the list of allowed_updates to receive these updates. The updates are grouped and can be sent with delay up to a few minutes.可选。对带有匿名反应的消息的反应已更改。机器人必须是聊天中的管理员,并且必须在 allowed_updates 列表中明确指定 "message_reaction_count" 才能接收这些更新。更新是分组的,并且可能会延迟发送,最多几分钟。 |
inline_query 内联查询 | InlineQuery 内联查询 | Optional. New incoming inline query 可选。新的传入内联查询 |
chosen_inline_result 选择的内联结果 | ChosenInlineResult 选择的内联结果 | Optional. The result of an inline query that was chosen by a user and sent to their chat partner. Please see our documentation on the feedback collecting for details on how to enable these updates for your bot. 可选。用户选择并发送给聊天伙伴的内联查询结果。请查看我们的文档,了解如何为您的机器人启用这些更新的反馈收集详情。 |
callback_query 回调查询 | CallbackQuery 回调查询 | Optional. New incoming callback query 可选。新的传入回调查询 |
shipping_query 运输查询 | ShippingQuery 运输查询 | Optional. New incoming shipping query. Only for invoices with flexible price 可选。新的传入运输查询。仅适用于价格灵活的发票 |
pre_checkout_query | PreCheckoutQuery 预结账查询 | Optional. New incoming pre-checkout query. Contains full information about checkout 可选。新的传入预结账查询。包含关于结账的完整信息 |
purchased_paid_media 已购买付费媒体 | PaidMediaPurchased 已购买付费媒体 | Optional. A user purchased paid media with a non-empty payload sent by the bot in a non-channel chat 可选。用户在非频道聊天中购买了机器人发送的非空负载的付费媒体 |
poll 投票 | Poll 投票 | Optional. New poll state. Bots receive only updates about manually stopped polls and polls, which are sent by the bot 可选。新的投票状态。机器人仅接收关于手动停止的投票和由机器人发送的投票的更新 |
poll_answer 投票答案 | PollAnswer 投票答案 | Optional. A user changed their answer in a non-anonymous poll. Bots receive new votes only in polls that were sent by the bot itself. 可选。一个用户在非匿名投票中更改了他们的答案。机器人仅在由机器人本身发送的投票中接收到新投票。 |
my_chat_member 我的聊天成员 | ChatMemberUpdated 聊天成员更新 | Optional. 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. 可选。机器人在聊天中的成员状态已更新。对于私人聊天,仅当用户阻止或解除阻止机器人时才会收到此更新。 |
chat_member | ChatMemberUpdated 聊天成员更新 | Optional. 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 allowed_updates to receive these updates.可选。聊天成员在聊天中的状态已更新。机器人必须是聊天中的管理员,并且必须在允许的更新列表中明确指定 "chat_member" 才能接收这些更新。 |
chat_join_request 聊天加入请求 | ChatJoinRequest 聊天加入请求 | Optional. A request to join the chat has been sent. The bot must have the can_invite_users administrator right in the chat to receive these updates. 可选。已发送加入聊天的请求。机器人必须在聊天中拥有邀请用户的管理员权限才能接收这些更新。 |
chat_boost 聊天提升 | ChatBoostUpdated | Optional. A chat boost was added or changed. The bot must be an administrator in the chat to receive these updates. 可选。一个聊天提升被添加或更改。机器人必须是聊天中的管理员才能接收这些更新。 |
removed_chat_boost 移除聊天提升 | ChatBoostRemoved | Optional. A boost was removed from a chat. The bot must be an administrator in the chat to receive these updates. 可选。一个提升已从聊天中移除。机器人必须是聊天中的管理员才能接收这些更新。 |
Use this method to receive incoming updates using long polling (wiki). Returns an Array of Update objects.
使用此方法通过长轮询(wiki)接收传入更新。返回一个 Update 对象数组。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
offset 偏移量 | Integer 整数 | Optional 可选 | 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 getUpdates is called with an offset higher than its update_id. The negative offset can be specified to retrieve updates starting from -offset update from the end of the updates queue. All previous updates will be forgotten. 返回的第一个更新的标识符。必须比之前接收到的更新标识符中的最高值大 1。默认情况下,返回从最早的未确认更新开始的更新。只要 getUpdates 使用高于其 update_id 的偏移量调用,更新就被认为是已确认的。可以指定负偏移量,从更新队列末尾的-offset 更新开始检索。所有之前的更新将被遗忘。 |
limit 限制 | Integer 整数 | Optional 可选 | Limits the number of updates to be retrieved. Values between 1-100 are accepted. Defaults to 100. 限制要检索的更新数量。接受 1-100 之间的值。默认为 100。 |
timeout 超时 | Integer 整数 | Optional 可选 | 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. 长轮询的超时时间,单位为秒。默认值为 0,即通常的短轮询。应为正值,短轮询仅应用于测试目的。 |
allowed_updates 允许更新 | Array of String 字符串数组 | Optional 可选 | 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 Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member, message_reaction, and message_reaction_count (default). If not specified, the previous setting will be used.您希望您的机器人接收的更新类型的 JSON 序列化列表。例如,指定 ["message", "edited_channel_post", "callback_query"] 仅接收这些类型的更新。请参阅更新以获取可用更新类型的完整列表。指定一个空列表以接收除 chat_member、message_reaction 和 message_reaction_count(默认)之外的所有更新类型。如果未指定,将使用之前的设置。Please note that this parameter doesn't affect updates created before the call to getUpdates, so unwanted updates may be received for a short period of time. 请注意,此参数不会影响在调用 getUpdates 之前创建的更新,因此在短时间内可能会接收到不需要的更新。 |
Notes 笔记
1. This method will not work if an outgoing webhook is set up.
1. 如果设置了传出 webhook,此方法将不起作用。
2. In order to avoid getting duplicate updates, recalculate offset after each server response.
2. 为了避免收到重复更新,请在每次服务器响应后重新计算偏移量。
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 Update. In case of an unsuccessful request (a request with response HTTP status code different from 2XY
), we will repeat the request and give up after a reasonable amount of attempts. Returns True on success.
使用此方法指定一个 URL,并通过传出 webhook 接收传入更新。每当有针对机器人的更新时,我们将向指定的 URL 发送一个包含 JSON 序列化更新的 HTTPS POST 请求。如果请求不成功(响应的 HTTP 状态码与 2XY
不同),我们将重复请求,并在合理次数的尝试后放弃。成功时返回 True。
If you'd like to make sure that the webhook was set by you, you can specify secret data in the parameter secret_token. If specified, the request will contain a header “X-Telegram-Bot-Api-Secret-Token” with the secret token as content.
如果您想确保 webhook 是由您设置的,您可以在参数 secret_token 中指定秘密数据。如果指定了,请求将包含一个标头“X-Telegram-Bot-Api-Secret-Token”,其内容为秘密令牌。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
url | String 字符串 | Yes 是 | HTTPS URL to send updates to. Use an empty string to remove webhook integration 发送更新的 HTTPS URL。使用空字符串删除 Webhook 集成 |
certificate 证书 | InputFile 输入文件 | Optional 可选 | Upload your public key certificate so that the root certificate in use can be checked. See our self-signed guide for details. 上传您的公钥证书,以便检查使用的根证书。有关详细信息,请参阅我们的自签名指南。 |
ip_address | String 字符串 | Optional 可选 | The fixed IP address which will be used to send webhook requests instead of the IP address resolved through DNS 用于发送 webhook 请求的固定 IP 地址,而不是通过 DNS 解析的 IP 地址 |
max_connections 最大连接数 | Integer 整数 | Optional 可选 | The maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery, 1-100. Defaults to 40. Use lower values to limit the load on your bot's server, and higher values to increase your bot's throughput. 允许的最大同时 HTTPS 连接数,用于向 webhook 发送更新,范围为 1-100。默认值为 40。使用较低的值可以限制对机器人服务器的负载,使用较高的值可以增加机器人的吞吐量。 |
allowed_updates 允许更新 | Array of String 字符串数组 | Optional 可选 | 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 Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member, message_reaction, and message_reaction_count (default). If not specified, the previous setting will be used.您希望您的机器人接收的更新类型的 JSON 序列化列表。例如,指定 ["message", "edited_channel_post", "callback_query"] 仅接收这些类型的更新。请参阅更新以获取可用更新类型的完整列表。指定一个空列表以接收除 chat_member、message_reaction 和 message_reaction_count(默认)之外的所有更新类型。如果未指定,将使用之前的设置。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. 请注意,此参数不会影响在调用 setWebhook 之前创建的更新,因此在短时间内可能会收到不需要的更新。 |
drop_pending_updates | Boolean 布尔值 | Optional 可选 | Pass True to drop all pending updates 传递 True 以丢弃所有待处理的更新 |
secret_token 密钥令牌 | String 字符串 | Optional 可选 | A secret token to be sent in a header “X-Telegram-Bot-Api-Secret-Token” in every webhook request, 1-256 characters. Only characters A-Z , a-z , 0-9 , _ and - are allowed. The header is useful to ensure that the request comes from a webhook set by you.在每个 webhook 请求中发送的头部“X-Telegram-Bot-Api-Secret-Token”中的密钥令牌,长度为 1-256 个字符。仅允许字符 A-Z 、 a-z 、 0-9 、 _ 和 - 。该头部有助于确保请求来自您设置的 webhook。 |
Notes 笔记
1. You will not be able to receive updates using getUpdates for as long as an outgoing webhook is set up.
只要设置了传出 webhook,您将无法使用 getUpdates 接收更新。
2. To use a self-signed certificate, you need to upload your public key certificate using certificate parameter. Please upload as InputFile, sending a String will not work.
要使用自签名证书,您需要使用 certificate 参数上传您的公钥证书。请作为 InputFile 上传,发送字符串将不起作用。
3. Ports currently supported for webhooks: 443, 80, 88, 8443.
当前支持 webhook 的端口:443, 80, 88, 8443。If you're having any trouble setting up webhooks, please check out this amazing guide to webhooks.
如果您在设置 webhook 时遇到任何问题,请查看这个关于 webhook 的精彩指南。
Use this method to remove webhook integration if you decide to switch back to getUpdates. Returns True on success.
使用此方法删除 webhook 集成,如果您决定切换回 getUpdates。成功时返回 True。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
drop_pending_updates | Boolean 布尔值 | Optional 可选 | Pass True to drop all pending updates 传递 True 以丢弃所有待处理的更新 |
Use this method to get current webhook status. Requires no parameters. On success, returns a WebhookInfo object. If the bot is using getUpdates, will return an object with the url field empty.
使用此方法获取当前 webhook 状态。不需要参数。成功时,返回一个 WebhookInfo 对象。如果机器人使用 getUpdates,将返回一个 url 字段为空的对象。
Describes the current status of a webhook.
描述 Webhook 的当前状态。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
url | String 字符串 | Webhook URL, may be empty if webhook is not set up Webhook URL,如果未设置 Webhook 可能为空 |
has_custom_certificate 自定义证书 | Boolean 布尔值 | True, if a custom certificate was provided for webhook certificate checks 如果为 webhook 证书检查提供了自定义证书,则为 True |
pending_update_count | Integer 整数 | Number of updates awaiting delivery 等待发送的更新数量 |
ip_address | String 字符串 | Optional. Currently used webhook IP address 可选。当前使用的 Webhook IP 地址 |
last_error_date | Integer 整数 | Optional. Unix time for the most recent error that happened when trying to deliver an update via webhook 可选。尝试通过 Webhook 发送更新时最近发生的错误的 Unix 时间 |
last_error_message 最后错误消息 | String 字符串 | Optional. Error message in human-readable format for the most recent error that happened when trying to deliver an update via webhook 可选。尝试通过 webhook 发送更新时发生的最新错误的人类可读格式的错误消息 |
last_synchronization_error_date 最后同步错误日期 |
Integer 整数 | Optional. Unix time of the most recent error that happened when trying to synchronize available updates with Telegram datacenters 可选。与 Telegram 数据中心同步可用更新时发生的最新错误的 Unix 时间 |
max_connections 最大连接数 | Integer 整数 | Optional. The maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery 可选。允许的最大同时 HTTPS 连接数,用于向 webhook 发送更新 |
allowed_updates 允许更新 | Array of String 字符串数组 | Optional. A list of update types the bot is subscribed to. Defaults to all update types except chat_member 可选。机器人订阅的更新类型列表。默认订阅所有更新类型,除了 chat_member |
All types used in the Bot API responses are represented as JSON-objects.
Bot API 响应中使用的所有类型均表示为 JSON 对象。
It is safe to use 32-bit signed integers for storing all Integer fields unless otherwise noted.
除非另有说明,否则可以安全地使用 32 位有符号整数来存储所有整数字段。
Optional fields may be not returned when irrelevant.
当不相关时,可选字段可能不会返回。
This object represents a Telegram user or bot.
此对象代表一个 Telegram 用户或机器人。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
id | Integer 整数 | 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. 此用户或机器人的唯一标识符。此数字可能超过 32 位有效位,一些编程语言在解释时可能存在困难/无声缺陷。但它最多有 52 位有效位,因此 64 位整数或双精度浮点类型可以安全地存储此标识符。 |
is_bot 是机器人 | Boolean 布尔值 | True, if this user is a bot 如果此用户是机器人,则为真 |
first_name 名 | String 字符串 | User's or bot's first name 用户或机器人的名字 |
last_name 姓氏 | String 字符串 | Optional. User's or bot's last name 可选。用户或机器人的姓氏 |
username 用户名 | String 字符串 | Optional. User's or bot's username 可选。用户或机器人的用户名 |
language_code 语言代码 | String 字符串 | Optional. IETF language tag of the user's language 可选。用户语言的 IETF 语言标签 |
is_premium | True 真 | Optional. True, if this user is a Telegram Premium user 可选。如果此用户是 Telegram Premium 用户,则为真 |
added_to_attachment_menu | True 真 | Optional. True, if this user added the bot to the attachment menu 可选。如果用户将机器人添加到附件菜单中,则为真 |
can_join_groups 可以加入群组 | Boolean 布尔值 | Optional. True, if the bot can be invited to groups. Returned only in getMe. 可选。如果机器人可以被邀请加入群组,则为真。仅在 getMe 中返回 |
can_read_all_group_messages 可以读取所有群组消息 |
Boolean 布尔值 | Optional. True, if privacy mode is disabled for the bot. Returned only in getMe. 可选。如果机器人的隐私模式被禁用,则为 True。仅在 getMe 中返回。 |
supports_inline_queries 支持内联查询 | Boolean 布尔值 | Optional. True, if the bot supports inline queries. Returned only in getMe. 可选。如果机器人支持内联查询,则为 True。仅在 getMe 中返回。 |
can_connect_to_business 可以连接到商业账户 | Boolean 布尔值 | Optional. True, if the bot can be connected to a Telegram Business account to receive its messages. Returned only in getMe. 可选。如果机器人可以连接到 Telegram 商业账户以接收其消息,则为 True。仅在 getMe 中返回。 |
has_main_web_app | Boolean 布尔值 | Optional. True, if the bot has a main Web App. Returned only in getMe. 可选。如果机器人有一个主要的 Web 应用程序,则为 True。仅在 getMe 中返回。 |
This object represents a chat.
此对象代表一个聊天。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
id | Integer 整数 | 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. 此聊天的唯一标识符。此数字可能超过 32 位有效位,一些编程语言在解释时可能存在困难/静默缺陷。但它最多有 52 位有效位,因此使用有符号 64 位整数或双精度浮点类型来存储此标识符是安全的。 |
type 类型 | String 字符串 | Type of the chat, can be either “private”, “group”, “supergroup” or “channel” 聊天的类型,可以是“private”、“group”、“supergroup”或“channel” |
title 标题 | String 字符串 | Optional. Title, for supergroups, channels and group chats 可选。超级群组、频道和群聊的标题 |
username 用户名 | String 字符串 | Optional. Username, for private chats, supergroups and channels if available 可选。用户名,适用于私人聊天、超级群组和频道(如果可用) |
first_name 名 | String 字符串 | Optional. First name of the other party in a private chat 可选。私人聊天中对方的 firstname |
last_name 姓氏 | String 字符串 | Optional. Last name of the other party in a private chat 可选。私人聊天中对方的 lastname |
is_forum | True 真 | Optional. True, if the supergroup chat is a forum (has topics enabled) 可选。如果超级群聊是论坛(已启用主题),则为 True |
This object contains full information about a chat.
此对象包含关于聊天的完整信息。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
id | Integer 整数 | 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. 此聊天的唯一标识符。此数字可能超过 32 位有效位,一些编程语言在解释时可能存在困难/静默缺陷。但它最多有 52 位有效位,因此使用有符号 64 位整数或双精度浮点类型来存储此标识符是安全的。 |
type 类型 | String 字符串 | Type of the chat, can be either “private”, “group”, “supergroup” or “channel” 聊天的类型,可以是“private”、“group”、“supergroup”或“channel” |
title 标题 | String 字符串 | Optional. Title, for supergroups, channels and group chats 可选。超级群组、频道和群聊的标题 |
username 用户名 | String 字符串 | Optional. Username, for private chats, supergroups and channels if available 可选。用户名,适用于私人聊天、超级群组和频道(如果可用) |
first_name 名 | String 字符串 | Optional. First name of the other party in a private chat 可选。私人聊天中对方的 firstname |
last_name 姓氏 | String 字符串 | Optional. Last name of the other party in a private chat 可选。私人聊天中对方的 lastname |
is_forum | True 真 | Optional. True, if the supergroup chat is a forum (has topics enabled) 可选。如果超级群聊是论坛(已启用主题),则为 True |
accent_color_id | Integer 整数 | Identifier of the accent color for the chat name and backgrounds of the chat photo, reply header, and link preview. See accent colors for more details. 聊天名称和聊天照片、回复头部及链接预览背景的强调色标识符。有关更多详细信息,请参阅强调色。 |
max_reaction_count 最大反应数 | Integer 整数 | The maximum number of reactions that can be set on a message in the chat 在聊天中消息上可以设置的最大反应数量 |
photo 照片 | ChatPhoto 聊天照片 | Optional. Chat photo 可选。聊天照片 |
active_usernames 活跃用户名 | Array of String 字符串数组 | Optional. If non-empty, the list of all active chat usernames; for private chats, supergroups and channels 可选。如果非空,则为所有活跃聊天用户名的列表;适用于私人聊天、超级群组和频道 |
birthdate 出生日期 | Birthdate 出生日期 | Optional. For private chats, the date of birth of the user 可选。对于私人聊天,用户的出生日期 |
business_intro 业务介绍 | BusinessIntro 业务介绍 | Optional. For private chats with business accounts, the intro of the business 可选。对于与业务账户的私人聊天,业务的介绍 |
business_location 业务位置 | BusinessLocation 业务位置 | Optional. For private chats with business accounts, the location of the business 可选。对于与商务账户的私人聊天,商务位置 |
business_opening_hours | BusinessOpeningHours | Optional. For private chats with business accounts, the opening hours of the business 可选。对于与商务账户的私人聊天,商务营业时间 |
personal_chat | Chat 聊天 | Optional. For private chats, the personal channel of the user 可选。对于私人聊天,用户的个人频道 |
available_reactions | Array of ReactionType ReactionType 数组 | Optional. List of available reactions allowed in the chat. If omitted, then all emoji reactions are allowed. 可选。聊天中允许的可用反应列表。如果省略,则允许所有表情符号反应。 |
background_custom_emoji_id | String 字符串 | Optional. Custom emoji identifier of the emoji chosen by the chat for the reply header and link preview background 可选。聊天选择的用于回复头部和链接预览背景的自定义表情符号标识符 |
profile_accent_color_id | Integer 整数 | Optional. Identifier of the accent color for the chat's profile background. See profile accent colors for more details. 可选。聊天个人资料背景的高亮颜色标识符。请参阅个人资料高亮颜色以获取更多详情。 |
profile_background_custom_emoji_id | String 字符串 | Optional. Custom emoji identifier of the emoji chosen by the chat for its profile background 可选。聊天选择的用于其个人资料背景的自定义表情符号标识符 |
emoji_status_custom_emoji_id | String 字符串 | Optional. Custom emoji identifier of the emoji status of the chat or the other party in a private chat 可选。聊天或私人聊天中另一方的表情状态的自定义表情标识符 |
emoji_status_expiration_date | Integer 整数 | Optional. Expiration date of the emoji status of the chat or the other party in a private chat, in Unix time, if any 可选。聊天或私人聊天中另一方的表情状态的到期日期,如有,以 Unix 时间表示 |
bio 简介 | String 字符串 | Optional. Bio of the other party in a private chat 可选。私人聊天中对方的简介 |
has_private_forwards | True 真 | Optional. True, if privacy settings of the other party in the private chat allows to use tg://user?id=<user_id> links only in chats with the user可选。如果私人聊天中对方的隐私设置仅允许在与用户的聊天中使用 tg://user?id=<user_id> 链接,则为 True |
has_restricted_voice_and_video_messages | True 真 | Optional. True, if the privacy settings of the other party restrict sending voice and video note messages in the private chat 可选。如果私人聊天中对方的隐私设置限制发送语音和视频便笺消息,则为 True |
join_to_send_messages 加入以发送消息 | True 真 | Optional. True, if users need to join the supergroup before they can send messages 可选。如果用户需要加入超级群组后才能发送消息,则为 True |
join_by_request 通过请求加入 | True 真 | Optional. True, if all users directly joining the supergroup without using an invite link need to be approved by supergroup administrators 可选。如果所有直接加入超级群组而不使用邀请链接的用户需要超级群组管理员批准,则为 True |
description 描述 | String 字符串 | Optional. Description, for groups, supergroups and channel chats 可选。描述,用于群组、超级群组和频道聊天 |
invite_link 邀请链接 | String 字符串 | Optional. Primary invite link, for groups, supergroups and channel chats 可选。主要邀请链接,用于群组、超级群组和频道聊天 |
pinned_message 置顶消息 | Message 消息 | Optional. The most recent pinned message (by sending date) 可选。最近的置顶消息(按发送日期排序) |
permissions 权限 | ChatPermissions 聊天权限 | Optional. Default chat member permissions, for groups and supergroups 可选。默认的群组和超级群组成员权限 |
can_send_gift 可以发送礼物 | True 真 | Optional. True, if gifts can be sent to the chat 可选。如果可以向聊天发送礼物,则为 True |
can_send_paid_media 可以发送付费媒体 | True 真 | Optional. True, if paid media messages can be sent or forwarded to the channel chat. The field is available only for channel chats. 可选。如果可以向频道聊天发送或转发付费媒体消息,则为 True。此字段仅适用于频道聊天。 |
slow_mode_delay 慢速模式延迟 | Integer 整数 | Optional. For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user; in seconds 可选。对于超级群组,每个非特权用户发送连续消息之间的最短允许延迟;以秒为单位 |
unrestrict_boost_count 解除限制提升计数 | Integer 整数 | Optional. For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions 可选。对于超级群,非管理员用户需要添加的最低提升数量,以便忽略慢速模式和聊天权限 |
message_auto_delete_time | Integer 整数 | Optional. The time after which all messages sent to the chat will be automatically deleted; in seconds 可选。发送到聊天的所有消息将在该时间后自动删除;以秒为单位 |
has_aggressive_anti_spam_enabled | True 真 | Optional. True, if aggressive anti-spam checks are enabled in the supergroup. The field is only available to chat administrators. 可选。如果超级群中启用了强力反垃圾邮件检查,则为 True。该字段仅对聊天管理员可用。 |
has_hidden_members 有隐藏成员 | True 真 | Optional. True, if non-administrators can only get the list of bots and administrators in the chat 可选。如果非管理员只能获取聊天中的机器人和管理员列表,则为 True |
has_protected_content 有受保护的内容 | True 真 | Optional. True, if messages from the chat can't be forwarded to other chats 可选。如果聊天中的消息不能转发到其他聊天,则为 True |
has_visible_history 有可见历史记录 | True 真 | Optional. True, if new chat members will have access to old messages; available only to chat administrators 可选。如果新聊天成员可以访问旧消息,则为 True;仅限聊天管理员使用 |
sticker_set_name 贴纸集名称 | String 字符串 | Optional. For supergroups, name of the group sticker set 可选。对于超级群组,群组贴纸集的名称 |
can_set_sticker_set 可以设置贴纸集 | True 真 | Optional. True, if the bot can change the group sticker set 可选。如果机器人可以更改群组贴纸集,则为 True |
custom_emoji_sticker_set_name 自定义表情贴纸集名称 |
String 字符串 | Optional. For supergroups, the name of the group's custom emoji sticker set. Custom emoji from this set can be used by all users and bots in the group. 可选。对于超级群组,群组的自定义表情贴纸集名称。该集合中的自定义表情可被群组中的所有用户和机器人使用。 |
linked_chat_id 关联聊天 ID | Integer 整数 | Optional. 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. 可选。关联聊天的唯一标识符,即频道的讨论组标识符,反之亦然;适用于超级群组和频道聊天。此标识符可能大于 32 位,某些编程语言在解释时可能存在困难/静默缺陷。但它小于 52 位,因此使用有符号 64 位整数或双精度浮点类型存储此标识符是安全的。 |
location 位置 | ChatLocation 聊天位置 | Optional. For supergroups, the location to which the supergroup is connected 可选。对于超级群组,连接到的位置 |
This object represents a message.
此对象代表一条消息。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
message_id 消息 ID | Integer 整数 | Unique message identifier inside this chat. In specific instances (e.g., message containing a video sent to a big chat), the server might automatically schedule a message instead of sending it immediately. In such cases, this field will be 0 and the relevant message will be unusable until it is actually sent 在此聊天中唯一的消息标识符。在特定情况下(例如,向大聊天发送包含视频的消息),服务器可能会自动安排消息而不是立即发送。在这种情况下,此字段将为 0,并且相关消息在实际发送之前将无法使用 |
message_thread_id | Integer 整数 | Optional. Unique identifier of a message thread to which the message belongs; for supergroups only 可选。消息所属的消息线程的唯一标识符;仅适用于超级群组 |
from 来自 | User 用户 | Optional. Sender of the message; may be empty for messages sent to channels. For backward compatibility, if the message was sent on behalf of a chat, the field contains a fake sender user in non-channel chats 可选。消息的发送者;对于发送到频道的消息可能为空。为了向后兼容,如果消息是代表一个聊天发送的,该字段在非频道聊天中包含一个假的发送者用户 |
sender_chat 发送者聊天 | Chat 聊天 | Optional. Sender of the message when sent on behalf of a chat. For example, the supergroup itself for messages sent by its anonymous administrators or a linked channel for messages automatically forwarded to the channel's discussion group. For backward compatibility, if the message was sent on behalf of a chat, the field from contains a fake sender user in non-channel chats. 可选。代表聊天发送消息时的消息发送者。例如,超级群组本身对于由其匿名管理员发送的消息,或链接频道对于自动转发到频道讨论组的消息。为了向后兼容,如果消息是代表一个聊天发送的,来自字段在非频道聊天中包含一个假的发送者用户。 |
sender_boost_count 发送者提升次数 | Integer 整数 | Optional. If the sender of the message boosted the chat, the number of boosts added by the user 可选。如果消息发送者提升了聊天,用户添加的提升次数 |
sender_business_bot 发送者商业机器人 | User 用户 | Optional. The bot that actually sent the message on behalf of the business account. Available only for outgoing messages sent on behalf of the connected business account. 可选。代表商业账户实际发送消息的机器人。仅适用于代表连接的商业账户发送的外发消息。 |
date 日期 | Integer 整数 | Date the message was sent in Unix time. It is always a positive number, representing a valid date. 消息发送日期,Unix 时间格式。始终为正数,表示有效日期。 |
business_connection_id 业务连接 ID | String 字符串 | Optional. Unique identifier of the business connection from which the message was received. If non-empty, the message belongs to a chat of the corresponding business account that is independent from any potential bot chat which might share the same identifier. 可选。接收消息的业务连接的唯一标识符。如果非空,则消息属于相应业务账户的聊天,该聊天独立于可能共享相同标识符的任何潜在机器人聊天。 |
chat 聊天 | Chat 聊天 | Chat the message belongs to 消息所属的聊天 |
forward_origin 转发来源 | MessageOrigin 消息来源 | Optional. Information about the original message for forwarded messages 可选。转发消息的原始消息信息 |
is_topic_message 是主题消息 | True 真 | Optional. True, if the message is sent to a forum topic 可选。如果消息发送到论坛主题,则为 True |
is_automatic_forward 是自动转发 | True 真 | Optional. True, if the message is a channel post that was automatically forwarded to the connected discussion group 可选。如果消息是自动转发到关联讨论组的频道帖子,则为 True |
reply_to_message 回复的消息 | Message 消息 | Optional. For replies in the same chat and message thread, the original message. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply. 可选。对于同一聊天和消息线程中的回复,原始消息。请注意,此字段中的消息对象即使本身是回复,也不会包含进一步的 reply_to_message 字段。 |
external_reply 外部回复 | ExternalReplyInfo 外部回复信息 | Optional. Information about the message that is being replied to, which may come from another chat or forum topic 可选。有关正在回复的消息的信息,该消息可能来自另一个聊天或论坛主题 |
quote 引用 | TextQuote 文本引用 | Optional. For replies that quote part of the original message, the quoted part of the message 可选。对于引用原始消息部分的回复,消息的引用部分 |
reply_to_story 回复故事 | Story 故事 | Optional. For replies to a story, the original story 可选。对于回复故事的,原始故事 |
via_bot 通过机器人 | User 用户 | Optional. Bot through which the message was sent 可选。发送消息所通过的机器人 |
edit_date 编辑日期 | Integer 整数 | Optional. Date the message was last edited in Unix time 可选。消息最后编辑的日期,Unix 时间格式 |
has_protected_content | True 真 | Optional. True, if the message can't be forwarded 可选。如果消息不能被转发,则为 True |
is_from_offline | True 真 | Optional. True, if the message was sent by an implicit action, for example, as an away or a greeting business message, or as a scheduled message 可选。如果消息是由隐式操作发送的,例如作为离线或问候业务消息,或作为预定消息,则为 True |
media_group_id | String 字符串 | Optional. The unique identifier of a media message group this message belongs to 可选。此消息所属的媒体消息组的唯一标识符 |
author_signature 作者签名 | String 字符串 | Optional. Signature of the post author for messages in channels, or the custom title of an anonymous group administrator 可选。频道消息中帖子的作者签名,或匿名群组管理员的自定义标题 |
text 文本 | String 字符串 | Optional. For text messages, the actual UTF-8 text of the message 可选。对于文本消息,消息的实际 UTF-8 文本 |
entities 实体 | Array of MessageEntity MessageEntity 数组 | Optional. For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text 可选。对于文本消息,文本中出现的特殊实体,如用户名、URL、机器人命令等 |
link_preview_options | LinkPreviewOptions 链接预览选项 | Optional. Options used for link preview generation for the message, if it is a text message and link preview options were changed 可选。用于生成消息链接预览的选项,如果消息是文本消息且链接预览选项已更改 |
effect_id | String 字符串 | Optional. Unique identifier of the message effect added to the message 可选。添加到消息中的消息效果的唯一标识符 |
animation 动画 | Animation 动画 | Optional. Message is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set 可选。消息为动画,关于动画的信息。为了向后兼容,当此字段被设置时,文档字段也将被设置 |
audio 音频 | Audio 音频 | Optional. Message is an audio file, information about the file 可选。消息是音频文件,关于文件的信息 |
document 文档 | Document 文档 | Optional. Message is a general file, information about the file 可选。消息是一般文件,关于文件的信息 |
paid_media 付费媒体 | PaidMediaInfo 付费媒体信息 | Optional. Message contains paid media; information about the paid media 可选。消息包含付费媒体;关于付费媒体的信息 |
photo 照片 | Array of PhotoSize PhotoSize 数组 | Optional. Message is a photo, available sizes of the photo 可选。消息为照片,照片的可用尺寸 |
sticker 贴纸 | Sticker 贴纸 | Optional. Message is a sticker, information about the sticker 可选。消息为贴纸,关于贴纸的信息 |
story 故事 | Story 故事 | Optional. Message is a forwarded story 可选。消息是一个转发的故事 |
video 视频 | Video 视频 | Optional. Message is a video, information about the video 可选。消息是一个视频,关于视频的信息 |
video_note 视频便笺 | VideoNote 视频备注 | Optional. Message is a video note, information about the video message 可选。消息为视频便笺,关于视频消息的信息 |
voice 语音 | Voice 语音 | Optional. Message is a voice message, information about the file 可选。消息为语音消息,关于文件的信息 |
caption 标题 | String 字符串 | Optional. Caption for the animation, audio, document, paid media, photo, video or voice 可选。动画、音频、文档、付费媒体、照片、视频或语音的标题 |
caption_entities 标题实体 | Array of MessageEntity MessageEntity 数组 | Optional. For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption 可选。对于带有标题的消息,标题中出现的特殊实体,如用户名、URL、机器人命令等 |
show_caption_above_media 在媒体上方显示标题 |
True 真 | Optional. True, if the caption must be shown above the message media 可选。如果标题必须显示在消息媒体上方,则为 True |
has_media_spoiler | True 真 | Optional. True, if the message media is covered by a spoiler animation 可选。如果消息媒体被剧透动画覆盖,则为真 |
contact 联系人 | Contact 联系 | Optional. Message is a shared contact, information about the contact 可选。消息是一个共享联系人,关于联系人的信息 |
dice 骰子 | Dice 骰子 | Optional. Message is a dice with random value 可选。消息是一个带有随机值的骰子 |
game 游戏 | Game 游戏 | Optional. Message is a game, information about the game. More about games » 可选。消息是一个游戏,关于游戏的信息。更多关于游戏的信息 » |
poll 投票 | Poll 投票 | Optional. Message is a native poll, information about the poll 可选。消息是原生投票,关于投票的信息 |
venue 场所 | Venue 场所 | Optional. Message is a venue, information about the venue. For backward compatibility, when this field is set, the location field will also be set 可选。消息是一个地点,关于该地点的信息。为了向后兼容,当此字段被设置时,位置字段也将被设置 |
location 位置 | Location 位置 | Optional. Message is a shared location, information about the location 可选。消息是共享位置,关于位置的信息 |
new_chat_members | Array of User 用户数组 | Optional. New members that were added to the group or supergroup and information about them (the bot itself may be one of these members) 可选。新添加到群组或超级群组的成员及其信息(机器人本身可能是这些成员之一) |
left_chat_member | User 用户 | Optional. A member was removed from the group, information about them (this member may be the bot itself) 可选。一名成员被从群组中移除,关于他们的信息(该成员可能是机器人本身) |
new_chat_title | String 字符串 | Optional. A chat title was changed to this value 可选。聊天标题已更改为此值 |
new_chat_photo | Array of PhotoSize PhotoSize 数组 | Optional. A chat photo was change to this value 可选。聊天照片已更改为此值 |
delete_chat_photo 删除聊天照片 | True 真 | Optional. Service message: the chat photo was deleted 可选。服务消息:聊天照片已被删除 |
group_chat_created 群聊创建 | True 真 | Optional. Service message: the group has been created 可选。服务消息:群组已创建 |
supergroup_chat_created 超级群聊创建 | True 真 | Optional. 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. 可选。服务消息:超级群已创建。此字段无法在通过更新接收的消息中获取,因为机器人在超级群创建时无法成为其成员。只能在 reply_to_message 中找到,如果有人回复直接创建的超级群中的第一条消息。 |
channel_chat_created 频道聊天已创建 | True 真 | Optional. 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. 可选。服务消息:频道已创建。此字段无法在通过更新接收的消息中获取,因为机器人在频道创建时无法成为其成员。只能在 reply_to_message 中找到,如果有人回复频道中的第一条消息。 |
message_auto_delete_timer_changed 消息自动删除计时器已更改 |
MessageAutoDeleteTimerChanged 消息自动删除计时器更改 |
Optional. Service message: auto-delete timer settings changed in the chat 可选。服务消息:聊天中的自动删除计时器设置已更改 |
migrate_to_chat_id 迁移到聊天 ID | Integer 整数 | Optional. 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. 可选。该群组已迁移到具有指定标识符的超级群组。此数字可能超过 32 个有效位,一些编程语言在解释时可能存在困难/静默缺陷。但它最多有 52 个有效位,因此使用有符号 64 位整数或双精度浮点类型来存储此标识符是安全的。 |
migrate_from_chat_id 从聊天 ID 迁移 | Integer 整数 | Optional. 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. 可选。该超级群组已从具有指定标识符的群组迁移。此数字可能超过 32 个有效位,一些编程语言在解释时可能存在困难/静默缺陷。但它最多有 52 个有效位,因此使用有符号 64 位整数或双精度浮点类型来存储此标识符是安全的。 |
pinned_message 固定消息 | MaybeInaccessibleMessage 可能无法访问的消息 |
Optional. Specified message was pinned. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply. 可选。指定的消息已被置顶。请注意,此字段中的消息对象即使本身是回复,也不会包含进一步的 reply_to_message 字段。 |
invoice 发票 | Invoice 发票 | Optional. Message is an invoice for a payment, information about the invoice. More about payments » 可选。消息是支付发票,关于发票的信息。更多关于支付的信息 » |
successful_payment | SuccessfulPayment | Optional. Message is a service message about a successful payment, information about the payment. More about payments » 可选。消息是关于成功支付的服务消息,关于支付的信息。更多关于支付的信息 » |
refunded_payment | RefundedPayment 已退款支付 | Optional. Message is a service message about a refunded payment, information about the payment. More about payments » 可选。消息是关于已退款支付的服务消息,支付信息。更多关于支付的信息 » |
users_shared 用户共享 | UsersShared 用户共享 | Optional. Service message: users were shared with the bot 可选。服务消息:用户已与机器人共享 |
chat_shared 聊天共享 | ChatShared 聊天共享 | Optional. Service message: a chat was shared with the bot 可选。服务消息:聊天已与机器人共享 |
connected_website 已连接网站 | String 字符串 | Optional. The domain name of the website on which the user has logged in. More about Telegram Login » 可选。用户已登录的网站域名。了解更多关于 Telegram 登录的信息» |
write_access_allowed 允许写入访问 | WriteAccessAllowed 写入访问允许 | Optional. Service message: the user allowed the bot to write messages after adding it to the attachment or side menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method requestWriteAccess 可选。服务消息:用户在将机器人添加到附件或侧边菜单、从链接启动 Web App 或接受通过方法 requestWriteAccess 发送的 Web App 的明确请求后,允许机器人写入消息 |
passport_data 护照数据 | PassportData 护照数据 | Optional. Telegram Passport data 可选。Telegram 护照数据 |
proximity_alert_triggered 接近警报触发 |
ProximityAlertTriggered 接近警报触发 | Optional. Service message. A user in the chat triggered another user's proximity alert while sharing Live Location. 可选。服务消息。聊天中的用户在共享实时位置时触发了另一用户的接近警报。 |
boost_added 提升已添加 | ChatBoostAdded 聊天提升添加 | Optional. Service message: user boosted the chat 可选。服务消息:用户提升了聊天 |
chat_background_set 聊天背景已设置 | ChatBackground 聊天背景 | Optional. Service message: chat background set 可选。服务消息:聊天背景已设置 |
forum_topic_created 论坛主题已创建 | ForumTopicCreated 论坛话题创建 | Optional. Service message: forum topic created 可选。服务消息:论坛主题已创建 |
forum_topic_edited 论坛主题已编辑 | ForumTopicEdited 论坛话题编辑 | Optional. Service message: forum topic edited 可选。服务消息:论坛主题已编辑 |
forum_topic_closed 论坛主题已关闭 | ForumTopicClosed 论坛话题关闭 | Optional. Service message: forum topic closed 可选。服务消息:论坛主题已关闭 |
forum_topic_reopened 论坛主题重新开启 | ForumTopicReopened 论坛话题重新开启 | Optional. Service message: forum topic reopened 可选。服务消息:论坛主题重新开启 |
general_forum_topic_hidden 常规论坛主题隐藏 |
GeneralForumTopicHidden 一般论坛主题隐藏 | Optional. Service message: the 'General' forum topic hidden 可选。服务消息:'常规'论坛主题隐藏 |
general_forum_topic_unhidden 常规论坛主题取消隐藏 |
GeneralForumTopicUnhidden 一般论坛主题取消隐藏 |
Optional. Service message: the 'General' forum topic unhidden 可选。服务消息:'General'论坛主题已显示 |
giveaway_created 赠品创建 | GiveawayCreated 赠品创建 | Optional. Service message: a scheduled giveaway was created 可选。服务消息:已创建一个预定的赠品 |
giveaway 赠品 | Giveaway 赠品 | Optional. The message is a scheduled giveaway message 可选。该消息是一个预定的赠品消息 |
giveaway_winners 赠品获奖者 | GiveawayWinners 赠品获胜者 | Optional. A giveaway with public winners was completed 可选。已完成一个公开获奖者的赠品活动 |
giveaway_completed 赠品完成 | GiveawayCompleted 赠品完成 | Optional. Service message: a giveaway without public winners was completed 可选。服务消息:已完成无公开获奖者的赠品活动 |
video_chat_scheduled 视频聊天已安排 | VideoChatScheduled 视频聊天已安排 | Optional. Service message: video chat scheduled 可选。服务消息:视频聊天已安排 |
video_chat_started 视频聊天已开始 | VideoChatStarted 视频聊天已开始 | Optional. Service message: video chat started 可选。服务消息:视频聊天已开始 |
video_chat_ended 视频聊天结束 | VideoChatEnded 视频聊天已结束 | Optional. Service message: video chat ended 可选。服务消息:视频聊天结束 |
video_chat_participants_invited 视频聊天参与者被邀请 |
VideoChatParticipantsInvited 视频聊天参与者已邀请 |
Optional. Service message: new participants invited to a video chat 可选。服务消息:新参与者被邀请加入视频聊天 |
web_app_data 网页应用数据 | WebAppData 网页应用数据 | Optional. Service message: data sent by a Web App 可选。服务消息:Web App 发送的数据 |
reply_markup | InlineKeyboardMarkup 内联键盘标记 | Optional. Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons.可选。附加到消息的内联键盘。 login_url 按钮被表示为普通的 url 按钮。 |
This object represents a unique message identifier.
此对象代表一个唯一的消息标识符。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
message_id 消息 ID | Integer 整数 | Unique message identifier. In specific instances (e.g., message containing a video sent to a big chat), the server might automatically schedule a message instead of sending it immediately. In such cases, this field will be 0 and the relevant message will be unusable until it is actually sent 唯一消息标识符。在特定情况下(例如,包含视频的消息发送到大群聊),服务器可能会自动安排消息而不是立即发送。在这种情况下,此字段将为 0,并且相关消息在实际发送之前将无法使用。 |
This object describes a message that was deleted or is otherwise inaccessible to the bot.
此对象描述了一条已被删除或机器人无法访问的消息。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
chat 聊天 | Chat 聊天 | Chat the message belonged to 消息所属的聊天 |
message_id 消息 ID | Integer 整数 | Unique message identifier inside the chat 聊天内的唯一消息标识符 |
date 日期 | Integer 整数 | Always 0. The field can be used to differentiate regular and inaccessible messages. 始终为 0。该字段可用于区分常规和无法访问的消息。 |
This object describes a message that can be inaccessible to the bot. It can be one of
此对象描述了一条可能对机器人无法访问的消息。它可以是以下之一
This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc.
此对象代表文本消息中的一个特殊实体。例如,标签、用户名、URL 等。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | String 字符串 | Type of the entity. Currently, can be “mention” (@username ), “hashtag” (#hashtag or #hashtag@chatusername ), “cashtag” ($USD or $USD@chatusername ), “bot_command” (/start@jobs_bot ), “url” (https://telegram.org ), “email” (do-not-reply@telegram.org ), “phone_number” (+1-212-555-0123 ), “bold” (bold text), “italic” (italic text), “underline” (underlined text), “strikethrough” (strikethrough text), “spoiler” (spoiler message), “blockquote” (block quotation), “expandable_blockquote” (collapsed-by-default block quotation), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users without usernames), “custom_emoji” (for inline custom emoji stickers)实体类型。目前可以是“提及”( @username )、“标签”( #hashtag 或 #hashtag@chatusername )、“股票标签”( $USD 或 $USD@chatusername )、“机器人命令”( /start@jobs_bot )、“网址”( https://telegram.org )、“电子邮件”( do-not-reply@telegram.org )、“电话号码”( +1-212-555-0123 )、“粗体”(粗体文本)、“斜体”(斜体文本)、“下划线”(带下划线的文本)、“删除线”(带删除线的文本)、“剧透”(剧透信息)、“引用块”(块引用)、“可展开引用块”(默认折叠的块引用)、“代码”(等宽字符串)、“预格式化文本”(等宽块)、“文本链接”(用于可点击的文本 URL)、“文本提及”(用于没有用户名的用户)、“自定义表情符号”(用于内联自定义表情符号贴纸) |
offset 偏移量 | Integer 整数 | Offset in UTF-16 code units to the start of the entity 以 UTF-16 代码单元为单位,到实体开始的偏移量 |
length 长度 | Integer 整数 | Length of the entity in UTF-16 code units 以 UTF-16 代码单元为单位的实体长度 |
url | String 字符串 | Optional. For “text_link” only, URL that will be opened after user taps on the text 可选。对于“文本链接”而言,用户点击文本后将打开的 URL |
user 用户 | User 用户 | Optional. For “text_mention” only, the mentioned user 可选。对于“文本提及”而言,被提及的用户 |
language 语言 | String 字符串 | Optional. For “pre” only, the programming language of the entity text 可选。仅适用于“pre”,实体文本的编程语言 |
custom_emoji_id | String 字符串 | Optional. For “custom_emoji” only, unique identifier of the custom emoji. Use getCustomEmojiStickers to get full information about the sticker 可选。仅适用于“custom_emoji”,自定义表情符号的唯一标识符。使用 getCustomEmojiStickers 获取关于贴纸的完整信息 |
This object contains information about the quoted part of a message that is replied to by the given message.
此对象包含有关被回复消息所引用的消息部分的信息。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
text 文本 | String 字符串 | Text of the quoted part of a message that is replied to by the given message 被回复消息所引用的消息部分的文本 |
entities 实体 | Array of MessageEntity MessageEntity 数组 | Optional. Special entities that appear in the quote. Currently, only bold, italic, underline, strikethrough, spoiler, and custom_emoji entities are kept in quotes. 可选。引用中出现的特殊实体。目前,仅保留粗体、斜体、下划线、删除线、剧透和自定义表情符号实体在引用中。 |
position 位置 | Integer 整数 | Approximate quote position in the original message in UTF-16 code units as specified by the sender 引用在原始消息中的大致位置,以发送者指定的 UTF-16 代码单元表示 |
is_manual 是手动的 | True 真 | Optional. True, if the quote was chosen manually by the message sender. Otherwise, the quote was added automatically by the server. 可选。如果引用是由消息发送者手动选择的,则为 True。否则,引用是由服务器自动添加的。 |
This object contains information about a message that is being replied to, which may come from another chat or forum topic.
此对象包含有关被回复消息的信息,该消息可能来自另一个聊天或论坛主题。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
origin 来源 | MessageOrigin 消息来源 | Origin of the message replied to by the given message 被回复消息的来源 |
chat 聊天 | Chat 聊天 | Optional. Chat the original message belongs to. Available only if the chat is a supergroup or a channel. 可选。原始消息所属的聊天。仅当聊天是超级群组或频道时可用。 |
message_id | Integer 整数 | Optional. Unique message identifier inside the original chat. Available only if the original chat is a supergroup or a channel. 可选。原始聊天内的唯一消息标识符。仅当原始聊天是超级群组或频道时可用。 |
link_preview_options | LinkPreviewOptions | Optional. Options used for link preview generation for the original message, if it is a text message 可选。用于生成原始消息链接预览的选项,如果它是文本消息 |
animation 动画 | Animation 动画 | Optional. Message is an animation, information about the animation 可选。消息是动画,关于动画的信息 |
audio 音频 | Audio 音频 | Optional. Message is an audio file, information about the file 可选。消息是音频文件,关于文件的信息 |
document 文档 | Document 文档 | Optional. Message is a general file, information about the file 可选。消息是一般文件,关于文件的信息 |
paid_media 付费媒体 | PaidMediaInfo 付费媒体信息 | Optional. Message contains paid media; information about the paid media 可选。消息包含付费媒体;关于付费媒体的信息 |
photo 照片 | Array of PhotoSize PhotoSize 数组 | Optional. Message is a photo, available sizes of the photo 可选。消息为照片,照片的可用尺寸 |
sticker 贴纸 | Sticker 贴纸 | Optional. Message is a sticker, information about the sticker 可选。消息为贴纸,关于贴纸的信息 |
story 故事 | Story 故事 | Optional. Message is a forwarded story 可选。消息是一个转发的故事 |
video 视频 | Video 视频 | Optional. Message is a video, information about the video 可选。消息是一个视频,关于视频的信息 |
video_note 视频便笺 | VideoNote 视频备注 | Optional. Message is a video note, information about the video message 可选。消息为视频便笺,关于视频消息的信息 |
voice 语音 | Voice 语音 | Optional. Message is a voice message, information about the file 可选。消息为语音消息,关于文件的信息 |
has_media_spoiler | True 真 | Optional. True, if the message media is covered by a spoiler animation 可选。如果消息媒体被剧透动画覆盖,则为真 |
contact 联系人 | Contact 联系 | Optional. Message is a shared contact, information about the contact 可选。消息是一个共享联系人,关于联系人的信息 |
dice 骰子 | Dice 骰子 | Optional. Message is a dice with random value 可选。消息是一个带有随机值的骰子 |
game 游戏 | Game 游戏 | Optional. Message is a game, information about the game. More about games » 可选。消息是一个游戏,关于游戏的信息。更多关于游戏的信息 » |
giveaway 赠品 | Giveaway 赠品 | Optional. Message is a scheduled giveaway, information about the giveaway 可选。消息是一个预定的赠品,关于赠品的信息 |
giveaway_winners 赠品获奖者 | GiveawayWinners 赠品获奖者 | Optional. A giveaway with public winners was completed 可选。已完成一个公开获奖者的赠品活动 |
invoice 发票 | Invoice 发票 | Optional. Message is an invoice for a payment, information about the invoice. More about payments » 可选。消息是支付发票,关于发票的信息。更多关于支付的信息 » |
location 位置 | Location 位置 | Optional. Message is a shared location, information about the location 可选。消息是共享位置,关于位置的信息 |
poll 投票 | Poll 投票 | Optional. Message is a native poll, information about the poll 可选。消息是原生投票,关于投票的信息 |
venue 场所 | Venue 场地 | Optional. Message is a venue, information about the venue 可选。消息是一个场地,关于场地的信息 |
Describes reply parameters for the message that is being sent.
描述正在发送的消息的回复参数。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
message_id 消息 ID | Integer 整数 | Identifier of the message that will be replied to in the current chat, or in the chat chat_id if it is specified 将在当前聊天中回复的消息的标识符,或者如果指定了 chat_id,则在 chat_id 的聊天中回复 |
chat_id | Integer or String 整数或字符串 | Optional. If the message to be replied to is from a different chat, unique identifier for the chat or username of the channel (in the format @channelusername ). Not supported for messages sent on behalf of a business account.可选。如果要回复的消息来自不同的聊天,则为聊天的唯一标识符或频道的用户名(格式为 @channelusername )。不支持代表商业账户发送的消息。 |
allow_sending_without_reply | Boolean 布尔值 | Optional. Pass True if the message should be sent even if the specified message to be replied to is not found. Always False for replies in another chat or forum topic. Always True for messages sent on behalf of a business account. 可选。如果指定的回复消息未找到时仍发送消息,则传入 True。对于在其他聊天或论坛主题中的回复始终为 False。对于代表商业账户发送的消息始终为 True。 |
quote 引用 | String 字符串 | Optional. Quoted part of the message to be replied to; 0-1024 characters after entities parsing. The quote must be an exact substring of the message to be replied to, including bold, italic, underline, strikethrough, spoiler, and custom_emoji entities. The message will fail to send if the quote isn't found in the original message. 可选。被回复消息的引用部分;实体解析后为 0-1024 个字符。引用必须是所回复消息的精确子字符串,包括粗体、斜体、下划线、删除线、剧透和自定义表情符号实体。如果在原始消息中未找到引用,则消息发送将失败。 |
quote_parse_mode 引用解析模式 | String 字符串 | Optional. Mode for parsing entities in the quote. See formatting options for more details. 可选。解析引用中实体的模式。有关更多详细信息,请参阅格式化选项。 |
quote_entities 引用实体 | Array of MessageEntity MessageEntity 数组 | Optional. A JSON-serialized list of special entities that appear in the quote. It can be specified instead of quote_parse_mode. 可选。引用中出现的特殊实体的 JSON 序列化列表。可以替代 quote_parse_mode 指定。 |
quote_position 引用位置 | Integer 整数 | Optional. Position of the quote in the original message in UTF-16 code units 可选。引用在原始消息中的位置,以 UTF-16 代码单元表示 |
This object describes the origin of a message. It can be one of
此对象描述消息的来源。它可以是以下之一
The message was originally sent by a known user.
消息最初由已知用户发送。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | String 字符串 | Type of the message origin, always “user” 消息来源类型,始终为“user” |
date 日期 | Integer 整数 | Date the message was sent originally in Unix time 消息最初发送的 Unix 时间 |
sender_user 发送者用户 | User 用户 | User that sent the message originally 最初发送消息的用户 |
The message was originally sent by an unknown user.
该消息最初由未知用户发送。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | String 字符串 | Type of the message origin, always “hidden_user” 消息来源类型,始终为“hidden_user” |
date 日期 | Integer 整数 | Date the message was sent originally in Unix time 消息最初发送的日期,Unix 时间格式 |
sender_user_name 发送者用户名 | String 字符串 | Name of the user that sent the message originally 发送消息的用户的名称 |
The message was originally sent on behalf of a chat to a group chat.
消息最初代表一个聊天发送到群聊。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | String 字符串 | Type of the message origin, always “chat” 消息来源类型,始终为“聊天” |
date 日期 | Integer 整数 | Date the message was sent originally in Unix time 消息最初发送的日期(Unix 时间) |
sender_chat 发送者聊天 | Chat 聊天 | Chat that sent the message originally 最初发送消息的聊天 |
author_signature 作者签名 | String 字符串 | Optional. For messages originally sent by an anonymous chat administrator, original message author signature 可选。对于最初由匿名聊天管理员发送的消息,原始消息作者签名 |
The message was originally sent to a channel chat.
消息最初发送到频道聊天。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | String 字符串 | Type of the message origin, always “channel” 消息来源类型,始终为“频道” |
date 日期 | Integer 整数 | Date the message was sent originally in Unix time 消息最初发送的日期,Unix 时间 |
chat 聊天 | Chat 聊天 | Channel chat to which the message was originally sent 消息最初发送到的频道聊天 |
message_id 消息 ID | Integer 整数 | Unique message identifier inside the chat 聊天内唯一的消息标识符 |
author_signature 作者签名 | String 字符串 | Optional. Signature of the original post author 可选。原始帖子作者的签名 |
This object represents one size of a photo or a file / sticker thumbnail.
此对象代表照片或文件/贴纸缩略图的一种尺寸。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
file_id | String 字符串 | Identifier for this file, which can be used to download or reuse the file 此文件的标识符,可用于下载或重用该文件 |
file_unique_id | String 字符串 | 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. 此文件的唯一标识符,应随时间和不同机器人保持相同。不能用于下载或重新使用文件。 |
width 宽度 | Integer 整数 | Photo width 照片宽度 |
height 高度 | Integer 整数 | Photo height 照片高度 |
file_size | Integer 整数 | Optional. File size in bytes 可选。文件大小(以字节为单位) |
This object represents an animation file (GIF or H.264/MPEG-4 AVC video without sound).
此对象代表一个动画文件(GIF 或无声的 H.264/MPEG-4 AVC 视频)。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
file_id | String 字符串 | Identifier for this file, which can be used to download or reuse the file 此文件的标识符,可用于下载或重用该文件 |
file_unique_id | String 字符串 | 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. 此文件的唯一标识符,应随时间和不同机器人保持相同。不能用于下载或重新使用文件。 |
width 宽度 | Integer 整数 | Video width as defined by the sender 发送者定义的视频宽度 |
height 高度 | Integer 整数 | Video height as defined by the sender 发送者定义的视频高度 |
duration 持续时间 | Integer 整数 | Duration of the video in seconds as defined by the sender 发送者定义的视频持续时间(以秒为单位) |
thumbnail 缩略图 | PhotoSize 照片尺寸 | Optional. Animation thumbnail as defined by the sender 可选。发送者定义的动画缩略图 |
file_name 文件名 | String 字符串 | Optional. Original animation filename as defined by the sender 可选。发送者定义的原始动画文件名 |
mime_type MIME 类型 | String 字符串 | Optional. MIME type of the file as defined by the sender 可选。文件的 MIME 类型,由发送者定义 |
file_size | Integer 整数 | Optional. 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. 可选。文件大小,单位为字节。可以大于 2^31,一些编程语言在解释时可能存在困难/静默缺陷。但它最多有 52 个有效位,因此使用有符号 64 位整数或双精度浮点类型存储此值是安全的。 |
This object represents an audio file to be treated as music by the Telegram clients.
此对象表示一个音频文件,将被 Telegram 客户端视为音乐。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
file_id | String 字符串 | Identifier for this file, which can be used to download or reuse the file 此文件的标识符,可用于下载或重用该文件 |
file_unique_id | String 字符串 | 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. 此文件的唯一标识符,应随时间和不同机器人保持相同。不能用于下载或重新使用文件。 |
duration 持续时间 | Integer 整数 | Duration of the audio in seconds as defined by the sender 音频时长(秒),由发送者定义 |
performer 执行者 | String 字符串 | Optional. Performer of the audio as defined by the sender or by audio tags 可选。由发送者或音频标签定义的音频表演者。 |
title 标题 | String 字符串 | Optional. Title of the audio as defined by the sender or by audio tags 可选。由发送者或音频标签定义的音频标题。 |
file_name 文件名 | String 字符串 | Optional. Original filename as defined by the sender 可选。发送者定义的原始文件名 |
mime_type MIME 类型 | String 字符串 | Optional. MIME type of the file as defined by the sender 可选。文件的 MIME 类型,由发送者定义 |
file_size | Integer 整数 | Optional. 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. 可选。文件大小,单位为字节。可以大于 2^31,一些编程语言在解释时可能存在困难/静默缺陷。但它最多有 52 个有效位,因此使用有符号 64 位整数或双精度浮点类型存储此值是安全的。 |
thumbnail 缩略图 | PhotoSize 照片尺寸 | Optional. Thumbnail of the album cover to which the music file belongs 可选。音乐文件所属专辑封面的缩略图 |
This object represents a general file (as opposed to photos, voice messages and audio files).
此对象表示一个通用文件(与照片、语音消息和音频文件相对)。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
file_id | String 字符串 | Identifier for this file, which can be used to download or reuse the file 此文件的标识符,可用于下载或重用该文件 |
file_unique_id | String 字符串 | 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. 此文件的唯一标识符,应随时间和不同机器人保持相同。不能用于下载或重新使用文件。 |
thumbnail 缩略图 | PhotoSize 照片尺寸 | Optional. Document thumbnail as defined by the sender 可选。由发送者定义的文档缩略图 |
file_name 文件名 | String 字符串 | Optional. Original filename as defined by the sender 可选。发送者定义的原始文件名 |
mime_type MIME 类型 | String 字符串 | Optional. MIME type of the file as defined by the sender 可选。文件的 MIME 类型,由发送者定义 |
file_size | Integer 整数 | Optional. 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. 可选。文件大小,单位为字节。可以大于 2^31,一些编程语言在解释时可能存在困难/静默缺陷。但它最多有 52 个有效位,因此使用有符号 64 位整数或双精度浮点类型存储此值是安全的。 |
This object represents a story.
这个对象代表一个故事。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
chat 聊天 | Chat 聊天 | Chat that posted the story 发布故事的聊天 |
id | Integer 整数 | Unique identifier for the story in the chat 聊天中故事的唯一标识符 |
This object represents a video file.
这个对象代表一个视频文件。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
file_id | String 字符串 | Identifier for this file, which can be used to download or reuse the file 此文件的标识符,可用于下载或重用该文件 |
file_unique_id | String 字符串 | 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. 此文件的唯一标识符,应随时间和不同机器人保持相同。不能用于下载或重新使用文件。 |
width 宽度 | Integer 整数 | Video width as defined by the sender 发送者定义的视频宽度 |
height 高度 | Integer 整数 | Video height as defined by the sender 发送者定义的视频高度 |
duration 持续时间 | Integer 整数 | Duration of the video in seconds as defined by the sender 发送者定义的视频持续时间(以秒为单位) |
thumbnail 缩略图 | PhotoSize 照片尺寸 | Optional. Video thumbnail 可选。视频缩略图 |
cover 封面 | Array of PhotoSize PhotoSize 数组 | Optional. Available sizes of the cover of the video in the message 可选。消息中视频封面的可用尺寸 |
start_timestamp | Integer 整数 | Optional. Timestamp in seconds from which the video will play in the message 可选。消息中视频播放的起始时间戳(秒) |
file_name 文件名 | String 字符串 | Optional. Original filename as defined by the sender 可选。发送者定义的原始文件名 |
mime_type MIME 类型 | String 字符串 | Optional. MIME type of the file as defined by the sender 可选。文件的 MIME 类型,由发送者定义 |
file_size | Integer 整数 | Optional. 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. 可选。文件大小,单位为字节。可以大于 2^31,一些编程语言在解释时可能存在困难/静默缺陷。但它最多有 52 个有效位,因此使用有符号 64 位整数或双精度浮点类型存储此值是安全的。 |
This object represents a video message (available in Telegram apps as of v.4.0).
此对象代表一个视频消息(在 v.4.0 版本的 Telegram 应用中可用)。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
file_id | String 字符串 | Identifier for this file, which can be used to download or reuse the file 此文件的标识符,可用于下载或重用该文件 |
file_unique_id | String 字符串 | 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. 此文件的唯一标识符,应随时间和不同机器人保持相同。不能用于下载或重新使用文件。 |
length 长度 | Integer 整数 | Video width and height (diameter of the video message) as defined by the sender 视频宽度和高度(视频消息的直径),由发送者定义 |
duration 持续时间 | Integer 整数 | Duration of the video in seconds as defined by the sender 发送者定义的视频持续时间(以秒为单位) |
thumbnail 缩略图 | PhotoSize 照片尺寸 | Optional. Video thumbnail 可选。视频缩略图 |
file_size | Integer 整数 | Optional. File size in bytes 可选。文件大小(以字节为单位) |
This object represents a voice note.
这个对象代表一个语音便笺。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
file_id | String 字符串 | Identifier for this file, which can be used to download or reuse the file 此文件的标识符,可用于下载或重用该文件 |
file_unique_id | String 字符串 | 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. 此文件的唯一标识符,应随时间和不同机器人保持相同。不能用于下载或重新使用文件。 |
duration 持续时间 | Integer 整数 | Duration of the audio in seconds as defined by the sender 音频时长(秒),由发送者定义 |
mime_type MIME 类型 | String 字符串 | Optional. MIME type of the file as defined by the sender 可选。文件的 MIME 类型,由发送者定义 |
file_size | Integer 整数 | Optional. 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. 可选。文件大小,单位为字节。可以大于 2^31,一些编程语言在解释时可能存在困难/静默缺陷。但它最多有 52 个有效位,因此使用有符号 64 位整数或双精度浮点类型存储此值是安全的。 |
Describes the paid media added to a message.
描述添加到消息中的付费媒体。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
star_count 星星数量 | Integer 整数 | The number of Telegram Stars that must be paid to buy access to the media 购买媒体访问权所需支付的 Telegram 星星数量 |
paid_media 付费媒体 | Array of PaidMedia PaidMedia 数组 | Information about the paid media 关于付费媒体的信息 |
This object describes paid media. Currently, it can be one of
此对象描述付费媒体。目前,它可以是以下之一
The paid media isn't available before the payment.
付费媒体在付款前不可用。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | String 字符串 | Type of the paid media, always “preview” 付费媒体的类型,始终为“预览” |
width 宽度 | Integer 整数 | Optional. Media width as defined by the sender 可选。发送者定义的媒体宽度 |
height 高度 | Integer 整数 | Optional. Media height as defined by the sender 可选。发送者定义的媒体高度 |
duration 持续时间 | Integer 整数 | Optional. Duration of the media in seconds as defined by the sender 可选。发送者定义的媒体时长,单位为秒 |
The paid media is a photo.
付费媒体是一张照片。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | String 字符串 | Type of the paid media, always “photo” 付费媒体的类型,始终为“photo” |
photo 照片 | Array of PhotoSize PhotoSize 数组 | The photo 照片 |
The paid media is a video.
付费媒体是视频。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | String 字符串 | Type of the paid media, always “video” 付费媒体的类型,始终为“视频” |
video 视频 | Video 视频 | The video 视频 |
This object represents a phone contact.
此对象代表一个电话联系人。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
phone_number 电话号码 | String 字符串 | Contact's phone number 联系人的电话号码 |
first_name 名 | String 字符串 | Contact's first name 联系人的名字 |
last_name 姓氏 | String 字符串 | Optional. Contact's last name 可选。联系人的姓氏 |
user_id 用户 ID | Integer 整数 | Optional. 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. 可选。联系人在 Telegram 中的用户标识符。此数字可能超过 32 位有效位,一些编程语言在解释时可能存在困难/静默缺陷。但它最多有 52 位有效位,因此 64 位整数或双精度浮点类型可安全存储此标识符。 |
vcard | String 字符串 | Optional. Additional data about the contact in the form of a vCard 可选。以 vCard 形式提供的联系人附加数据 |
This object represents an animated emoji that displays a random value.
此对象表示一个显示随机值的动画表情符号。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
emoji 表情符号 | String 字符串 | Emoji on which the dice throw animation is based 基于骰子投掷动画的表情符号 |
value 值 | Integer 整数 | Value of the dice, 1-6 for “![]() ![]() ![]() ![]() ![]() ![]() 骰子的值,对于“ ![]() ![]() ![]() ![]() ![]() ![]() |
This object contains information about one answer option in a poll.
此对象包含投票中一个答案选项的信息。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
text 文本 | String 字符串 | Option text, 1-100 characters 选项文本,1-100 个字符 |
text_entities 文本实体 | Array of MessageEntity MessageEntity 数组 | Optional. Special entities that appear in the option text. Currently, only custom emoji entities are allowed in poll option texts 可选。选项文本中出现的特殊实体。目前,投票选项文本中只允许自定义表情符号实体。 |
voter_count 投票人数 | Integer 整数 | Number of users that voted for this option 选择此选项的用户数量 |
This object contains information about one answer option in a poll to be sent.
此对象包含要发送的投票中一个答案选项的信息。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
text 文本 | String 字符串 | Option text, 1-100 characters 选项文本,1-100 个字符 |
text_parse_mode 文本解析模式 | String 字符串 | Optional. Mode for parsing entities in the text. See formatting options for more details. Currently, only custom emoji entities are allowed 可选。用于解析文本中实体的模式。请参阅格式化选项以获取更多详情。目前,仅允许自定义表情符号实体。 |
text_entities 文本实体 | Array of MessageEntity MessageEntity 数组 | Optional. A JSON-serialized list of special entities that appear in the poll option text. It can be specified instead of text_parse_mode 可选。一个包含在投票选项文本中出现的特殊实体的 JSON 序列化列表。可以替代 text_parse_mode 指定 |
This object represents an answer of a user in a non-anonymous poll.
此对象代表用户在非匿名投票中的答案。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
poll_id 投票 ID | String 字符串 | Unique poll identifier 唯一的投票标识符 |
voter_chat 投票者聊天 | Chat 聊天 | Optional. The chat that changed the answer to the poll, if the voter is anonymous 可选。如果投票者是匿名的,更改投票答案的聊天 |
user 用户 | User 用户 | Optional. The user that changed the answer to the poll, if the voter isn't anonymous 可选。如果投票者不是匿名的,更改投票答案的用户 |
option_ids 选项 ID | Array of Integer 整数数组 | 0-based identifiers of chosen answer options. May be empty if the vote was retracted. 所选答案选项的 0 基标识符。如果投票被撤回,可能是空的。 |
This object contains information about a poll.
此对象包含有关投票的信息。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
id | String 字符串 | Unique poll identifier 唯一投票标识符 |
question 问题 | String 字符串 | Poll question, 1-300 characters 投票问题,1-300 个字符 |
question_entities | Array of MessageEntity MessageEntity 数组 | Optional. Special entities that appear in the question. Currently, only custom emoji entities are allowed in poll questions 可选。出现在问题中的特殊实体。目前,投票问题中只允许使用自定义表情符号实体 |
options 选项 | Array of PollOption PollOption 数组 | List of poll options 投票选项列表 |
total_voter_count 总投票人数 | Integer 整数 | Total number of users that voted in the poll 投票中总共投票的用户数量 |
is_closed | Boolean 布尔值 | True, if the poll is closed 如果投票已关闭,则为 True |
is_anonymous | Boolean 布尔值 | True, if the poll is anonymous 如果投票是匿名的,则为 True |
type 类型 | String 字符串 | Poll type, currently can be “regular” or “quiz” 投票类型,目前可以是“常规”或“测验” |
allows_multiple_answers | Boolean 布尔值 | True, if the poll allows multiple answers 如果投票允许选择多个答案,则为 True |
correct_option_id | Integer 整数 | Optional. 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. 可选。正确答案选项的 0 基标识符。仅适用于测验模式的投票,这些投票已关闭,或者由机器人发送(未转发)或发送到与机器人的私人聊天中。 |
explanation 解释 | String 字符串 | Optional. 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 可选。当用户在测验风格的投票中选择错误答案或点击灯泡图标时显示的文本,0-200 个字符 |
explanation_entities 解释实体 | Array of MessageEntity MessageEntity 数组 | Optional. Special entities like usernames, URLs, bot commands, etc. that appear in the explanation 可选。在解释中出现的特殊实体,如用户名、URL、机器人命令等 |
open_period 开放期限 | Integer 整数 | Optional. Amount of time in seconds the poll will be active after creation 可选。投票创建后活动的时间(秒) |
close_date 关闭日期 | Integer 整数 | Optional. Point in time (Unix timestamp) when the poll will be automatically closed 可选。投票将自动关闭的时间点(Unix 时间戳) |
This object represents a point on the map.
此对象表示地图上的一个点。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
latitude 纬度 | Float 浮点数 | Latitude as defined by the sender 发送者定义的纬度 |
longitude 经度 | Float 浮点数 | Longitude as defined by the sender 发送者定义的经度 |
horizontal_accuracy 水平精度 | Float 浮点数 | Optional. The radius of uncertainty for the location, measured in meters; 0-1500 可选。位置的不确定性半径,以米为单位测量;0-1500 |
live_period 实时周期 | Integer 整数 | Optional. Time relative to the message sending date, during which the location can be updated; in seconds. For active live locations only. 可选。相对于消息发送日期的时间,期间可以更新位置;以秒为单位。仅适用于活跃的实时位置。 |
heading 航向 | Integer 整数 | Optional. The direction in which user is moving, in degrees; 1-360. For active live locations only. 可选。用户移动的方向,以度为单位;1-360。仅适用于活跃的实时位置。 |
proximity_alert_radius 接近警报半径 | Integer 整数 | Optional. The maximum distance for proximity alerts about approaching another chat member, in meters. For sent live locations only. 可选。接近另一个聊天成员的接近警报的最大距离,单位为米。仅适用于发送的实时位置。 |
This object represents a venue.
此对象代表一个场所。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
location 位置 | Location 位置 | Venue location. Can't be a live location 场所位置。不能是实时位置 |
title 标题 | String 字符串 | Name of the venue 场所名称 |
address 地址 | String 字符串 | Address of the venue 场馆地址 |
foursquare_id | String 字符串 | Optional. Foursquare identifier of the venue 可选。场馆的 Foursquare 标识符 |
foursquare_type | String 字符串 | Optional. Foursquare type of the venue. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.) 可选。场所的 Foursquare 类型。(例如,“arts_entertainment/default”,“arts_entertainment/aquarium”或“food/icecream”。) |
google_place_id | String 字符串 | Optional. Google Places identifier of the venue 可选。场所的 Google Places 标识符 |
google_place_type | String 字符串 | Optional. Google Places type of the venue. (See supported types.) 可选。场所的 Google Places 类型。(请参阅支持的类型。) |
Describes data sent from a Web App to the bot.
描述从 Web 应用程序发送到机器人的数据。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
data 数据 | String 字符串 | The data. Be aware that a bad client can send arbitrary data in this field. 数据。请注意,恶意客户端可能会在此字段中发送任意数据。 |
button_text 按钮文本 | String 字符串 | Text of the web_app keyboard button from which the Web App was opened. Be aware that a bad client can send arbitrary data in this field. 打开 Web App 的 web_app 键盘按钮的文本。请注意,恶意客户端可能会在此字段中发送任意数据。 |
This object represents the content of a service message, sent whenever a user in the chat triggers a proximity alert set by another user.
此对象代表服务消息的内容,每当聊天中的用户触发另一用户设置的接近警报时发送。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
traveler 旅行者 | User 用户 | User that triggered the alert 触发警报的用户 |
watcher 监视器 | User 用户 | User that set the alert 设置警报的用户 |
distance 距离 | Integer 整数 | The distance between the users 用户之间的距离 |
This object represents a service message about a change in auto-delete timer settings.
此对象表示关于自动删除计时器设置更改的服务消息。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
message_auto_delete_time 消息自动删除时间 |
Integer 整数 | New auto-delete time for messages in the chat; in seconds 聊天中消息的新自动删除时间;以秒为单位 |
This object represents a service message about a user boosting a chat.
此对象表示关于用户提升聊天的服务消息。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
boost_count 提升次数 | Integer 整数 | Number of boosts added by the user 用户添加的提升数量 |
This object describes the way a background is filled based on the selected colors. Currently, it can be one of
此对象描述了根据所选颜色填充背景的方式。目前,它可以是以下之一
The background is filled using the selected color.
背景使用所选颜色填充。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | String 字符串 | Type of the background fill, always “solid” 背景填充类型,始终为“solid” |
color 颜色 | Integer 整数 | The color of the background fill in the RGB24 format 背景填充的颜色采用 RGB24 格式 |
The background is a gradient fill.
背景是渐变填充。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | String 字符串 | Type of the background fill, always “gradient” 背景填充类型,始终为“渐变” |
top_color 顶部颜色 | Integer 整数 | Top color of the gradient in the RGB24 format 渐变的顶部颜色,采用 RGB24 格式 |
bottom_color 底部颜色 | Integer 整数 | Bottom color of the gradient in the RGB24 format 渐变的底部颜色,采用 RGB24 格式 |
rotation_angle 旋转角度 | Integer 整数 | Clockwise rotation angle of the background fill in degrees; 0-359 背景填充的顺时针旋转角度,单位为度;范围为 0-359 |
The background is a freeform gradient that rotates after every message in the chat.
背景是一个自由渐变,每条聊天消息后都会旋转。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | String 字符串 | Type of the background fill, always “freeform_gradient” 背景填充类型,始终为“freeform_gradient” |
colors 颜色 | Array of Integer 整数数组 | A list of the 3 or 4 base colors that are used to generate the freeform gradient in the RGB24 format 用于生成自由渐变的 3 或 4 个基础颜色列表,采用 RGB24 格式 |
This object describes the type of a background. Currently, it can be one of
此对象描述背景的类型。目前,它可以是以下之一
The background is automatically filled based on the selected colors.
背景根据所选颜色自动填充。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | String 字符串 | Type of the background, always “fill” 背景类型,始终为“填充” |
fill 填充 | BackgroundFill 背景填充 | The background fill 背景填充 |
dark_theme_dimming 暗黑主题调暗 | Integer 整数 | Dimming of the background in dark themes, as a percentage; 0-100 暗色主题背景的调暗百分比;0-100 |
The background is a wallpaper in the JPEG format.
背景是一张 JPEG 格式的壁纸。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | String 字符串 | Type of the background, always “wallpaper” 背景类型,始终为“壁纸” |
document 文档 | Document 文档 | Document with the wallpaper 带有壁纸的文档 |
dark_theme_dimming 暗黑主题调暗 | Integer 整数 | Dimming of the background in dark themes, as a percentage; 0-100 暗色主题背景的调暗百分比;0-100 |
is_blurred 是否模糊 | True 真 | Optional. True, if the wallpaper is downscaled to fit in a 450x450 square and then box-blurred with radius 12 可选。如果壁纸被缩小到 450x450 的正方形内,然后使用半径 12 进行盒式模糊,则为 True |
is_moving 正在移动 | True 真 | Optional. True, if the background moves slightly when the device is tilted 可选。如果设备倾斜时背景会轻微移动,则为 True。 |
The background is a .PNG or .TGV (gzipped subset of SVG with MIME type “application/x-tgwallpattern”) pattern to be combined with the background fill chosen by the user.
背景是一个.PNG 或.TGV(压缩的 SVG 子集,MIME 类型为“application/x-tgwallpattern”)图案,将与用户选择的背景填充结合。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | String 字符串 | Type of the background, always “pattern” 背景类型,始终为“图案” |
document 文档 | Document 文档 | Document with the pattern 带有图案的文档 |
fill 填充 | BackgroundFill 背景填充 | The background fill that is combined with the pattern 与图案结合的背景填充 |
intensity 强度 | Integer 整数 | Intensity of the pattern when it is shown above the filled background; 0-100 图案在填充背景上显示时的强度;0-100 |
is_inverted 是否倒置 | True 真 | Optional. True, if the background fill must be applied only to the pattern itself. All other pixels are black in this case. For dark themes only 可选。如果背景填充仅应用于图案本身,则为 True。在这种情况下,所有其他像素为黑色。仅适用于深色主题 |
is_moving 是否移动 | True 真 | Optional. True, if the background moves slightly when the device is tilted 可选。如果设备倾斜时背景略有移动,则为 True |
The background is taken directly from a built-in chat theme.
背景直接取自内置聊天主题。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | String 字符串 | Type of the background, always “chat_theme” 背景类型,始终为“chat_theme” |
theme_name 主题名称 | String 字符串 | Name of the chat theme, which is usually an emoji 聊天主题的名称,通常为一个表情符号 |
This object represents a chat background.
此对象代表一个聊天背景。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | BackgroundType 背景类型 | Type of the background 背景类型 |
This object represents a service message about a new forum topic created in the chat.
此对象代表聊天中创建的新论坛主题的服务消息。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
name 名称 | String 字符串 | Name of the topic 主题名称 |
icon_color 图标颜色 | Integer 整数 | Color of the topic icon in RGB format 主题图标的颜色,RGB 格式 |
icon_custom_emoji_id 自定义表情符号 ID | String 字符串 | Optional. Unique identifier of the custom emoji shown as the topic icon 可选。显示为主题图标的自定义表情符号的唯一标识符 |
This object represents a service message about a forum topic closed in the chat. Currently holds no information.
此对象表示关于聊天中论坛主题关闭的服务消息。目前不包含任何信息。
This object represents a service message about an edited forum topic.
此对象表示关于已编辑论坛主题的服务消息。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
name 名称 | String 字符串 | Optional. New name of the topic, if it was edited 可选。如果主题被编辑后的新名称 |
icon_custom_emoji_id | String 字符串 | Optional. New identifier of the custom emoji shown as the topic icon, if it was edited; an empty string if the icon was removed 可选。如果主题图标被编辑后的新自定义表情符号标识符;如果图标被移除,则为空字符串 |
This object represents a service message about a forum topic reopened in the chat. Currently holds no information.
此对象代表聊天中论坛话题重新开启的服务消息。目前不包含任何信息。
This object represents a service message about General forum topic hidden in the chat. Currently holds no information.
此对象代表聊天中常规论坛话题隐藏的服务消息。目前不包含任何信息。
This object represents a service message about General forum topic unhidden in the chat. Currently holds no information.
此对象表示聊天中关于一般论坛主题取消隐藏的服务消息。目前不包含任何信息。
This object contains information about a user that was shared with the bot using a KeyboardButtonRequestUsers button.
此对象包含使用 KeyboardButtonRequestUsers 按钮与机器人共享的用户信息。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
user_id 用户 ID | Integer 整数 | 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 64-bit integers or double-precision float types are safe for storing these identifiers. 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. 共享用户的标识符。此数字可能超过 32 位有效位,一些编程语言在解释时可能存在困难/静默缺陷。但它最多有 52 位有效位,因此 64 位整数或双精度浮点类型可安全存储这些标识符。除非机器人通过其他方式已经知道该用户,否则机器人可能无法访问该用户并无法使用此标识符。 |
first_name 名 | String 字符串 | Optional. First name of the user, if the name was requested by the bot 可选。如果机器人请求了用户名,则为用户的姓氏。 |
last_name 姓氏 | String 字符串 | Optional. Last name of the user, if the name was requested by the bot 可选。如果机器人请求了姓名,则为用户的姓氏 |
username 用户名 | String 字符串 | Optional. Username of the user, if the username was requested by the bot 可选。如果机器人请求了用户名,则为用户的用户名 |
photo 照片 | Array of PhotoSize PhotoSize 数组 | Optional. Available sizes of the chat photo, if the photo was requested by the bot 可选。如果机器人请求了聊天照片,则为聊天照片的可用尺寸 |
This object contains information about the users whose identifiers were shared with the bot using a KeyboardButtonRequestUsers button.
此对象包含有关使用 KeyboardButtonRequestUsers 按钮与机器人共享标识符的用户的信息。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
request_id 请求 ID | Integer 整数 | Identifier of the request 请求的标识符 |
users 用户 | Array of SharedUser SharedUser 数组 | Information about users shared with the bot. 与机器人共享的用户信息。 |
This object contains information about a chat that was shared with the bot using a KeyboardButtonRequestChat button.
此对象包含使用 KeyboardButtonRequestChat 按钮与机器人共享的聊天信息。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
request_id 请求 ID | Integer 整数 | Identifier of the request 请求的标识符 |
chat_id | Integer 整数 | 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. 共享聊天的标识符。此数字可能超过 32 位有效位,一些编程语言在解释时可能存在困难/静默缺陷。但它最多有 52 位有效位,因此 64 位整数或双精度浮点类型可安全存储此标识符。除非机器人通过其他方式已知该聊天,否则机器人可能无法访问该聊天并无法使用此标识符。 |
title 标题 | String 字符串 | Optional. Title of the chat, if the title was requested by the bot. 可选。如果机器人请求了聊天标题,则为聊天标题。 |
username 用户名 | String 字符串 | Optional. Username of the chat, if the username was requested by the bot and available. 可选。如果机器人请求了用户名且用户名可用,则为聊天的用户名。 |
photo 照片 | Array of PhotoSize PhotoSize 数组 | Optional. Available sizes of the chat photo, if the photo was requested by the bot 可选。如果机器人请求了聊天照片,则为聊天照片的可用尺寸。 |
This object represents a service message about a user allowing a bot to write messages after adding it to the attachment menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method requestWriteAccess.
此对象代表一个服务消息,关于用户在将其添加到附件菜单、从链接启动 Web 应用程序或接受通过方法 requestWriteAccess 发送的 Web 应用程序的明确请求后,允许机器人写入消息。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
from_request 从请求 | Boolean 布尔值 | Optional. True, if the access was granted after the user accepted an explicit request from a Web App sent by the method requestWriteAccess 可选。如果用户接受了来自 Web App 通过 requestWriteAccess 方法发送的明确请求后获得访问权限,则为 True |
web_app_name | String 字符串 | Optional. Name of the Web App, if the access was granted when the Web App was launched from a link 可选。如果访问权限是在 Web App 从链接启动时授予的,则为 Web App 的名称 |
from_attachment_menu 从附件菜单 | Boolean 布尔值 | Optional. True, if the access was granted when the bot was added to the attachment or side menu 可选。如果在机器人被添加到附件或侧边菜单时授予了访问权限,则为 True。 |
This object represents a service message about a video chat scheduled in the chat.
此对象表示关于聊天中预定的视频聊天的服务消息。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
start_date 开始日期 | Integer 整数 | Point in time (Unix timestamp) when the video chat is supposed to be started by a chat administrator 视频聊天应由聊天管理员启动的时间点(Unix 时间戳) |
This object represents a service message about a video chat started in the chat. Currently holds no information.
此对象表示聊天中已开始的视频聊天的服务消息。目前不包含任何信息。
This object represents a service message about a video chat ended in the chat.
此对象表示聊天中视频聊天结束的服务消息。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
duration 持续时间 | Integer 整数 | Video chat duration in seconds 视频聊天持续时间(秒) |
This object represents a service message about new members invited to a video chat.
此对象表示邀请新成员加入视频聊天的服务消息。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
users 用户 | Array of User 用户数组 | New members that were invited to the video chat 被邀请加入视频聊天的新成员 |
This object represents a service message about the creation of a scheduled giveaway.
此对象代表关于创建定时抽奖的服务消息。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
prize_star_count | Integer 整数 | Optional. The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only 可选。用于在抽奖获胜者之间分配的 Telegram 星星数量;仅适用于 Telegram 星星抽奖 |
This object represents a message about a scheduled giveaway.
此对象代表关于定时抽奖的消息。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
chats 聊天 | Array of Chat 聊天数组 | The list of chats which the user must join to participate in the giveaway 用户必须加入以参与抽奖的聊天列表 |
winners_selection_date 获奖者选择日期 | Integer 整数 | Point in time (Unix timestamp) when winners of the giveaway will be selected 选择抽奖获奖者的时间点(Unix 时间戳) |
winner_count 获奖者数量 | Integer 整数 | The number of users which are supposed to be selected as winners of the giveaway 应被选为抽奖获奖者的用户数量 |
only_new_members 仅限新成员 | True 真 | Optional. True, if only users who join the chats after the giveaway started should be eligible to win 可选。如果只有在抽奖开始后加入聊天的用户才有资格获奖,则为 True |
has_public_winners 有公开获奖者 | True 真 | Optional. True, if the list of giveaway winners will be visible to everyone 可选。如果抽奖获胜者名单将对所有人可见,则为 True |
prize_description 奖品描述 | String 字符串 | Optional. Description of additional giveaway prize 可选。额外抽奖奖品的描述 |
country_codes 国家代码 | Array of String 字符串数组 | Optional. A list of two-letter ISO 3166-1 alpha-2 country codes indicating the countries from which eligible users for the giveaway must come. If empty, then all users can participate in the giveaway. Users with a phone number that was bought on Fragment can always participate in giveaways. 可选。由两个字母的 ISO 3166-1 alpha-2 国家代码组成的列表,表示抽奖的合格用户必须来自的国家。如果为空,则所有用户都可以参与抽奖。在 Fragment 上购买了电话号码的用户始终可以参与抽奖。 |
prize_star_count 奖品星星数量 | Integer 整数 | Optional. The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only 可选。用于抽奖获胜者之间分配的 Telegram 星星数量;仅适用于 Telegram 星星抽奖 |
premium_subscription_month_count 优质订阅月数 |
Integer 整数 | Optional. The number of months the Telegram Premium subscription won from the giveaway will be active for; for Telegram Premium giveaways only 可选。抽奖中赢得的 Telegram 优质订阅的有效月数;仅适用于 Telegram 优质订阅抽奖 |
This object represents a message about the completion of a giveaway with public winners.
此对象代表一个关于公开获奖者的赠品完成的消息。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
chat 聊天 | Chat 聊天 | The chat that created the giveaway 创建抽奖的聊天 |
giveaway_message_id 抽奖消息 ID | Integer 整数 | Identifier of the message with the giveaway in the chat 聊天中包含抽奖的消息标识符 |
winners_selection_date 获奖者选择日期 | Integer 整数 | Point in time (Unix timestamp) when winners of the giveaway were selected 抽奖获奖者被选中的时间点(Unix 时间戳) |
winner_count | Integer 整数 | Total number of winners in the giveaway 抽奖中获奖者的总数 |
winners 获奖者 | Array of User 用户数组 | List of up to 100 winners of the giveaway 最多 100 名抽奖获奖者的列表 |
additional_chat_count | Integer 整数 | Optional. The number of other chats the user had to join in order to be eligible for the giveaway 可选。用户需要加入的其他聊天数量,以符合抽奖资格 |
prize_star_count | Integer 整数 | Optional. The number of Telegram Stars that were split between giveaway winners; for Telegram Star giveaways only 可选。分配给抽奖获胜者的 Telegram 星星数量;仅适用于 Telegram 星星抽奖 |
premium_subscription_month_count | Integer 整数 | Optional. The number of months the Telegram Premium subscription won from the giveaway will be active for; for Telegram Premium giveaways only 可选。通过抽奖赢得的 Telegram Premium 订阅的有效月数;仅适用于 Telegram Premium 抽奖 |
unclaimed_prize_count 未认领奖品数量 | Integer 整数 | Optional. Number of undistributed prizes 可选。未分配奖品的数量 |
only_new_members 仅新成员 | True 真 | Optional. True, if only users who had joined the chats after the giveaway started were eligible to win 可选。如果只有在抽奖开始后加入聊天的用户才有资格获奖,则为 True |
was_refunded 已退款 | True 真 | Optional. True, if the giveaway was canceled because the payment for it was refunded 可选。如果赠品因支付被退款而取消,则为真 |
prize_description 奖品描述 | String 字符串 | Optional. Description of additional giveaway prize 可选。额外赠品的描述 |
This object represents a service message about the completion of a giveaway without public winners.
此对象表示一个关于无公开获奖者的赠品完成的服务消息。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
winner_count 获奖者数量 | Integer 整数 | Number of winners in the giveaway 抽奖中的获奖者数量 |
unclaimed_prize_count 未领取奖品数量 | Integer 整数 | Optional. Number of undistributed prizes 可选。未分配奖品的数量 |
giveaway_message 抽奖消息 | Message 消息 | Optional. Message with the giveaway that was completed, if it wasn't deleted 可选。如果抽奖未被删除,则显示已完成的抽奖消息 |
is_star_giveaway | True 真 | Optional. True, if the giveaway is a Telegram Star giveaway. Otherwise, currently, the giveaway is a Telegram Premium giveaway. 可选。如果抽奖是 Telegram Star 抽奖,则为 True。否则,目前抽奖是 Telegram Premium 抽奖。 |
Describes the options used for link preview generation.
描述用于生成链接预览的选项。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
is_disabled 已禁用 | Boolean 布尔值 | Optional. True, if the link preview is disabled 可选。如果链接预览被禁用,则为 True |
url | String 字符串 | Optional. URL to use for the link preview. If empty, then the first URL found in the message text will be used 可选。用于链接预览的 URL。如果为空,则使用消息文本中找到的第一个 URL |
prefer_small_media 优先小媒体 | Boolean 布尔值 | Optional. True, if the media in the link preview is supposed to be shrunk; ignored if the URL isn't explicitly specified or media size change isn't supported for the preview 可选。如果链接预览中的媒体应被缩小,则为 True;如果未明确指定 URL 或不支持预览的媒体大小更改,则忽略 |
prefer_large_media 偏好大媒体 | Boolean 布尔值 | Optional. True, if the media in the link preview is supposed to be enlarged; ignored if the URL isn't explicitly specified or media size change isn't supported for the preview 可选。如果链接预览中的媒体应被放大,则为 True;如果 URL 未明确指定或预览不支持媒体尺寸更改,则忽略 |
show_above_text 显示在文本上方 | Boolean 布尔值 | Optional. True, if the link preview must be shown above the message text; otherwise, the link preview will be shown below the message text 可选。如果链接预览必须显示在消息文本上方,则为 True;否则,链接预览将显示在消息文本下方 |
This object represent a user's profile pictures.
此对象代表用户的个人资料图片。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
total_count 总数 | Integer 整数 | Total number of profile pictures the target user has 目标用户拥有的个人资料图片总数 |
photos 照片 | Array of Array of PhotoSize PhotoSize 数组的数组 |
Requested profile pictures (in up to 4 sizes each) 请求的个人资料图片(每张最多 4 种尺寸) |
This object represents a file ready to be downloaded. The file can be downloaded via the link https://api.telegram.org/file/bot<token>/<file_path>
. 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 getFile.
此对象表示一个准备下载的文件。可以通过链接 https://api.telegram.org/file/bot<token>/<file_path>
下载该文件。保证链接至少在 1 小时内有效。链接过期后,可以通过调用 getFile 请求新的链接。
The maximum file size to download is 20 MB
最大可下载文件大小为 20 MB
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
file_id | String 字符串 | Identifier for this file, which can be used to download or reuse the file 此文件的标识符,可用于下载或重用该文件 |
file_unique_id | String 字符串 | 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. 此文件的唯一标识符,应随时间和不同机器人保持相同。不能用于下载或重新使用文件。 |
file_size | Integer 整数 | Optional. 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. 可选。文件大小,单位为字节。可以大于 2^31,一些编程语言在解释时可能存在困难/静默缺陷。但它最多有 52 个有效位,因此使用有符号 64 位整数或双精度浮点类型存储此值是安全的。 |
file_path | String 字符串 | Optional. File path. Use https://api.telegram.org/file/bot<token>/<file_path> to get the file.可选。文件路径。使用 https://api.telegram.org/file/bot<token>/<file_path> 获取文件。 |
Describes a Web App. 描述一个 Web 应用。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
url | String 字符串 | An HTTPS URL of a Web App to be opened with additional data as specified in Initializing Web Apps 一个 Web 应用的 HTTPS URL,将根据“初始化 Web 应用”中指定的附加数据打开。 |
This object represents a custom keyboard with reply options (see Introduction to bots for details and examples). Not supported in channels and for messages sent on behalf of a Telegram Business account.
此对象代表一个带有回复选项的自定义键盘(有关详细信息和示例,请参见“机器人介绍”)。不支持在频道中使用,也不支持代表 Telegram 商业账户发送的消息。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
keyboard | Array of Array of KeyboardButton 键盘按钮数组的数组 |
Array of button rows, each represented by an Array of KeyboardButton objects 按钮行的数组,每行由键盘按钮对象的数组表示 |
is_persistent 是持久的 | Boolean 布尔值 | Optional. Requests clients to always show the keyboard when the regular keyboard is hidden. Defaults to false, in which case the custom keyboard can be hidden and opened with a keyboard icon. 可选。请求客户端在常规键盘隐藏时始终显示键盘。默认为 false,在这种情况下,自定义键盘可以隐藏并通过键盘图标打开。 |
resize_keyboard | Boolean 布尔值 | Optional. 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 false, in which case the custom keyboard is always of the same height as the app's standard keyboard. 可选。请求客户端垂直调整键盘大小以获得最佳适应(例如,如果只有两行按钮,则使键盘更小)。默认为 false,在这种情况下,自定义键盘始终与应用程序的标准键盘高度相同。 |
one_time_keyboard | Boolean 布尔值 | Optional. 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 false. 可选。请求客户端在键盘被使用后立即隐藏键盘。键盘仍然可用,但客户端将自动在聊天中显示常规字母键盘 - 用户可以通过输入字段中的特殊按钮再次查看自定义键盘。默认为 false。 |
input_field_placeholder 输入字段占位符 | String 字符串 | Optional. The placeholder to be shown in the input field when the keyboard is active; 1-64 characters 可选。当键盘激活时显示在输入字段中的占位符;1-64 个字符 |
selective 选择性 | Boolean 布尔值 | Optional. Use this parameter if you want to show the keyboard to specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply to a message in the same chat and forum topic, sender of the original message. 可选。如果您希望仅向特定用户显示键盘,请使用此参数。目标:1) 在消息对象的文本中被@提及的用户;2) 如果机器人的消息是对同一聊天和论坛主题中消息的回复,则为原始消息的发送者。 Example: 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. 示例:用户请求更改机器人的语言,机器人通过键盘回复请求以选择新语言。群组中的其他用户看不到键盘。 |
This object represents one button of the reply keyboard. At most one of the optional fields must be used to specify type of the button. For simple text buttons, String can be used instead of this object to specify the button text.
此对象代表回复键盘的一个按钮。最多只能使用一个可选字段来指定按钮的类型。对于简单的文本按钮,可以使用字符串代替此对象来指定按钮文本。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
text 文本 | String 字符串 | Text of the button. If none of the optional fields are used, it will be sent as a message when the button is pressed 按钮的文本。如果没有使用任何可选字段,按下按钮时将作为消息发送。 |
request_users 请求用户 | KeyboardButtonRequestUsers 键盘按钮请求用户 |
Optional. If specified, pressing the button will open a list of suitable users. Identifiers of selected users will be sent to the bot in a “users_shared” service message. Available in private chats only. 可选。如果指定,按下按钮将打开一个合适用户列表。所选用户的标识符将在“users_shared”服务消息中发送给机器人。仅在私人聊天中可用。 |
request_chat 请求聊天 | KeyboardButtonRequestChat 键盘按钮请求聊天 |
Optional. 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. 可选。如果指定,按下按钮将打开一个合适的聊天列表。点击聊天将向机器人发送其标识符,形式为“chat_shared”服务消息。仅在私人聊天中可用。 |
request_contact 请求联系人 | Boolean 布尔值 | Optional. If True, the user's phone number will be sent as a contact when the button is pressed. Available in private chats only. 可选。如果为 True,按下按钮时将发送用户的电话号码作为联系人。仅在私人聊天中可用。 |
request_location 请求位置 | Boolean 布尔值 | Optional. If True, the user's current location will be sent when the button is pressed. Available in private chats only. 可选。如果为 True,按下按钮时将发送用户的当前位置。仅在私人聊天中可用。 |
request_poll | KeyboardButtonPollType 键盘按钮投票类型 | Optional. 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. 可选。如果指定,按下按钮时将要求用户创建一个投票并发送给机器人。仅在私人聊天中可用。 |
web_app | WebAppInfo 网络应用信息 | Optional. If specified, the described Web App 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. 可选。如果指定,按下按钮时将启动所描述的 Web 应用。Web 应用将能够发送“web_app_data”服务消息。仅在私人聊天中可用。 |
Note: request_users and request_chat options will only work in Telegram versions released after 3 February, 2023. Older clients will display unsupported message.
注意:request_users 和 request_chat 选项仅在 2023 年 2 月 3 日之后发布的 Telegram 版本中有效。旧版客户端将显示不支持的消息。
This object defines the criteria used to request suitable users. Information about the selected users will be shared with the bot when the corresponding button is pressed. More about requesting users »
此对象定义了请求合适用户的标准。当按下相应按钮时,选定用户的信息将与机器人共享。了解更多关于请求用户的信息 »
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
request_id 请求 ID | Integer 整数 | Signed 32-bit identifier of the request that will be received back in the UsersShared object. Must be unique within the message 请求的已签名 32 位标识符,将在 UsersShared 对象中接收回来。必须在消息中唯一。 |
user_is_bot | Boolean 布尔值 | Optional. Pass True to request bots, pass False to request regular users. If not specified, no additional restrictions are applied. 可选。传入 True 请求机器人,传入 False 请求普通用户。如果未指定,则不应用额外限制。 |
user_is_premium | Boolean 布尔值 | Optional. Pass True to request premium users, pass False to request non-premium users. If not specified, no additional restrictions are applied. 可选。传入 True 请求高级用户,传入 False 请求非高级用户。如果未指定,则不应用额外限制。 |
max_quantity | Integer 整数 | Optional. The maximum number of users to be selected; 1-10. Defaults to 1. 可选。选择的用户最大数量;1-10。默认为 1。 |
request_name 请求姓名 | Boolean 布尔值 | Optional. Pass True to request the users' first and last names 可选。传入 True 以请求用户的姓和名 |
request_username 请求用户名 | Boolean 布尔值 | Optional. Pass True to request the users' usernames 可选。传入 True 以请求用户的用户名 |
request_photo 请求照片 | Boolean 布尔值 | Optional. Pass True to request the users' photos 可选。传入 True 以请求用户的照片。 |
This object defines the criteria used to request a suitable chat. Information about the selected chat will be shared with the bot when the corresponding button is pressed. The bot will be granted requested rights in the chat if appropriate. More about requesting chats ».
此对象定义了请求合适聊天的标准。当按下相应按钮时,选定聊天的信息将与机器人共享。如果合适,机器人将在聊天中获得请求的权限。更多关于请求聊天的信息 ».
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
request_id 请求 ID | Integer 整数 | Signed 32-bit identifier of the request, which will be received back in the ChatShared object. Must be unique within the message 请求的有符号 32 位标识符,将在 ChatShared 对象中接收回来。必须在消息中唯一 |
chat_is_channel | Boolean 布尔值 | Pass True to request a channel chat, pass False to request a group or a supergroup chat. 传递 True 以请求频道聊天,传递 False 以请求群组或超级群组聊天。 |
chat_is_forum | Boolean 布尔值 | Optional. Pass True to request a forum supergroup, pass False to request a non-forum chat. If not specified, no additional restrictions are applied. 可选。传递 True 以请求论坛超级群组,传递 False 以请求非论坛聊天。如果未指定,则不应用额外限制。 |
chat_has_username 聊天有用户名 | Boolean 布尔值 | Optional. Pass True to request a supergroup or a channel with a username, pass False to request a chat without a username. If not specified, no additional restrictions are applied. 可选。传入 True 以请求带有用户名的超级群组或频道,传入 False 以请求没有用户名的聊天。如果未指定,则不应用额外限制。 |
chat_is_created 聊天已创建 | Boolean 布尔值 | Optional. Pass True to request a chat owned by the user. Otherwise, no additional restrictions are applied. 可选。传入 True 以请求用户拥有的聊天。否则,不应用额外限制。 |
user_administrator_rights 用户管理员权限 |
ChatAdministratorRights 聊天管理员权限 | Optional. A JSON-serialized object listing the required administrator rights of the user in the chat. The rights must be a superset of bot_administrator_rights. If not specified, no additional restrictions are applied. 可选。一个 JSON 序列化的对象,列出用户在聊天中的所需管理员权限。这些权限必须是 bot_administrator_rights 的超集。如果未指定,则不应用额外限制。 |
bot_administrator_rights | ChatAdministratorRights 聊天管理员权限 | Optional. A JSON-serialized object listing the required administrator rights of the bot in the chat. The rights must be a subset of user_administrator_rights. If not specified, no additional restrictions are applied. 可选。一个 JSON 序列化的对象,列出机器人在聊天中的所需管理员权限。这些权限必须是 user_administrator_rights 的子集。如果未指定,则不应用额外限制。 |
bot_is_member | Boolean 布尔值 | Optional. Pass True to request a chat with the bot as a member. Otherwise, no additional restrictions are applied. 可选。传递 True 以请求机器人作为成员的聊天。否则,不应用额外限制。 |
request_title 请求标题 | Boolean 布尔值 | Optional. Pass True to request the chat's title 可选。传入 True 以请求聊天的标题 |
request_username 请求用户名 | Boolean 布尔值 | Optional. Pass True to request the chat's username 可选。传入 True 以请求聊天的用户名 |
request_photo 请求照片 | Boolean 布尔值 | Optional. Pass True to request the chat's photo 可选。传入 True 以请求聊天的照片 |
This object represents type of a poll, which is allowed to be created and sent when the corresponding button is pressed.
此对象表示投票类型,允许在按下相应按钮时创建和发送。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | String 字符串 | Optional. If quiz is passed, the user will be allowed to create only polls in the quiz mode. If regular is passed, only regular polls will be allowed. Otherwise, the user will be allowed to create a poll of any type. 可选。如果传递了 quiz,用户将只能创建测验模式的投票。如果传递了 regular,仅允许创建常规投票。否则,用户将被允许创建任何类型的投票。 |
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 ReplyKeyboardMarkup). Not supported in channels and for messages sent on behalf of a Telegram Business account.
收到包含此对象的消息后,Telegram 客户端将移除当前自定义键盘并显示默认字母键盘。默认情况下,自定义键盘会显示,直到机器人发送新的键盘。对于一次性键盘例外,用户按下按钮后会立即隐藏(参见 ReplyKeyboardMarkup)。不支持在频道中使用,也不支持代表 Telegram 商业账户发送的消息。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
remove_keyboard | True 真 | 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 one_time_keyboard in ReplyKeyboardMarkup) 请求客户端移除自定义键盘(用户将无法召唤此键盘;如果您想隐藏键盘但保持其可访问性,请在 ReplyKeyboardMarkup 中使用 one_time_keyboard) |
selective 选择性 | Boolean 布尔值 | Optional. Use this parameter if you want to remove the keyboard for specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply to a message in the same chat and forum topic, sender of the original message. 可选。如果您只想为特定用户移除键盘,请使用此参数。目标:1)在消息对象的文本中被@提及的用户;2)如果机器人的消息是对同一聊天和论坛主题中消息的回复,则为原始消息的发送者。 Example: 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. 示例:用户在投票中投票,机器人返回确认消息作为对投票的回复,并为该用户移除键盘,同时仍向尚未投票的用户显示带有投票选项的键盘。 |
This object represents an inline keyboard that appears right next to the message it belongs to.
此对象表示一个内联键盘,它显示在其所属消息的旁边。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
inline_keyboard 内联键盘 | Array of Array of InlineKeyboardButton InlineKeyboardButton 对象的数组的数组 |
Array of button rows, each represented by an Array of InlineKeyboardButton objects 按钮行的数组,每行由 InlineKeyboardButton 对象的数组表示 |
This object represents one button of an inline keyboard. Exactly one of the optional fields must be used to specify type of the button.
此对象代表内联键盘的一个按钮。必须使用一个可选字段来指定按钮的类型。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
text 文本 | String 字符串 | Label text on the button 按钮上的标签文本 |
url | String 字符串 | Optional. HTTP or tg:// URL to be opened when the button is pressed. Links tg://user?id=<user_id> can be used to mention a user by their identifier without using a username, if this is allowed by their privacy settings.可选。按钮按下时打开的 HTTP 或 tg:// URL。链接 tg://user?id=<user_id> 可用于通过用户的标识符提及用户,而无需使用用户名,如果用户的隐私设置允许这样做。 |
callback_data | String 字符串 | Optional. Data to be sent in a callback query to the bot when the button is pressed, 1-64 bytes 可选。按钮按下时发送给机器人的回调查询数据,1-64 字节 |
web_app 网络应用 | WebAppInfo 网络应用信息 | Optional. 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 answerWebAppQuery. Available only in private chats between a user and the bot. Not supported for messages sent on behalf of a Telegram Business account. 可选。当用户按下按钮时启动的网络应用的描述。网络应用将能够使用方法 answerWebAppQuery 代表用户发送任意消息。仅在用户与机器人之间的私人聊天中可用。不支持代表 Telegram 商业账户发送的消息。 |
login_url 登录 URL | LoginUrl 登录 URL | Optional. An HTTPS URL used to automatically authorize the user. Can be used as a replacement for the Telegram Login Widget. 可选。一个用于自动授权用户的 HTTPS URL。可以替代 Telegram 登录小部件使用。 |
switch_inline_query | String 字符串 | Optional. 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. Not supported for messages sent on behalf of a Telegram Business account. 可选。如果设置,按下按钮将提示用户选择他们的一个聊天,打开该聊天并在输入字段中插入机器人的用户名和指定的内联查询。可以为空,在这种情况下只会插入机器人的用户名。不支持代表 Telegram 商业账户发送的消息。 |
switch_inline_query_current_chat | String 字符串 | Optional. 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. 可选。如果设置,按下按钮将在当前聊天的输入字段中插入机器人的用户名和指定的内联查询。可以为空,在这种情况下只会插入机器人的用户名。 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. Not supported in channels and for messages sent on behalf of a Telegram Business account. 这为用户提供了一种快速方式,可以在同一聊天中以内联模式打开你的机器人 - 适用于从多个选项中选择。不支持在频道中使用,也不支持代表 Telegram 商业账户发送的消息。 |
switch_inline_query_chosen_chat | SwitchInlineQueryChosenChat 切换内联查询选择聊天 |
Optional. 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. Not supported for messages sent on behalf of a Telegram Business account. 可选。如果设置,按下按钮将提示用户选择指定类型的聊天之一,打开该聊天并在输入字段中插入机器人的用户名和指定的内联查询。不支持代表 Telegram 商业账户发送的消息。 |
copy_text 复制文本 | CopyTextButton 复制文本按钮 | Optional. Description of the button that copies the specified text to the clipboard. 可选。描述将指定文本复制到剪贴板的按钮。 |
callback_game 回调游戏 | CallbackGame | Optional. Description of the game that will be launched when the user presses the button. 可选。描述用户按下按钮时将启动的游戏。 NOTE: This type of button must always be the first button in the first row. 注意:这种类型的按钮必须始终是第一行的第一个按钮。 |
pay 支付 | Boolean 布尔值 | Optional. Specify True, to send a Pay button. Substrings “![]() 可选。指定为 True,以发送支付按钮。按钮文本中的子字符串“ ![]() NOTE: This type of button must always be the first button in the first row and can only be used in invoice messages. 注意:这种类型的按钮必须始终是第一行的第一个按钮,并且只能在发票消息中使用。 |
This object represents a parameter of the inline keyboard button used to automatically authorize a user. Serves as a great replacement for the Telegram Login Widget 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:
此对象表示内联键盘按钮的一个参数,用于自动授权用户。当用户来自 Telegram 时,它是 Telegram 登录小部件的绝佳替代品。用户只需点击按钮并确认他们想要登录:
Telegram apps support these buttons as of version 5.7.
从版本 5.7 开始,Telegram 应用程序支持这些按钮。
Sample bot: @discussbot 示例机器人:@discussbot
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
url | String 字符串 | 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 Receiving authorization data. 一个 HTTPS URL,当按钮被按下时,将打开并在查询字符串中添加用户授权数据。如果用户拒绝提供授权数据,将打开不包含用户信息的原始 URL。添加的数据与接收授权数据中描述的相同。 NOTE: You must always check the hash of the received data to verify the authentication and the integrity of the data as described in Checking authorization. 注意:您必须始终检查接收数据的哈希值,以验证身份验证和数据的完整性,如检查授权中所述。 |
forward_text 转发文本 | String 字符串 | Optional. New text of the button in forwarded messages. 可选。转发消息中按钮的新文本。 |
bot_username 机器人用户名 | String 字符串 | Optional. Username of a bot, which will be used for user authorization. See Setting up a bot for more details. If not specified, the current bot's username will be assumed. The url's domain must be the same as the domain linked with the bot. See Linking your domain to the bot for more details. 可选。用于用户授权的机器人用户名。有关更多详细信息,请参阅设置机器人。如果未指定,将假定为当前机器人的用户名。URL 的域名必须与链接到机器人的域名相同。有关更多详细信息,请参阅将您的域名链接到机器人。 |
request_write_access 请求写入权限 | Boolean 布尔值 | Optional. Pass True to request the permission for your bot to send messages to the user. 可选。传递 True 以请求允许您的机器人向用户发送消息的权限。 |
This object represents an inline button that switches the current user to inline mode in a chosen chat, with an optional default inline query.
此对象代表一个内联按钮,可将当前用户切换到所选聊天的内联模式,并带有一个可选的默认内联查询。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
query 查询 | String 字符串 | Optional. The default inline query to be inserted in the input field. If left empty, only the bot's username will be inserted 可选。将在输入字段中插入的默认内联查询。如果留空,只会插入机器人的用户名。 |
allow_user_chats 允许用户聊天 | Boolean 布尔值 | Optional. True, if private chats with users can be chosen 可选。如果可以选择与用户的私人聊天,则为 True |
allow_bot_chats 允许机器人聊天 | Boolean 布尔值 | Optional. True, if private chats with bots can be chosen 可选。如果可以选择与机器人的私人聊天,则为 True |
allow_group_chats 允许群组聊天 | Boolean 布尔值 | Optional. True, if group and supergroup chats can be chosen 可选。如果可以选择群组和超级群组聊天,则为 True |
allow_channel_chats | Boolean 布尔值 | Optional. True, if channel chats can be chosen 可选。如果可以选择频道聊天,则为 True |
This object represents an inline keyboard button that copies specified text to the clipboard.
此对象表示一个内联键盘按钮,用于将指定文本复制到剪贴板。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
text 文本 | String 字符串 | The text to be copied to the clipboard; 1-256 characters 要复制到剪贴板的文本;1-256 个字符 |
This object represents an incoming callback query from a callback button in an inline keyboard. If the button that originated the query was attached to a message sent by the bot, the field message will be present. If the button was attached to a message sent via the bot (in inline mode), the field inline_message_id will be present. Exactly one of the fields data or game_short_name will be present.
此对象表示来自内联键盘中回调按钮的传入回调查询。如果触发查询的按钮附加到机器人发送的消息上,则会存在 message 字段。如果按钮附加到通过机器人发送的消息上(在内联模式下),则会存在 inline_message_id 字段。data 字段或 game_short_name 字段中将恰好存在一个。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
id | String 字符串 | Unique identifier for this query 此查询的唯一标识符 |
from 来自 | User 用户 | Sender 发送者 |
message 消息 | MaybeInaccessibleMessage 可能无法访问的消息 |
Optional. Message sent by the bot with the callback button that originated the query 可选。机器人发送的带有触发查询的回调按钮的消息 |
inline_message_id | String 字符串 | Optional. Identifier of the message sent via the bot in inline mode, that originated the query. 可选。通过机器人在内联模式下发送的消息的标识符,该消息引发了查询。 |
chat_instance | String 字符串 | Global identifier, uniquely corresponding to the chat to which the message with the callback button was sent. Useful for high scores in games. 全局标识符,与发送带有回调按钮的消息的聊天唯一对应。在游戏中用于高分很有用。 |
data 数据 | String 字符串 | Optional. Data associated with the callback button. Be aware that the message originated the query can contain no callback buttons with this data. 可选。与回调按钮相关联的数据。请注意,引发查询的消息可能不包含带有此数据的回调按钮。 |
game_short_name | String 字符串 | Optional. Short name of a Game to be returned, serves as the unique identifier for the game 可选。游戏的简称,用作游戏的唯一标识符 |
NOTE: After the user presses a callback button, Telegram clients will display a progress bar until you call answerCallbackQuery. It is, therefore, necessary to react by calling answerCallbackQuery even if no notification to the user is needed (e.g., without specifying any of the optional parameters).
注意:用户按下回调按钮后,Telegram 客户端将显示进度条,直到您调用 answerCallbackQuery。因此,即使不需要向用户发送通知(例如,不指定任何可选参数),也必须通过调用 answerCallbackQuery 来做出反应。
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 privacy mode. Not supported in channels and for messages sent on behalf of a Telegram Business account.
收到包含此对象的消息后,Telegram 客户端将向用户显示回复界面(就像用户选择了机器人的消息并点击了“回复”一样)。如果您想创建用户友好的逐步界面而不牺牲隐私模式,这将非常有用。不支持在频道中使用,并且不适用于代表 Telegram 商业账户发送的消息。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
force_reply | True 真 | Shows reply interface to the user, as if they manually selected the bot's message and tapped 'Reply' 向用户显示回复界面,就像他们手动选择了机器人的消息并点击了“回复”一样 |
input_field_placeholder 输入字段占位符 | String 字符串 | Optional. The placeholder to be shown in the input field when the reply is active; 1-64 characters 可选。当回复激活时,显示在输入字段中的占位符;1-64 个字符 |
selective 选择性 | Boolean 布尔值 | Optional. Use this parameter if you want to force reply from specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply to a message in the same chat and forum topic, sender of the original message. 可选。如果您只想强制特定用户回复,请使用此参数。目标:1)在消息对象的文本中被@提到的用户;2)如果机器人的消息是对同一聊天和论坛主题中消息的回复,则为原始消息的发送者。 |
Example: A poll bot 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:
示例:一个用于群组的投票机器人以隐私模式运行(仅接收命令、回复其消息和提及)。创建新投票可能有两种方式:
- 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.
向用户解释如何发送带参数的命令(例如,/newpoll 问题 答案 1 答案 2)。这可能对硬核用户有吸引力,但缺乏现代的润色。- 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'.
引导用户完成一个逐步的过程。'请发送你的问题给我','很好,现在让我们添加第一个答案选项','太棒了。继续添加答案选项,然后在准备好时发送/done'。The last option is definitely more attractive. And if you use ForceReply 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.
最后一个选项无疑更具吸引力。如果你在机器人的问题中使用 ForceReply,即使它只接收回复、命令和提及,它也会收到用户的答案——用户无需额外操作。
This object represents a chat photo.
此对象代表聊天照片。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
small_file_id | String 字符串 | 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. 小尺寸(160x160)聊天照片的文件标识符。此文件标识符只能用于下载照片,且仅在照片未更改时有效。 |
small_file_unique_id | String 字符串 | 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. 小尺寸(160x160)聊天照片的唯一文件标识符,预计在不同时间和不同机器人之间保持一致。不能用于下载或重用文件。 |
big_file_id 大文件 ID | String 字符串 | 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. 大(640x640)聊天照片的文件标识符。此文件 ID 只能用于下载照片,并且仅在照片未更改时有效。 |
big_file_unique_id 大文件唯一 ID | String 字符串 | 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. 大(640x640)聊天照片的唯一文件标识符,随时间和不同机器人应保持相同。不能用于下载或重用文件。 |
Represents an invite link for a chat.
代表一个聊天邀请链接。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
invite_link 邀请链接 | String 字符串 | The invite link. If the link was created by another chat administrator, then the second part of the link will be replaced with “…”. 邀请链接。如果链接是由另一个聊天管理员创建的,那么链接的第二部分将被替换为“……”。 |
creator 创建者 | User 用户 | Creator of the link 链接的创建者 |
creates_join_request 创建加入请求 | Boolean 布尔值 | True, if users joining the chat via the link need to be approved by chat administrators 如果通过链接加入聊天的用户需要聊天管理员批准,则为 True |
is_primary 是主要的 | Boolean 布尔值 | True, if the link is primary 如果链接是主要的,则为 True |
is_revoked 已撤销 | Boolean 布尔值 | True, if the link is revoked 如果链接已撤销,则为 True |
name 名称 | String 字符串 | Optional. Invite link name 可选。邀请链接名称 |
expire_date 过期日期 | Integer 整数 | Optional. Point in time (Unix timestamp) when the link will expire or has been expired 可选。链接将过期或已过期的时间点(Unix 时间戳) |
member_limit 成员限制 | Integer 整数 | Optional. The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999 可选。通过此邀请链接加入聊天后,聊天中同时可以成为成员的用户最大数量;1-99999 |
pending_join_request_count 待处理加入请求数量 |
Integer 整数 | Optional. Number of pending join requests created using this link 可选。使用此链接创建的待处理加入请求数量 |
subscription_period 订阅周期 | Integer 整数 | Optional. The number of seconds the subscription will be active for before the next payment 可选。订阅在下次付款前激活的秒数 |
subscription_price 订阅价格 | Integer 整数 | Optional. The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat using the link 可选。用户通过链接加入聊天时需支付的电报星星数量,以及在每个后续订阅周期后需支付的数量 |
Represents the rights of an administrator in a chat.
代表聊天中管理员的权限。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
is_anonymous | Boolean 布尔值 | True, if the user's presence in the chat is hidden 如果用户在聊天中的存在是隐藏的,则为真 |
can_manage_chat | Boolean 布尔值 | True, if the administrator can access the chat event log, get boost list, see hidden supergroup and channel members, report spam messages and ignore slow mode. Implied by any other administrator privilege. 如果管理员可以访问聊天事件日志、获取提升列表、查看隐藏的超级群和频道成员、举报垃圾信息并忽略慢速模式,则为真。由任何其他管理员权限暗示。 |
can_delete_messages | Boolean 布尔值 | True, if the administrator can delete messages of other users 如果管理员可以删除其他用户的消息,则为真 |
can_manage_video_chats | Boolean 布尔值 | True, if the administrator can manage video chats 如果管理员可以管理视频聊天,则为真 |
can_restrict_members | Boolean 布尔值 | True, if the administrator can restrict, ban or unban chat members, or access supergroup statistics 如果管理员可以限制、封禁或解封聊天成员,或访问超级群统计,则为 True |
can_promote_members | Boolean 布尔值 | True, 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) 如果管理员可以添加新的管理员,赋予他们自己权限的一个子集,或降级他们直接或间接(由用户任命的管理员所提拔的管理员)提拔的管理员,则为 True |
can_change_info | Boolean 布尔值 | True, if the user is allowed to change the chat title, photo and other settings 如果用户被允许更改聊天标题、照片和其他设置,则为 True |
can_invite_users | Boolean 布尔值 | True, if the user is allowed to invite new users to the chat 如果用户被允许邀请新用户加入聊天,则为 True |
can_post_stories | Boolean 布尔值 | True, if the administrator can post stories to the chat 如果管理员可以向聊天发布故事,则为 True |
can_edit_stories 可以编辑故事 | Boolean 布尔值 | True, if the administrator can edit stories posted by other users, post stories to the chat page, pin chat stories, and access the chat's story archive 如果管理员可以编辑其他用户发布的故事,向聊天页面发布故事,固定聊天故事,并访问聊天的故事档案,则为 True |
can_delete_stories 可以删除故事 | Boolean 布尔值 | True, if the administrator can delete stories posted by other users 如果管理员可以删除其他用户发布的故事,则为 True |
can_post_messages 可以发布消息 | Boolean 布尔值 | Optional. True, if the administrator can post messages in the channel, or access channel statistics; for channels only 可选。如果管理员可以在频道中发布消息,或访问频道统计数据;仅适用于频道 |
can_edit_messages | Boolean 布尔值 | Optional. True, if the administrator can edit messages of other users and can pin messages; for channels only 可选。如果管理员可以编辑其他用户的消息并可以置顶消息;仅适用于频道 |
can_pin_messages | Boolean 布尔值 | Optional. True, if the user is allowed to pin messages; for groups and supergroups only 可选。如果用户被允许置顶消息;仅适用于群组和超级群组 |
can_manage_topics 可以管理话题 | Boolean 布尔值 | Optional. True, if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only 可选。如果用户被允许创建、重命名、关闭和重新打开论坛话题;仅限超级群组 |
This object represents changes in the status of a chat member.
此对象代表聊天成员状态的变化。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
chat 聊天 | Chat 聊天 | Chat the user belongs to 用户所属的聊天 |
from 从 | User 用户 | Performer of the action, which resulted in the change 执行导致更改的操作者 |
date 日期 | Integer 整数 | Date the change was done in Unix time 更改完成的日期(Unix 时间) |
old_chat_member | ChatMember 聊天成员 | Previous information about the chat member 聊天成员的先前信息 |
new_chat_member 新聊天成员 | ChatMember 聊天成员 | New information about the chat member 关于聊天成员的新信息 |
invite_link 邀请链接 | ChatInviteLink 聊天邀请链接 | Optional. Chat invite link, which was used by the user to join the chat; for joining by invite link events only. 可选。聊天邀请链接,用户通过此链接加入聊天;仅适用于通过邀请链接加入的事件。 |
via_join_request 通过加入请求 | Boolean 布尔值 | Optional. True, if the user joined the chat after sending a direct join request without using an invite link and being approved by an administrator 可选。如果用户在发送直接加入请求后加入聊天,且未使用邀请链接并获得管理员批准,则为 True |
via_chat_folder_invite_link 通过聊天文件夹邀请链接 |
Boolean 布尔值 | Optional. True, if the user joined the chat via a chat folder invite link 可选。如果用户通过聊天文件夹邀请链接加入聊天,则为 True |
This object contains information about one member of a chat. Currently, the following 6 types of chat members are supported:
此对象包含有关聊天中一个成员的信息。目前支持以下 6 种聊天成员类型:
Represents a chat member that owns the chat and has all administrator privileges.
代表拥有聊天并拥有所有管理员权限的聊天成员。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
status 状态 | String 字符串 | The member's status in the chat, always “creator” 成员在聊天中的状态,始终为“creator” |
user 用户 | User 用户 | Information about the user 用户信息 |
is_anonymous | Boolean 布尔值 | True, if the user's presence in the chat is hidden 如果用户在聊天中的存在被隐藏,则为 True |
custom_title 自定义标题 | String 字符串 | Optional. Custom title for this user 可选。用户的自定义标题 |
Represents a chat member that has some additional privileges.
代表一个在聊天中拥有额外权限的成员。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
status 状态 | String 字符串 | The member's status in the chat, always “administrator” 成员在聊天中的状态,始终为“管理员” |
user 用户 | User 用户 | Information about the user 用户信息 |
can_be_edited | Boolean 布尔值 | True, if the bot is allowed to edit administrator privileges of that user 如果允许机器人编辑该用户的管理员权限,则为 True |
is_anonymous | Boolean 布尔值 | True, if the user's presence in the chat is hidden 如果用户在聊天中的存在被隐藏,则为 True |
can_manage_chat | Boolean 布尔值 | True, if the administrator can access the chat event log, get boost list, see hidden supergroup and channel members, report spam messages and ignore slow mode. Implied by any other administrator privilege. 如果管理员可以访问聊天事件日志、获取增强列表、查看隐藏的超级群和频道成员、举报垃圾信息并忽略慢速模式,则为 True。由任何其他管理员权限暗示。 |
can_delete_messages | Boolean 布尔值 | True, if the administrator can delete messages of other users 如果管理员可以删除其他用户的消息,则为 True |
can_manage_video_chats | Boolean 布尔值 | True, if the administrator can manage video chats 如果管理员可以管理视频聊天,则为 True |
can_restrict_members | Boolean 布尔值 | True, if the administrator can restrict, ban or unban chat members, or access supergroup statistics 如果管理员可以限制、封禁或解封聊天成员,或访问超级群组统计,则为 True |
can_promote_members 可以提升成员 | Boolean 布尔值 | True, 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) 如果管理员可以添加新的管理员,赋予他们自己权限的一个子集,或者降级他们直接或间接(由用户任命的管理员所提升的管理员)提升的管理员,则为 True |
can_change_info 可以更改信息 | Boolean 布尔值 | True, if the user is allowed to change the chat title, photo and other settings 如果用户被允许更改聊天标题、照片和其他设置,则为 True |
can_invite_users 可以邀请用户 | Boolean 布尔值 | True, if the user is allowed to invite new users to the chat 如果用户被允许邀请新用户加入聊天,则为 True |
can_post_stories | Boolean 布尔值 | True, if the administrator can post stories to the chat 如果管理员可以向聊天发布故事,则为 True |
can_edit_stories | Boolean 布尔值 | True, if the administrator can edit stories posted by other users, post stories to the chat page, pin chat stories, and access the chat's story archive 如果管理员可以编辑其他用户发布的故事,向聊天页面发布故事,固定聊天故事,并访问聊天的故事档案,则为 True |
can_delete_stories 可以删除故事 | Boolean 布尔值 | True, if the administrator can delete stories posted by other users 如果管理员可以删除其他用户发布的故事,则为 True |
can_post_messages 可以发布消息 | Boolean 布尔值 | Optional. True, if the administrator can post messages in the channel, or access channel statistics; for channels only 可选。如果管理员可以在频道中发布消息,或访问频道统计数据,则为 True;仅适用于频道 |
can_edit_messages 可以编辑消息 | Boolean 布尔值 | Optional. True, if the administrator can edit messages of other users and can pin messages; for channels only 可选。如果管理员可以编辑其他用户的消息并可以置顶消息;仅适用于频道 |
can_pin_messages | Boolean 布尔值 | Optional. True, if the user is allowed to pin messages; for groups and supergroups only 可选。如果用户被允许置顶消息;仅适用于群组和超级群组 |
can_manage_topics | Boolean 布尔值 | Optional. True, if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only 可选。如果用户被允许创建、重命名、关闭和重新打开论坛主题;仅适用于超级群组 |
custom_title 自定义标题 | String 字符串 | Optional. Custom title for this user 可选。为此用户设置的自定义标题 |
Represents a chat member that has no additional privileges or restrictions.
代表一个没有额外权限或限制的聊天成员。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
status 状态 | String 字符串 | The member's status in the chat, always “member” 成员在聊天中的状态,始终为“成员” |
user 用户 | User 用户 | Information about the user 用户信息 |
until_date 截止日期 | Integer 整数 | Optional. Date when the user's subscription will expire; Unix time 可选。用户订阅到期的日期;Unix 时间 |
Represents a chat member that is under certain restrictions in the chat. Supergroups only.
代表在聊天中受到某些限制的聊天成员。仅限超级群组。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
status 状态 | String 字符串 | The member's status in the chat, always “restricted” 成员在聊天中的状态,始终为“受限” |
user 用户 | User 用户 | Information about the user 用户信息 |
is_member 是成员 | Boolean 布尔值 | True, if the user is a member of the chat at the moment of the request 如果用户在请求时是聊天成员,则为 True |
can_send_messages 可以发送消息 | Boolean 布尔值 | True, if the user is allowed to send text messages, contacts, giveaways, giveaway winners, invoices, locations and venues 如果用户被允许发送文本消息、联系人、赠品、赠品获胜者、发票、位置和场所,则为 True |
can_send_audios 可以发送音频 | Boolean 布尔值 | True, if the user is allowed to send audios 如果用户被允许发送音频,则为真 |
can_send_documents | Boolean 布尔值 | True, if the user is allowed to send documents 如果用户被允许发送文档,则为真 |
can_send_photos | Boolean 布尔值 | True, if the user is allowed to send photos 如果用户被允许发送照片,则为真 |
can_send_videos 可以发送视频 | Boolean 布尔值 | True, if the user is allowed to send videos 如果用户被允许发送视频,则为 True |
can_send_video_notes 可以发送视频便签 | Boolean 布尔值 | True, if the user is allowed to send video notes 如果用户被允许发送视频便签,则为 True |
can_send_voice_notes 可以发送语音便签 | Boolean 布尔值 | True, if the user is allowed to send voice notes 如果用户被允许发送语音备忘录,则为 True |
can_send_polls | Boolean 布尔值 | True, if the user is allowed to send polls 如果用户被允许发送投票,则为 True |
can_send_other_messages | Boolean 布尔值 | True, if the user is allowed to send animations, games, stickers and use inline bots 如果用户被允许发送动画、游戏、贴纸和使用内联机器人,则为 True |
can_add_web_page_previews 可以添加网页预览 |
Boolean 布尔值 | True, if the user is allowed to add web page previews to their messages 如果用户被允许在消息中添加网页预览,则为 True |
can_change_info 可以更改信息 | Boolean 布尔值 | True, if the user is allowed to change the chat title, photo and other settings 如果用户被允许更改聊天标题、照片和其他设置,则为 True |
can_invite_users 可以邀请用户 | Boolean 布尔值 | True, if the user is allowed to invite new users to the chat 如果用户被允许邀请新用户加入聊天,则为 True |
can_pin_messages | Boolean 布尔值 | True, if the user is allowed to pin messages 如果用户被允许固定消息,则为 True |
can_manage_topics 可以管理主题 | Boolean 布尔值 | True, if the user is allowed to create forum topics 如果用户被允许创建论坛主题,则为 True |
until_date 截止日期 | Integer 整数 | Date when restrictions will be lifted for this user; Unix time. If 0, then the user is restricted forever 用户限制解除的日期;Unix 时间。如果为 0,则用户永久受限 |
Represents a chat member that isn't currently a member of the chat, but may join it themselves.
代表一个当前不是聊天成员但可能自己加入的聊天成员。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
status 状态 | String 字符串 | The member's status in the chat, always “left” 成员在聊天中的状态,始终为“已离开” |
user 用户 | User 用户 | Information about the user 用户信息 |
Represents a chat member that was banned in the chat and can't return to the chat or view chat messages.
代表一个在聊天中被禁的聊天成员,无法返回聊天或查看聊天消息。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
status 状态 | String 字符串 | The member's status in the chat, always “kicked” 成员在聊天中的状态,始终为“已踢出” |
user 用户 | User 用户 | Information about the user 用户信息 |
until_date 截止日期 | Integer 整数 | Date when restrictions will be lifted for this user; Unix time. If 0, then the user is banned forever 此用户限制解除的日期;Unix 时间。如果为 0,则用户永久被禁 |
Represents a join request sent to a chat.
代表发送到聊天的加入请求
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
chat 聊天 | Chat 聊天 | Chat to which the request was sent 请求发送到的聊天 |
from 来自 | User 用户 | User that sent the join request 发送加入请求的用户 |
user_chat_id 用户聊天 ID | Integer 整数 | 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 5 minutes to send messages until the join request is processed, assuming no other administrator contacted the user. 发送加入请求的用户的私人聊天标识符。此数字可能超过 32 位有效位,一些编程语言在解释时可能存在困难/无声缺陷。但它最多有 52 位有效位,因此 64 位整数或双精度浮点类型可以安全存储此标识符。机器人可以在加入请求被处理前的 5 分钟内使用此标识符发送消息,假设没有其他管理员联系过该用户。 |
date 日期 | Integer 整数 | Date the request was sent in Unix time 请求发送的日期(Unix 时间) |
bio 简介 | String 字符串 | Optional. Bio of the user. 可选。用户的简介。 |
invite_link 邀请链接 | ChatInviteLink 聊天邀请链接 | Optional. Chat invite link that was used by the user to send the join request 可选。用户发送加入请求时使用的聊天邀请链接 |
Describes actions that a non-administrator user is allowed to take in a chat.
描述非管理员用户在聊天中允许执行的操作。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
can_send_messages | Boolean 布尔值 | Optional. True, if the user is allowed to send text messages, contacts, giveaways, giveaway winners, invoices, locations and venues 可选。如果用户被允许发送文本消息、联系人、赠品、赠品获胜者、发票、位置和场所,则为 True。 |
can_send_audios | Boolean 布尔值 | Optional. True, if the user is allowed to send audios 可选。如果用户被允许发送音频,则为 True。 |
can_send_documents 可以发送文档 | Boolean 布尔值 | Optional. True, if the user is allowed to send documents 可选。如果用户被允许发送文档,则为 True |
can_send_photos 可以发送照片 | Boolean 布尔值 | Optional. True, if the user is allowed to send photos 可选。如果用户被允许发送照片,则为 True |
can_send_videos 可以发送视频 | Boolean 布尔值 | Optional. True, if the user is allowed to send videos 可选。如果允许用户发送视频,则为 True |
can_send_video_notes | Boolean 布尔值 | Optional. True, if the user is allowed to send video notes 可选。如果允许用户发送视频笔记,则为 True |
can_send_voice_notes | Boolean 布尔值 | Optional. True, if the user is allowed to send voice notes 可选。如果允许用户发送语音笔记,则为 True |
can_send_polls 可以发送投票 | Boolean 布尔值 | Optional. True, if the user is allowed to send polls 可选。如果用户被允许发送投票,则为 True |
can_send_other_messages 可以发送其他消息 | Boolean 布尔值 | Optional. True, if the user is allowed to send animations, games, stickers and use inline bots 可选。如果用户被允许发送动画、游戏、贴纸和使用内联机器人,则为 True |
can_add_web_page_previews 可以添加网页预览 |
Boolean 布尔值 | Optional. True, if the user is allowed to add web page previews to their messages 可选。如果用户被允许在消息中添加网页预览,则为 True |
can_change_info | Boolean 布尔值 | Optional. True, if the user is allowed to change the chat title, photo and other settings. Ignored in public supergroups 可选。如果用户被允许更改聊天标题、照片和其他设置,则为 True。在公共超级群组中被忽略 |
can_invite_users | Boolean 布尔值 | Optional. True, if the user is allowed to invite new users to the chat 可选。如果用户被允许邀请新用户加入聊天,则为 True |
can_pin_messages | Boolean 布尔值 | Optional. True, if the user is allowed to pin messages. Ignored in public supergroups 可选。如果允许用户固定消息,则为 True。在公共超级群组中被忽略 |
can_manage_topics 可以管理主题 | Boolean 布尔值 | Optional. True, if the user is allowed to create forum topics. If omitted defaults to the value of can_pin_messages 可选。如果允许用户创建论坛主题,则为 True。如果省略,则默认为 can_pin_messages 的值 |
Describes the birthdate of a user.
描述用户的出生日期。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
day 日 | Integer 整数 | Day of the user's birth; 1-31 用户的出生日;1-31 |
month 月份 | Integer 整数 | Month of the user's birth; 1-12 用户的出生月份;1-12 |
year 年份 | Integer 整数 | Optional. Year of the user's birth 可选。用户的出生年份 |
Contains information about the start page settings of a Telegram Business account.
包含有关 Telegram 商业账户起始页面设置的信息。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
title 标题 | String 字符串 | Optional. Title text of the business intro 可选。业务介绍的标题文本 |
message 消息 | String 字符串 | Optional. Message text of the business intro 可选。业务介绍的消息文本 |
sticker 贴纸 | Sticker 贴纸 | Optional. Sticker of the business intro 可选。业务介绍的贴纸 |
Contains information about the location of a Telegram Business account.
包含有关 Telegram 业务账户位置的信息。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
address 地址 | String 字符串 | Address of the business 业务地址 |
location 位置 | Location 位置 | Optional. Location of the business 可选。业务地点 |
Describes an interval of time during which a business is open.
描述一个企业开放的时间间隔。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
opening_minute 开店分钟 | Integer 整数 | The minute's sequence number in a week, starting on Monday, marking the start of the time interval during which the business is open; 0 - 7 * 24 * 60 一周中分钟的序列号,从周一开始,标记业务开放时间间隔的开始;0 - 7 * 24 * 60 |
closing_minute 关店分钟 | Integer 整数 | The minute's sequence number in a week, starting on Monday, marking the end of the time interval during which the business is open; 0 - 8 * 24 * 60 一周中分钟的序列号,从周一开始,标记业务开放时间间隔的结束;0 - 8 * 24 * 60 |
Describes the opening hours of a business.
描述一家企业的营业时间。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
time_zone_name 时区名称 | String 字符串 | Unique name of the time zone for which the opening hours are defined 为定义营业时间的时区的唯一名称 |
opening_hours 营业时间 | Array of BusinessOpeningHoursInterval BusinessOpeningHoursInterval 数组 |
List of time intervals describing business opening hours 描述营业时间的时间间隔列表 |
Represents a location to which a chat is connected.
表示聊天连接到的位置。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
location 位置 | Location 位置 | The location to which the supergroup is connected. Can't be a live location. 超级群组连接到的位置。不能是实时位置。 |
address 地址 | String 字符串 | Location address; 1-64 characters, as defined by the chat owner 位置地址;由聊天所有者定义,1-64 个字符 |
This object describes the type of a reaction. Currently, it can be one of
此对象描述反应的类型。目前,它可以是以下之一
The reaction is based on an emoji.
反应基于一个表情符号。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | String 字符串 | Type of the reaction, always “emoji” 反应的类型,始终是“表情符号” |
emoji 表情符号 | String 字符串 | Reaction emoji. Currently, it can be one of "![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 反应表情。当前可以是 " ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
The reaction is based on a custom emoji.
反应基于自定义表情。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | String 字符串 | Type of the reaction, always “custom_emoji” 反应类型,始终为“custom_emoji” |
custom_emoji_id | String 字符串 | Custom emoji identifier 自定义表情标识符 |
The reaction is paid.
反应已支付。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | String 字符串 | Type of the reaction, always “paid” 反应的类型,始终为“paid” |
Represents a reaction added to a message along with the number of times it was added.
表示添加到消息中的反应以及添加的次数。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | ReactionType 反应类型 | Type of the reaction 反应的类型 |
total_count 总数 | Integer 整数 | Number of times the reaction was added 反应被添加的次数 |
This object represents a change of a reaction on a message performed by a user.
此对象代表用户对消息的反应更改。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
chat 聊天 | Chat 聊天 | The chat containing the message the user reacted to 用户所反应的消息所在的聊天 |
message_id 消息 ID | Integer 整数 | Unique identifier of the message inside the chat 聊天中消息的唯一标识符 |
user 用户 | User 用户 | Optional. The user that changed the reaction, if the user isn't anonymous 可选。如果用户不是匿名,则为更改反应的用户 |
actor_chat | Chat 聊天 | Optional. The chat on behalf of which the reaction was changed, if the user is anonymous 可选。如果用户是匿名,则为代表更改反应的聊天 |
date 日期 | Integer 整数 | Date of the change in Unix time 更改的日期(Unix 时间) |
old_reaction | Array of ReactionType ReactionType 数组 | Previous list of reaction types that were set by the user 用户之前设置的反应类型列表 |
new_reaction 新反应 | Array of ReactionType ReactionType 数组 | New list of reaction types that have been set by the user 用户已设置的新反应类型列表 |
This object represents reaction changes on a message with anonymous reactions.
此对象表示带有匿名反应的消息上的反应变化。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
chat 聊天 | Chat 聊天 | The chat containing the message 包含消息的聊天 |
message_id 消息 ID | Integer 整数 | Unique message identifier inside the chat 聊天内唯一的消息标识符 |
date 日期 | Integer 整数 | Date of the change in Unix time 更改的日期(Unix 时间) |
reactions 反应 | Array of ReactionCount ReactionCount 数组 | List of reactions that are present on the message 消息上存在的反应列表 |
This object represents a forum topic.
此对象代表一个论坛主题。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
message_thread_id | Integer 整数 | Unique identifier of the forum topic 论坛主题的唯一标识符 |
name 名称 | String 字符串 | Name of the topic 主题名称 |
icon_color 图标颜色 | Integer 整数 | Color of the topic icon in RGB format 主题图标的颜色,RGB 格式 |
icon_custom_emoji_id | String 字符串 | Optional. Unique identifier of the custom emoji shown as the topic icon 可选。显示为主题图标的自定义表情符号的唯一标识符 |
This object represents a bot command.
此对象代表一个机器人命令。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
command 命令 | String 字符串 | Text of the command; 1-32 characters. Can contain only lowercase English letters, digits and underscores. 命令的文本;1-32 个字符。只能包含小写英文字母、数字和下划线。 |
description 描述 | String 字符串 | Description of the command; 1-256 characters. 命令的描述;1-256 个字符。 |
This object represents the scope to which bot commands are applied. Currently, the following 7 scopes are supported:
此对象代表应用机器人命令的范围。目前支持以下 7 个范围:
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:
以下算法用于确定特定用户查看机器人菜单时的命令列表。返回设置的第一个命令列表:
Commands in the chat with the bot
与机器人的聊天中的命令
Commands in group and supergroup chats
群组和超级群组中的命令
Represents the default scope of bot commands. Default commands are used if no commands with a narrower scope are specified for the user.
表示机器人命令的默认范围。如果没有为用户指定更窄范围的命令,则使用默认命令。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | String 字符串 | Scope type, must be default 范围类型,必须是默认 |
Represents the scope of bot commands, covering all private chats.
表示机器人命令的范围,涵盖所有私人聊天。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | String 字符串 | Scope type, must be all_private_chats 范围类型,必须是所有私人聊天 |
Represents the scope of bot commands, covering all group and supergroup chats.
表示机器人命令的范围,涵盖所有群组和超级群组聊天。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | String 字符串 | Scope type, must be all_group_chats 范围类型,必须是 all_group_chats |
Represents the scope of bot commands, covering all group and supergroup chat administrators.
表示机器人命令的范围,涵盖所有群组和超级群组聊天管理员。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | String 字符串 | Scope type, must be all_chat_administrators 范围类型,必须是 all_chat_administrators |
Represents the scope of bot commands, covering a specific chat.
表示机器人命令的范围,涵盖特定聊天。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | String 字符串 | Scope type, must be chat 范围类型,必须是聊天 |
chat_id | Integer or String 整数或字符串 | Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername )目标聊天的唯一标识符或目标超级群组的用户名(格式为 @supergroupusername ) |
Represents the scope of bot commands, covering all administrators of a specific group or supergroup chat.
表示机器人命令的范围,涵盖特定群组或超级群组聊天的所有管理员。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | String 字符串 | Scope type, must be chat_administrators 范围类型,必须是 chat_administrators |
chat_id | Integer or String 整数或字符串 | Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername )目标聊天的唯一标识符或目标超级群组的用户名(格式为 @supergroupusername ) |
Represents the scope of bot commands, covering a specific member of a group or supergroup chat.
表示机器人命令的范围,涵盖群组或超级群组聊天的特定成员。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | String 字符串 | Scope type, must be chat_member 范围类型,必须是 chat_member |
chat_id | Integer or String 整数或字符串 | Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername )目标聊天的唯一标识符或目标超级群的用户名(格式为 @supergroupusername ) |
user_id 用户 ID | Integer 整数 | Unique identifier of the target user 目标用户的唯一标识符 |
This object represents the bot's name.
此对象代表机器人的名称。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
name 名称 | String 字符串 | The bot's name 机器人的名称 |
This object represents the bot's description.
此对象代表机器人的描述。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
description 描述 | String 字符串 | The bot's description 机器人的描述 |
This object represents the bot's short description.
此对象代表机器人的简短描述。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
short_description 简短描述 | String 字符串 | The bot's short description 机器人的简短描述 |
This object describes the bot's menu button in a private chat. It should be one of
此对象描述了机器人在私人聊天中的菜单按钮。它应该是以下之一
If a menu button other than MenuButtonDefault 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.
如果为私人聊天设置了除 MenuButtonDefault 之外的菜单按钮,则在聊天中应用该按钮。否则应用默认菜单按钮。默认情况下,菜单按钮会打开机器人命令列表。
Represents a menu button, which opens the bot's list of commands.
表示一个菜单按钮,该按钮会打开机器人的命令列表。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | String 字符串 | Type of the button, must be commands 按钮类型,必须是命令 |
Represents a menu button, which launches a Web App.
表示一个菜单按钮,用于启动 Web 应用。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | String 字符串 | Type of the button, must be web_app 按钮类型,必须为 web_app |
text 文本 | String 字符串 | Text on the button 按钮上的文本 |
web_app | WebAppInfo 网络应用信息 | 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 answerWebAppQuery. Alternatively, a t.me link to a Web App of the bot can be specified in the object instead of the Web App's URL, in which case the Web App will be opened as if the user pressed the link.当用户按下按钮时,将启动的 Web 应用的描述。Web 应用将能够使用方法 answerWebAppQuery 代表用户发送任意消息。或者,可以在对象中指定一个 t.me 链接到机器人的 Web 应用,而不是 Web 应用的 URL,在这种情况下,Web 应用将被打开,就好像用户按下了链接一样。 |
Describes that no specific value for the menu button was set.
描述菜单按钮未设置特定值。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | String 字符串 | Type of the button, must be default 按钮类型,必须为默认值 |
This object describes the source of a chat boost. It can be one of
此对象描述聊天提升的来源。它可以是以下之一
The boost was obtained by subscribing to Telegram Premium or by gifting a Telegram Premium subscription to another user.
通过订阅 Telegram Premium 或向另一用户赠送 Telegram Premium 订阅获得了提升。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
source 来源 | String 字符串 | Source of the boost, always “premium” 提升的来源,始终为“premium” |
user 用户 | User 用户 | User that boosted the chat 提升聊天的用户 |
The boost was obtained by the creation of Telegram Premium gift codes to boost a chat. Each such code boosts the chat 4 times for the duration of the corresponding Telegram Premium subscription.
通过创建 Telegram Premium 礼品代码来提升聊天获得的提升。每张这样的代码在相应的 Telegram Premium 订阅期间内可提升聊天 4 次。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
source 来源 | String 字符串 | Source of the boost, always “gift_code” 提升的来源,始终为“gift_code” |
user 用户 | User 用户 | User for which the gift code was created 为其创建礼品代码的用户 |
The boost was obtained by the creation of a Telegram Premium or a Telegram Star giveaway. This boosts the chat 4 times for the duration of the corresponding Telegram Premium subscription for Telegram Premium giveaways and prize_star_count / 500 times for one year for Telegram Star giveaways.
通过创建 Telegram Premium 或 Telegram Star 赠品获得的提升。对于 Telegram Premium 赠品,此提升在相应的 Telegram Premium 订阅期间内提升聊天 4 倍;对于 Telegram Star 赠品,则在赠品的 prize_star_count / 500 倍提升聊天一年。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
source 来源 | String 字符串 | Source of the boost, always “giveaway” 提升的来源,始终为“赠品” |
giveaway_message_id 抽奖消息 ID | Integer 整数 | Identifier of a message in the chat with the giveaway; the message could have been deleted already. May be 0 if the message isn't sent yet. 聊天中带有赠品的消息的标识符;该消息可能已被删除。如果消息尚未发送,则可能为 0。 |
user 用户 | User 用户 | Optional. User that won the prize in the giveaway if any; for Telegram Premium giveaways only 可选。对于 Telegram Premium 赠品,如果有获奖者,则为在赠品中获奖的用户。 |
prize_star_count 奖品星星数量 | Integer 整数 | Optional. The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only 可选。用于抽奖获胜者之间分配的 Telegram 星星数量;仅适用于 Telegram 星星抽奖 |
is_unclaimed 未认领 | True 真 | Optional. True, if the giveaway was completed, but there was no user to win the prize 可选。如果赠品已完成,但没有用户赢得奖品,则为 True |
This object contains information about a chat boost.
此对象包含有关聊天提升的信息。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
boost_id 提升 ID | String 字符串 | Unique identifier of the boost 提升的唯一标识符 |
add_date 添加日期 | Integer 整数 | Point in time (Unix timestamp) when the chat was boosted 聊天被提升的时间点(Unix 时间戳) |
expiration_date 到期日期 | Integer 整数 | Point in time (Unix timestamp) when the boost will automatically expire, unless the booster's Telegram Premium subscription is prolonged 提升将自动到期的时间点(Unix 时间戳),除非延长助推者的 Telegram 高级订阅 |
source 来源 | ChatBoostSource 聊天提升来源 | Source of the added boost 添加提升的来源 |
This object represents a boost added to a chat or changed.
此对象表示添加到聊天或更改的提升。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
chat 聊天 | Chat 聊天 | Chat which was boosted 被提升的聊天 |
boost 提升 | ChatBoost 聊天提升 | Information about the chat boost 关于聊天提升的信息 |
This object represents a boost removed from a chat.
此对象表示从聊天中移除的提升。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
chat 聊天 | Chat 聊天 | Chat which was boosted 被提升的聊天 |
boost_id | String 字符串 | Unique identifier of the boost 提升的唯一标识符 |
remove_date | Integer 整数 | Point in time (Unix timestamp) when the boost was removed 移除提升的时间点(Unix 时间戳) |
source 来源 | ChatBoostSource 聊天提升来源 | Source of the removed boost 移除提升的来源 |
This object represents a list of boosts added to a chat by a user.
此对象代表用户添加到聊天中的提升列表。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
boosts 提升 | Array of ChatBoost ChatBoost 数组 | The list of boosts added to the chat by the user 用户添加到聊天的提升列表 |
Describes the connection of the bot with a business account.
描述机器人与业务账户的连接。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
id | String 字符串 | Unique identifier of the business connection 业务连接的唯一标识符 |
user 用户 | User 用户 | Business account user that created the business connection 创建业务连接的业务账户用户 |
user_chat_id 用户聊天 ID | Integer 整数 | Identifier of a private chat with the user who created the business connection. 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. 与创建业务连接的用户的私人聊天的标识符。此数字可能超过 32 位有效位,一些编程语言在解释时可能存在困难/静默缺陷。但它最多有 52 位有效位,因此使用 64 位整数或双精度浮点类型存储此标识符是安全的。 |
date 日期 | Integer 整数 | Date the connection was established in Unix time 连接建立的日期,Unix 时间 |
can_reply 可以回复 | Boolean 布尔值 | True, if the bot can act on behalf of the business account in chats that were active in the last 24 hours 如果机器人在过去 24 小时内活跃的聊天中可以代表商务账户采取行动,则为 True |
is_enabled 已启用 | Boolean 布尔值 | True, if the connection is active 如果连接处于活跃状态,则为 True |
This object is received when messages are deleted from a connected business account.
当从连接的商务账户中删除消息时,会收到此对象。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
business_connection_id 业务连接 ID | String 字符串 | Unique identifier of the business connection 业务连接的唯一标识符 |
chat 聊天 | Chat 聊天 | Information about a chat in the business account. The bot may not have access to the chat or the corresponding user. 关于业务账户中聊天的信息。机器人可能无法访问该聊天或相应的用户。 |
message_ids 消息 ID | Array of Integer 整数数组 | The list of identifiers of deleted messages in the chat of the business account 业务账户聊天中已删除消息的标识符列表 |
Describes why a request was unsuccessful.
描述请求为何不成功。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
migrate_to_chat_id 迁移到聊天 ID | Integer 整数 | Optional. 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. 可选。该群组已迁移到具有指定标识符的超级群组。此数字可能超过 32 位有效位,一些编程语言在解释时可能存在困难/静默缺陷。但它最多有 52 位有效位,因此使用有符号 64 位整数或双精度浮点类型来存储此标识符是安全的。 |
retry_after 重试后 | Integer 整数 | Optional. In case of exceeding flood control, the number of seconds left to wait before the request can be repeated 可选。在超过洪水控制的情况下,请求可以重复之前需要等待的秒数 |
This object represents the content of a media message to be sent. It should be one of
此对象代表要发送的媒体消息的内容。它应该是以下之一
Represents a photo to be sent.
代表要发送的照片。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | String 字符串 | Type of the result, must be photo 结果类型,必须是照片 |
media 媒体 | String 字符串 | 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. More information on Sending Files » 要发送的文件。传递一个 file_id 来发送存在于 Telegram 服务器上的文件(推荐),传递一个 HTTP URL 让 Telegram 从互联网获取文件,或者传递 “attach://” 来使用 multipart/form-data 上传一个新文件,文件名使用 。更多关于发送文件的信息请查看 » |
caption 标题 | String 字符串 | Optional. Caption of the photo to be sent, 0-1024 characters after entities parsing 可选。要发送的照片的标题,实体解析后 0-1024 个字符 |
parse_mode 解析模式 | String 字符串 | Optional. Mode for parsing entities in the photo caption. See formatting options for more details. 可选。用于解析照片说明中实体的模式。请参阅格式选项以获取更多详细信息。 |
caption_entities 说明实体 | Array of MessageEntity MessageEntity 数组 | Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode 可选。说明中出现的特殊实体列表,可以替代 parse_mode 指定 |
show_caption_above_media 在媒体上方显示说明 |
Boolean 布尔值 | Optional. Pass True, if the caption must be shown above the message media 可选。如果说明必须显示在消息媒体上方,请传递 True |
has_spoiler 有剧透 | Boolean 布尔值 | Optional. Pass True if the photo needs to be covered with a spoiler animation 可选。如果照片需要用剧透动画覆盖,请传入 True |
Represents a video to be sent.
表示要发送的视频。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | String 字符串 | Type of the result, must be video 结果类型,必须是视频 |
media 媒体 | String 字符串 | 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. More information on Sending Files » 要发送的文件。传递 file_id 以发送存在于 Telegram 服务器上的文件(推荐),传递 HTTP URL 让 Telegram 从互联网获取文件,或传递 “attach://” 以使用 multipart/form-data 在 名称下上传新文件。更多关于发送文件的信息 » |
thumbnail 缩略图 | String 字符串 | Optional. 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>. More information on Sending Files » 可选。发送文件的缩略图;如果服务器端支持文件的缩略图生成,则可以忽略。缩略图应为 JPEG 格式,大小应小于 200 kB。缩略图的宽度和高度不应超过 320。如果文件不是使用 multipart/form-data 上传的,则忽略。缩略图不能重复使用,只能作为新文件上传,因此如果缩略图是使用 multipart/form-data 在 下上传的,您可以传递 “attach://”。更多关于发送文件的信息 » |
cover 封面 | String 字符串 | Optional. Cover for the video in the message. 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. More information on Sending Files » 可选。消息中视频的封面。传递 file_id 以发送存在于 Telegram 服务器上的文件(推荐),传递 HTTP URL 让 Telegram 从互联网获取文件,或传递 “attach://” 以使用 multipart/form-data 在 名称下上传新文件。更多关于发送文件的信息 » |
start_timestamp | Integer 整数 | Optional. Start timestamp for the video in the message 可选。消息中视频的开始时间戳 |
caption 标题 | String 字符串 | Optional. Caption of the video to be sent, 0-1024 characters after entities parsing 可选。视频标题,实体解析后 0-1024 个字符 |
parse_mode 解析模式 | String 字符串 | Optional. Mode for parsing entities in the video caption. See formatting options for more details. 可选。解析视频标题中实体的模式。查看格式化选项以获取更多详情。 |
caption_entities 标题实体 | Array of MessageEntity MessageEntity 数组 | Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode 可选。标题中出现的特殊实体列表,可替代解析模式指定 |
show_caption_above_media 在媒体上方显示标题 |
Boolean 布尔值 | Optional. Pass True, if the caption must be shown above the message media 可选。如果标题必须显示在消息媒体上方,请传递 True |
width 宽度 | Integer 整数 | Optional. Video width 可选。视频宽度 |
height 高度 | Integer 整数 | Optional. Video height 可选。视频高度 |
duration 持续时间 | Integer 整数 | Optional. Video duration in seconds 可选。视频时长(秒) |
supports_streaming 支持流媒体 | Boolean 布尔值 | Optional. Pass True if the uploaded video is suitable for streaming 可选。如果上传的视频适合流媒体播放,请传入 True |
has_spoiler 有剧透 | Boolean 布尔值 | Optional. Pass True if the video needs to be covered with a spoiler animation 可选。如果视频需要用剧透动画覆盖,请传入 True |
Represents an animation file (GIF or H.264/MPEG-4 AVC video without sound) to be sent.
表示要发送的动画文件(GIF 或 H.264/MPEG-4 AVC 视频,无声音)。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | String 字符串 | Type of the result, must be animation 结果的类型,必须是动画 |
media 媒体 | String 字符串 | 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. More information on Sending Files » 要发送的文件。传递 file_id 以发送存在于 Telegram 服务器上的文件(推荐),传递 HTTP URL 让 Telegram 从互联网获取文件,或传递 “attach://” 以使用 multipart/form-data 在 名称下上传新文件。更多关于发送文件的信息 » |
thumbnail 缩略图 | String 字符串 | Optional. 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>. More information on Sending Files » 可选。发送文件的缩略图;如果服务器端支持文件的缩略图生成,则可以忽略。缩略图应为 JPEG 格式,大小应小于 200 kB。缩略图的宽度和高度不应超过 320。如果文件不是使用 multipart/form-data 上传的,则忽略。缩略图不能重复使用,只能作为新文件上传,因此如果缩略图是使用 multipart/form-data 在 下上传的,您可以传递 “attach://”。更多关于发送文件的信息 » |
caption 标题 | String 字符串 | Optional. Caption of the animation to be sent, 0-1024 characters after entities parsing 可选。要发送的动画的标题,实体解析后为 0-1024 个字符 |
parse_mode 解析模式 | String 字符串 | Optional. Mode for parsing entities in the animation caption. See formatting options for more details. 可选。用于解析动画标题中实体的模式。请参阅格式化选项以获取更多详细信息。 |
caption_entities 标题实体 | Array of MessageEntity MessageEntity 数组 | Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode 可选。标题中出现的特殊实体列表,可以替代 parse_mode 指定 |
show_caption_above_media 在媒体上方显示标题 |
Boolean 布尔值 | Optional. Pass True, if the caption must be shown above the message media 可选。如果标题必须显示在消息媒体上方,请传递 True |
width 宽度 | Integer 整数 | Optional. Animation width 可选。动画宽度 |
height 高度 | Integer 整数 | Optional. Animation height 可选。动画高度 |
duration 持续时间 | Integer 整数 | Optional. Animation duration in seconds 可选。动画持续时间(秒) |
has_spoiler | Boolean 布尔值 | Optional. Pass True if the animation needs to be covered with a spoiler animation 可选。如果动画需要用剧透动画覆盖,请传入 True |
Represents an audio file to be treated as music to be sent.
表示要作为音乐发送的音频文件。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | String 字符串 | Type of the result, must be audio 结果的类型,必须是音频 |
media 媒体 | String 字符串 | 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. More information on Sending Files » 要发送的文件。传递一个 file_id 来发送存在于 Telegram 服务器上的文件(推荐),传递一个 HTTP URL 让 Telegram 从互联网获取文件,或者传递 “attach://” 来使用 multipart/form-data 以 名称上传一个新文件。更多关于发送文件的信息请查看 » |
thumbnail 缩略图 | String 字符串 | Optional. 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>. More information on Sending Files » 可选。发送文件的缩略图;如果服务器端支持文件的缩略图生成,可以忽略此项。缩略图应为 JPEG 格式,大小应小于 200 kB。缩略图的宽度和高度不应超过 320。如果文件不是使用 multipart/form-data 上传的,则忽略此项。缩略图不能重复使用,只能作为新文件上传,因此如果缩略图是使用 multipart/form-data 以 名称上传的,可以传递 “attach://”。更多关于发送文件的信息请查看 » |
caption 标题 | String 字符串 | Optional. Caption of the audio to be sent, 0-1024 characters after entities parsing 可选。发送音频的标题,实体解析后 0-1024 个字符 |
parse_mode | String 字符串 | Optional. Mode for parsing entities in the audio caption. See formatting options for more details. 可选。解析音频标题中实体的模式。查看格式化选项以获取更多详情。 |
caption_entities | Array of MessageEntity MessageEntity 数组 | Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode 可选。标题中出现的特殊实体列表,可以替代 parse_mode 指定 |
duration 持续时间 | Integer 整数 | Optional. Duration of the audio in seconds 可选。音频的持续时间(秒) |
performer 执行者 | String 字符串 | Optional. Performer of the audio 可选。音频的表演者 |
title 标题 | String 字符串 | Optional. Title of the audio 可选。音频的标题 |
Represents a general file to be sent.
表示要发送的通用文件。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | String 字符串 | Type of the result, must be document 结果类型,必须是文档 |
media 媒体 | String 字符串 | 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. More information on Sending Files » 要发送的文件。传递 file_id 以发送存在于 Telegram 服务器上的文件(推荐),传递 HTTP URL 让 Telegram 从互联网获取文件,或传递 “attach://” 以使用 multipart/form-data 下的 名称上传新文件。更多关于发送文件的信息 » |
thumbnail 缩略图 | String 字符串 | Optional. 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>. More information on Sending Files » 可选。发送文件的缩略图;如果服务器端支持文件的缩略图生成,则可以忽略。缩略图应为 JPEG 格式且大小应小于 200 kB。缩略图的宽度和高度不应超过 320。如果文件不是使用 multipart/form-data 上传的,则忽略。缩略图不能重复使用,只能作为新文件上传,因此如果缩略图是使用 multipart/form-data 下的 上传的,您可以传递 “attach://”。更多关于发送文件的信息 » |
caption 标题 | String 字符串 | Optional. Caption of the document to be sent, 0-1024 characters after entities parsing 可选。要发送的文档的标题,实体解析后 0-1024 个字符 |
parse_mode | String 字符串 | Optional. Mode for parsing entities in the document caption. See formatting options for more details. 可选。解析文档标题中实体的模式。有关更多详细信息,请参阅格式化选项。 |
caption_entities | Array of MessageEntity MessageEntity 数组 | Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode 可选。在标题中出现的特殊实体列表,可以代替 parse_mode 指定 |
disable_content_type_detection 禁用内容类型检测 |
Boolean 布尔值 | Optional. Disables automatic server-side content type detection for files uploaded using multipart/form-data. Always True, if the document is sent as part of an album. 可选。禁用服务器端对使用 multipart/form-data 上传的文件的自动内容类型检测。如果文档作为相册的一部分发送,则始终为 True。 |
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.
此对象表示要上传的文件内容。必须使用 multipart/form-data 的方式提交,类似于浏览器上传文件的常规方法。
This object describes the paid media to be sent. Currently, it can be one of
此对象描述要发送的付费媒体。目前,它可以是以下之一
The paid media to send is a photo.
要发送的付费媒体是一张照片。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | String 字符串 | Type of the media, must be photo 媒体类型,必须是照片 |
media 媒体 | String 字符串 | 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. More information on Sending Files » 要发送的文件。传递一个 file_id 来发送存在于 Telegram 服务器上的文件(推荐),传递一个 HTTP URL 让 Telegram 从互联网获取文件,或者传递 “attach://” 来使用 multipart/form-data 上传一个新文件,文件名使用 。更多关于发送文件的信息请查看 » |
The paid media to send is a video.
要发送的付费媒体是视频。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | String 字符串 | Type of the media, must be video 媒体类型,必须是视频 |
media 媒体 | String 字符串 | 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. More information on Sending Files » 要发送的文件。传递 file_id 以发送存在于 Telegram 服务器上的文件(推荐),传递 HTTP URL 让 Telegram 从互联网获取文件,或传递 “attach://” 以使用 multipart/form-data 在 名称下上传新文件。更多关于发送文件的信息 » |
thumbnail 缩略图 | String 字符串 | Optional. 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>. More information on Sending Files » 可选。发送文件的缩略图;如果服务器端支持文件的缩略图生成,则可以忽略。缩略图应为 JPEG 格式,大小应小于 200 kB。缩略图的宽度和高度不应超过 320。如果文件不是使用 multipart/form-data 上传的,则忽略。缩略图不能重复使用,只能作为新文件上传,因此如果缩略图是使用 multipart/form-data 在 下上传的,您可以传递 “attach://”。更多关于发送文件的信息 » |
cover 封面 | String 字符串 | Optional. Cover for the video in the message. 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. More information on Sending Files » 可选。消息中视频的封面。传递 file_id 以发送存在于 Telegram 服务器上的文件(推荐),传递 HTTP URL 让 Telegram 从互联网获取文件,或传递 “attach://” 以使用 multipart/form-data 在 名称下上传新文件。更多关于发送文件的信息 » |
start_timestamp | Integer 整数 | Optional. Start timestamp for the video in the message 可选。消息中视频的开始时间戳 |
width 宽度 | Integer 整数 | Optional. Video width 可选。视频宽度 |
height 高度 | Integer 整数 | Optional. Video height 可选。视频高度 |
duration 持续时间 | Integer 整数 | Optional. Video duration in seconds 可选。视频时长(秒) |
supports_streaming 支持流媒体 | Boolean 布尔值 | Optional. Pass True if the uploaded video is suitable for streaming 可选。如果上传的视频适合流媒体传输,请传入 True |
There are three ways to send files (photos, stickers, audio, media, etc.):
发送文件(照片、贴纸、音频、媒体等)有三种方式:
Sending by file_id 通过 file_id 发送
Sending by URL 通过 URL 发送
Colors with identifiers 0 (red), 1 (orange), 2 (purple/violet), 3 (green), 4 (cyan), 5 (blue), 6 (pink) can be customized by app themes. Additionally, the following colors in RGB format are currently in use.
标识符为 0(红色)、1(橙色)、2(紫色/紫罗兰色)、3(绿色)、4(青色)、5(蓝色)、6(粉红色)的颜色可以由应用主题自定义。此外,以下 RGB 格式的颜色目前正在使用。
Color identifier 颜色标识符 | Light colors 浅色 | Dark colors 深色 |
---|---|---|
7 | E15052 F9AE63 | FF9380 992F37 |
8 | E0802B FAC534 | ECB04E C35714 |
9 | A05FF3 F48FFF | C697FF 5E31C8 |
10 | 27A910 A7DC57 | A7EB6E 167E2D |
11 | 27ACCE 82E8D6 | 40D8D0 045C7F |
12 | 3391D4 7DD3F0 | 52BFFF 0B5494 |
13 | DD4371 FFBE9F | FF86A6 8E366E |
14 | 247BED F04856 FFFFFF | 3FA2FE E5424F FFFFFF |
15 | D67722 1EA011 FFFFFF | FF905E 32A527 FFFFFF |
16 | 179E42 E84A3F FFFFFF | 66D364 D5444F FFFFFF |
17 | 2894AF 6FC456 FFFFFF | 22BCE2 3DA240 FFFFFF |
18 | 0C9AB3 FFAD95 FFE6B5 | 22BCE2 FF9778 FFDA6B |
19 | 7757D6 F79610 FFDE8E | 9791FF F2731D FFDB59 |
20 | 1585CF F2AB1D FFFFFF | 3DA6EB EEA51D FFFFFF |
Currently, the following colors in RGB format are in use for profile backgrounds.
目前,以下 RGB 格式的颜色用于个人资料背景。
Color identifier 颜色标识符 | Light colors 浅色 | Dark colors 深色 |
---|---|---|
0 | BA5650 | 9C4540 |
1 | C27C3E | 945E2C |
2 | 956AC8 | 715099 |
3 | 49A355 | 33713B |
4 | 3E97AD | 387E87 |
5 | 5A8FBB | 477194 |
6 | B85378 | 944763 |
7 | 7F8B95 | 435261 |
8 | C9565D D97C57 | 994343 AC583E |
9 | CF7244 CC9433 | 8F552F A17232 |
10 | 9662D4 B966B6 | 634691 9250A2 |
11 | 3D9755 89A650 | 296A43 5F8F44 |
12 | 3D95BA 50AD98 | 306C7C 3E987E |
13 | 538BC2 4DA8BD | 38618C 458BA1 |
14 | B04F74 D1666D | 884160 A65259 |
15 | 637482 7B8A97 | 53606E 384654 |
Objects and methods used in the inline mode are described in the Inline mode section.
内联模式中使用的对象和方法在内联模式部分中有描述。
All methods in the Bot API are case-insensitive. We support GET and POST HTTP methods. Use either URL query string or application/json or application/x-www-form-urlencoded or multipart/form-data for passing parameters in Bot API requests.
Bot API 中的所有方法不区分大小写。我们支持 GET 和 POST HTTP 方法。使用 URL 查询字符串或 application/json 或 application/x-www-form-urlencoded 或 multipart/form-data 来传递 Bot API 请求中的参数。
On successful call, a JSON-object containing the result will be returned.
调用成功时,将返回包含结果的 JSON 对象。
A simple method for testing your bot's authentication token. Requires no parameters. Returns basic information about the bot in form of a User object.
一种测试机器人身份验证令牌的简单方法。不需要参数。返回关于机器人的基本信息,以 User 对象的形式。
Use this method to log out from the cloud Bot API server before launching the bot locally. You must 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 True on success. Requires no parameters.
使用此方法在本地启动机器人之前从云 Bot API 服务器注销。必须在本地运行机器人之前注销机器人,否则无法保证机器人会接收到更新。成功调用后,您可以立即在本地服务器上登录,但 10 分钟内无法重新登录到云 Bot API 服务器。成功时返回 True。不需要参数。
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 True on success. Requires no parameters.
使用此方法在将机器人从一个本地服务器移动到另一个之前关闭机器人实例。在调用此方法之前需要删除 webhook,以确保服务器重启后机器人不会再次启动。在机器人启动后的前 10 分钟内,此方法将返回错误 429。成功时返回 True。不需要参数。
Use this method to send text messages. On success, the sent Message is returned.
使用此方法发送文本消息。成功时,返回已发送的消息。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
business_connection_id 业务连接 ID | String 字符串 | Optional 可选 | Unique identifier of the business connection on behalf of which the message will be sent 将要代表其发送消息的业务连接的唯一标识符 |
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target chat or username of the target channel (in the format @channelusername )目标聊天或目标频道的用户名的唯一标识符(格式为 @channelusername ) |
message_thread_id | Integer 整数 | Optional 可选 | Unique identifier for the target message thread (topic) of the forum; for forum supergroups only 论坛目标消息线程(主题)的唯一标识符;仅适用于论坛超级群组 |
text 文本 | String 字符串 | Yes 是 | Text of the message to be sent, 1-4096 characters after entities parsing 要发送的消息文本,实体解析后为 1-4096 个字符 |
parse_mode 解析模式 | String 字符串 | Optional 可选 | Mode for parsing entities in the message text. See formatting options for more details. 解析消息文本中实体的模式。有关更多详细信息,请参阅格式化选项。 |
entities 实体 | Array of MessageEntity MessageEntity 数组 | Optional 可选 | A JSON-serialized list of special entities that appear in message text, which can be specified instead of parse_mode 消息文本中出现的特殊实体的 JSON 序列化列表,可以替代 parse_mode 指定 |
link_preview_options | LinkPreviewOptions 链接预览选项 | Optional 可选 | Link preview generation options for the message 消息的链接预览生成选项 |
disable_notification 禁用通知 | Boolean 布尔值 | Optional 可选 | Sends the message silently. Users will receive a notification with no sound. 静默发送消息。用户将收到无声通知。 |
protect_content 保护内容 | Boolean 布尔值 | Optional 可选 | Protects the contents of the sent message from forwarding and saving 保护发送的消息内容,防止转发和保存 |
allow_paid_broadcast 允许付费广播 | Boolean 布尔值 | Optional 可选 | Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance 传递 True 以允许每秒发送高达 1000 条消息,忽略广播限制,每条消息收取 0.1 个 Telegram Stars 的费用。相关 Stars 将从机器人的余额中扣除 |
message_effect_id 消息效果 ID | String 字符串 | Optional 可选 | Unique identifier of the message effect to be added to the message; for private chats only 要添加到消息中的消息效果的唯一标识符;仅限私人聊天 |
reply_parameters 回复参数 | ReplyParameters 回复参数 | Optional 可选 | Description of the message to reply to 回复消息的描述 |
reply_markup | InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply InlineKeyboardMarkup 或 ReplyKeyboardMarkup 或 ReplyKeyboardRemove 或 ForceReply |
Optional 可选 | Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user 附加界面选项。一个用于内联键盘、自定义回复键盘、移除回复键盘或强制用户回复的 JSON 序列化对象 |
The Bot API supports basic formatting for messages. You can use bold, italic, underlined, strikethrough, spoiler text, block quotations 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.
Bot API 支持消息的基本格式。你可以在机器人的消息中使用粗体、斜体、下划线、删除线、剧透文本、块引用以及内联链接和预格式化代码。Telegram 客户端将相应地渲染它们。你可以直接指定文本实体,或者使用 markdown 风格或 HTML 风格的格式。
Note that Telegram clients will display an alert to the user before opening an inline link ('Open this link?' together with the full URL).
请注意,Telegram 客户端在打开内联链接之前会向用户显示一个警报(“打开此链接?”连同完整的 URL)。
Message entities can be nested, providing following restrictions are met:
消息实体可以嵌套,前提是满足以下限制:
- If two entities have common characters, then one of them is fully contained inside another.
- 如果两个实体有共同的字符,那么其中一个必须完全包含在另一个内部。
- bold, italic, underline, strikethrough, and spoiler entities can contain and can be part of any other entities, except pre and code.
- 粗体、斜体、下划线、删除线和剧透实体可以包含在其他实体中,也可以是其他实体的组成部分,但 pre 和 code 除外。
- blockquote and expandable_blockquote entities can't be nested.
- blockquote 和 expandable_blockquote 实体不能嵌套。
- All other entities can't contain each other.
- 所有其他实体不能相互包含。
Links tg://user?id=<user_id>
can be used to mention a user by their identifier without using a username. Please note:
链接 tg://user?id=<user_id>
可以用来通过标识符提及用户,而无需使用用户名。请注意:
You can find the list of programming and markup languages for which syntax highlighting is supported at libprisma#supported-languages.
您可以在 libprisma#supported-languages 找到支持语法高亮的编程和标记语言列表。
To use this mode, pass MarkdownV2 in the parse_mode field. Use the following syntax in your message:
要使用此模式,请在 parse_mode 字段中传递 MarkdownV2。在您的消息中使用以下语法:
*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)

`inline fixed-width code`
```
pre-formatted fixed-width code block
```
```python
pre-formatted fixed-width code block written in the Python programming language
```
>Block quotation started
>Block quotation continued
>Block quotation continued
>Block quotation continued
>The last line of the block quotation
**>The expandable block quotation started right after the previous block quotation
>It is separated from the previous block quotation by an empty bold entity
>Expandable block quotation continued
>Hidden by default part of the expandable block quotation started
>Expandable block quotation continued
>The last line of the expandable block quotation with the expandability mark||
Please note: 请注意:
pre
and code
entities, all '`' and '\' characters must be escaped with a preceding '\' character.pre
和 code
实体中,所有'`'和'\'字符必须使用前面的'\'字符进行转义。(...)
part of the inline link and custom emoji definition, all ')' and '\' must be escaped with a preceding '\' character.(...)
部分中,所有')'和'\'必须使用前面的'\'字符进行转义。italic
and underline
entities __
is always greadily treated from left to right as beginning or end of an underline
entity, so instead of ___italic underline___
use ___italic underline_**__
, adding an empty bold entity as a separator.italic
和 underline
实体之间存在歧义的情况下, __
总是从左到右被贪婪地视为 underline
实体的开始或结束,因此不要使用 ___italic underline___
,而是使用 ___italic underline_**__
,添加一个空的粗体实体作为分隔符。To use this mode, pass HTML in the parse_mode field. The following tags are currently supported:
要使用此模式,请在 parse_mode 字段中传入 HTML。目前支持以下标签:
<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">
</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>
<blockquote>Block quotation started\nBlock quotation continued\nThe last line of the block quotation</blockquote>
<blockquote expandable>Expandable block quotation started\nExpandable block quotation continued\nExpandable block quotation continued\nHidden by default part of the block quotation started\nExpandable block quotation continued\nThe last line of the block quotation</blockquote>
Please note: 请注意:
<
, >
and &
symbols that are not a part of a tag or an HTML entity must be replaced with the corresponding HTML entities (<
with <
, >
with >
and &
with &
).<
、 >
和 &
符号必须替换为相应的 HTML 实体( <
替换为 <
, >
替换为 >
, &
替换为 &
)。<
, >
, &
and "
.<
、 >
、 &
和 "
。pre
and code
tags, to define programming language for pre
entity.pre
和 code
标签,为 pre
实体定义编程语言。code
tags.code
标签无法指定编程语言。tg-emoji
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 emoji field of the custom emoji sticker.tg-emoji
标签的内容必须使用有效的 emoji。emoji 将在无法显示自定义 emoji 的地方(例如系统通知)或消息被非高级用户转发时显示。建议使用自定义 emoji 贴纸的 emoji 字段中的 emoji。This is a legacy mode, retained for backward compatibility. To use this mode, pass Markdown in the parse_mode field. Use the following syntax in your message:
这是一个遗留模式,保留用于向后兼容。要使用此模式,请在 parse_mode 字段中传递 Markdown。在您的消息中使用以下语法:
*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
```
Please note: 请注意:
_snake_\__case_
for italic snake_case
and *2*\**2=4*
for bold 2*2=4
._snake_\__case_
表示斜体 snake_case
和 *2*\**2=4*
表示粗体 2*2=4
。By default, all bots are able to broadcast up to 30 messages per second to their users. Developers can increase this limit by enabling Paid Broadcasts in @Botfather - allowing their bot to broadcast up to 1000 messages per second.
默认情况下,所有机器人都可以每秒向用户广播最多 30 条消息。开发者可以通过在@Botfather 中启用付费广播来增加此限制,使他们的机器人每秒可以广播最多 1000 条消息。
Each message broadcasted over the free amount of 30 messages per second incurs a cost of 0.1 Stars per message, paid with Telegram Stars from the bot's balance. In order to use this feature, a bot must have at least 10,000 Stars on its balance.
每秒超过免费的 30 条消息的每条广播消息需支付 0.1 星,每条消息的费用从机器人的余额中以电报星支付。为了使用此功能,机器人的余额必须至少有 10,000 星。
Bots with increased limits are only charged for messages that are broadcasted successfully.
增加了限制的机器人只对成功广播的消息收费。
Use this method to forward messages of any kind. Service messages and messages with protected content can't be forwarded. On success, the sent Message is returned.
使用此方法转发任何类型的消息。服务消息和包含受保护内容的消息无法转发。成功时,返回发送的消息。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target chat or username of the target channel (in the format @channelusername )目标聊天或目标频道的用户名的唯一标识符(格式为 @channelusername ) |
message_thread_id | Integer 整数 | Optional 可选 | Unique identifier for the target message thread (topic) of the forum; for forum supergroups only 论坛目标消息线程(主题)的唯一标识符;仅适用于论坛超级群组 |
from_chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the chat where the original message was sent (or channel username in the format @channelusername )发送原始消息的聊天的唯一标识符(或频道用户名,格式为 @channelusername ) |
video_start_timestamp | Integer 整数 | Optional 可选 | New start timestamp for the forwarded video in the message 消息中转发视频的新开始时间戳 |
disable_notification 禁用通知 | Boolean 布尔值 | Optional 可选 | Sends the message silently. Users will receive a notification with no sound. 静默发送消息。用户将收到无声通知。 |
protect_content 保护内容 | Boolean 布尔值 | Optional 可选 | Protects the contents of the forwarded message from forwarding and saving 保护转发消息的内容免于转发和保存 |
message_id 消息 ID | Integer 整数 | Yes 是 | Message identifier in the chat specified in from_chat_id 在 from_chat_id 指定的聊天中消息的标识符 |
Use this method to forward multiple messages of any kind. If some of the specified messages can't be found or forwarded, they are skipped. Service messages and messages with protected content can't be forwarded. Album grouping is kept for forwarded messages. On success, an array of MessageId of the sent messages is returned.
使用此方法转发多种类型的消息。如果某些指定的消息无法找到或无法转发,则会跳过这些消息。服务消息和包含受保护内容的消息无法转发。转发的消息会保留相册分组。成功时,返回发送消息的 MessageId 数组。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target chat or username of the target channel (in the format @channelusername )目标聊天的唯一标识符或目标频道的用户名(格式为 @channelusername ) |
message_thread_id | Integer 整数 | Optional 可选 | Unique identifier for the target message thread (topic) of the forum; for forum supergroups only 论坛中目标消息线程(主题)的唯一标识符;仅适用于论坛超级群组 |
from_chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the chat where the original messages were sent (or channel username in the format @channelusername )原始消息发送的聊天的唯一标识符(或频道用户名,格式为 @channelusername ) |
message_ids 消息 ID | Array of Integer 整数数组 | Yes 是 | A JSON-serialized list of 1-100 identifiers of messages in the chat from_chat_id to forward. The identifiers must be specified in a strictly increasing order. 从聊天 from_chat_id 中转发的 1-100 条消息的 JSON 序列化标识符列表。这些标识符必须按严格递增的顺序指定。 |
disable_notification 禁用通知 | Boolean 布尔值 | Optional 可选 | Sends the messages silently. Users will receive a notification with no sound. 静默发送消息。用户将收到无声通知。 |
protect_content 保护内容 | Boolean 布尔值 | Optional 可选 | Protects the contents of the forwarded messages from forwarding and saving 保护转发消息的内容,防止转发和保存 |
Use this method to copy messages of any kind. Service messages, paid media messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessage, but the copied message doesn't have a link to the original message. Returns the MessageId of the sent message on success.
使用此方法可以复制任何类型的消息。服务消息、付费媒体消息、赠品消息、赠品获胜者消息和发票消息无法复制。只有当机器人知道字段 correct_option_id 的值时,才能复制测验投票。此方法类似于 forwardMessage 方法,但复制的消息没有指向原始消息的链接。成功时返回发送消息的 MessageId。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target chat or username of the target channel (in the format @channelusername )目标聊天或目标频道的用户名的唯一标识符(格式为 @channelusername ) |
message_thread_id | Integer 整数 | Optional 可选 | Unique identifier for the target message thread (topic) of the forum; for forum supergroups only 论坛目标消息线程(主题)的唯一标识符;仅适用于论坛超级群组 |
from_chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the chat where the original message was sent (or channel username in the format @channelusername )发送原始消息的聊天的唯一标识符(或频道用户名,格式为 @channelusername ) |
message_id 消息 ID | Integer 整数 | Yes 是 | Message identifier in the chat specified in from_chat_id 在 from_chat_id 指定的聊天中的消息标识符 |
video_start_timestamp 视频开始时间戳 | Integer 整数 | Optional 可选 | New start timestamp for the copied video in the message 复制视频的新开始时间戳在消息中 |
caption 标题 | String 字符串 | Optional 可选 | New caption for media, 0-1024 characters after entities parsing. If not specified, the original caption is kept 媒体新标题,实体解析后 0-1024 个字符。如果未指定,则保留原始标题 |
parse_mode 解析模式 | String 字符串 | Optional 可选 | Mode for parsing entities in the new caption. See formatting options for more details. 解析新标题中实体的模式。查看格式化选项以获取更多详情。 |
caption_entities | Array of MessageEntity MessageEntity 数组 | Optional 可选 | A JSON-serialized list of special entities that appear in the new caption, which can be specified instead of parse_mode 一个 JSON 序列化的特殊实体列表,这些实体出现在新标题中,可以替代 parse_mode 指定 |
show_caption_above_media 在媒体上方显示标题 |
Boolean 布尔值 | Optional 可选 | Pass True, if the caption must be shown above the message media. Ignored if a new caption isn't specified. 如果必须在消息媒体上方显示标题,则传入 True。如果未指定新标题,则忽略此参数。 |
disable_notification 禁用通知 | Boolean 布尔值 | Optional 可选 | Sends the message silently. Users will receive a notification with no sound. 静默发送消息。用户将收到无声通知。 |
protect_content 保护内容 | Boolean 布尔值 | Optional 可选 | Protects the contents of the sent message from forwarding and saving 保护发送的消息内容,防止转发和保存 |
allow_paid_broadcast 允许付费广播 | Boolean 布尔值 | Optional 可选 | Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance 传入 True 以允许每秒发送高达 1000 条消息,忽略广播限制,每条消息收取 0.1 个 Telegram 星星费用。相关星星将从机器人的余额中扣除。 |
reply_parameters 回复参数 | ReplyParameters 回复参数 | Optional 可选 | Description of the message to reply to 要回复的消息的描述 |
reply_markup | InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply InlineKeyboardMarkup 或 ReplyKeyboardMarkup 或 ReplyKeyboardRemove 或 ForceReply |
Optional 可选 | Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user 附加界面选项。一个用于内联键盘、自定义回复键盘、移除回复键盘或强制用户回复的 JSON 序列化对象 |
Use this method to copy messages of any kind. If some of the specified messages can't be found or copied, they are skipped. Service messages, paid media messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessages, but the copied messages don't have a link to the original message. Album grouping is kept for copied messages. On success, an array of MessageId of the sent messages is returned.
使用此方法复制任何类型的消息。如果某些指定的消息无法找到或复制,它们将被跳过。服务消息、付费媒体消息、赠品消息、赠品获胜者消息和发票消息无法复制。只有当机器人知道字段 correct_option_id 的值时,测验投票才能被复制。该方法类似于 forwardMessages 方法,但复制的消息没有指向原始消息的链接。复制的消息保持相册分组。成功时,返回发送的消息的 MessageId 数组。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target chat or username of the target channel (in the format @channelusername )目标聊天的唯一标识符或目标频道的用户名(格式为 @channelusername ) |
message_thread_id | Integer 整数 | Optional 可选 | Unique identifier for the target message thread (topic) of the forum; for forum supergroups only 论坛目标消息线程(主题)的唯一标识符;仅适用于论坛超级群组 |
from_chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the chat where the original messages were sent (or channel username in the format @channelusername )发送原始消息的聊天的唯一标识符(或频道用户名,格式为 @channelusername ) |
message_ids | Array of Integer 整数数组 | Yes 是 | A JSON-serialized list of 1-100 identifiers of messages in the chat from_chat_id to copy. The identifiers must be specified in a strictly increasing order. 从 from_chat_id 聊天中要复制的 1-100 条消息的 JSON 序列化标识符列表。标识符必须按严格递增的顺序指定。 |
disable_notification 禁用通知 | Boolean 布尔值 | Optional 可选 | Sends the messages silently. Users will receive a notification with no sound. 静默发送消息。用户将收到无声通知。 |
protect_content 保护内容 | Boolean 布尔值 | Optional 可选 | Protects the contents of the sent messages from forwarding and saving 保护发送消息的内容,防止转发和保存 |
remove_caption 移除标题 | Boolean 布尔值 | Optional 可选 | Pass True to copy the messages without their captions 将 True 传递给复制消息而不带其标题 |
Use this method to send photos. On success, the sent Message is returned.
使用此方法发送照片。成功时,返回已发送的消息。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
business_connection_id 业务连接 ID | String 字符串 | Optional 可选 | Unique identifier of the business connection on behalf of which the message will be sent 代表将要发送消息的业务连接的唯一标识符 |
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target chat or username of the target channel (in the format @channelusername )目标聊天或目标频道的用户名的唯一标识符(格式为 @channelusername ) |
message_thread_id | Integer 整数 | Optional 可选 | Unique identifier for the target message thread (topic) of the forum; for forum supergroups only 论坛目标消息线程(主题)的唯一标识符;仅适用于论坛超级群组 |
photo 照片 | InputFile or String InputFile 或 String | Yes 是 | 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. More information on Sending Files » 要发送的照片。传递一个文件 ID 作为字符串以发送存在于 Telegram 服务器上的照片(推荐),传递一个 HTTP URL 作为字符串让 Telegram 从互联网获取照片,或者使用 multipart/form-data 上传新照片。照片大小不得超过 10 MB。照片的宽度和高度总和不得超过 10000。宽高比不得超过 20。更多关于发送文件的信息请查看»发送文件 |
caption 标题 | String 字符串 | Optional 可选 | Photo caption (may also be used when resending photos by file_id), 0-1024 characters after entities parsing 照片说明(也可在通过文件 ID 重新发送照片时使用),实体解析后的字符数为 0-1024 |
parse_mode | String 字符串 | Optional 可选 | Mode for parsing entities in the photo caption. See formatting options for more details. 解析照片说明中实体的模式。查看格式化选项以获取更多详情。 |
caption_entities | Array of MessageEntity MessageEntity 数组 | Optional 可选 | A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode 一个 JSON 序列化的特殊实体列表,这些实体出现在说明中,可以替代 parse_mode 指定 |
show_caption_above_media 在媒体上方显示标题 |
Boolean 布尔值 | Optional 可选 | Pass True, if the caption must be shown above the message media 如果说明必须显示在消息媒体上方,请传递 True |
has_spoiler 有剧透 | Boolean 布尔值 | Optional 可选 | Pass True if the photo needs to be covered with a spoiler animation 如果照片需要用剧透动画覆盖,请传递 True |
disable_notification 禁用通知 | Boolean 布尔值 | Optional 可选 | Sends the message silently. Users will receive a notification with no sound. 静默发送消息。用户将收到无声音的通知。 |
protect_content 保护内容 | Boolean 布尔值 | Optional 可选 | Protects the contents of the sent message from forwarding and saving 保护发送的消息内容不被转发和保存 |
allow_paid_broadcast 允许付费广播 | Boolean 布尔值 | Optional 可选 | Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance 将 True 传递给每秒允许最多 1000 条消息,忽略广播限制,每条消息收取 0.1 Telegram Stars 的费用。相关 Stars 将从机器人的余额中扣除。 |
message_effect_id 消息效果 ID | String 字符串 | Optional 可选 | Unique identifier of the message effect to be added to the message; for private chats only 要添加到消息中的消息效果的唯一标识符;仅限私人聊天 |
reply_parameters 回复参数 | ReplyParameters 回复参数 | Optional 可选 | Description of the message to reply to 要回复的消息描述 |
reply_markup 回复标记 | InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply InlineKeyboardMarkup 或 ReplyKeyboardMarkup 或 ReplyKeyboardRemove 或 ForceReply |
Optional 可选 | Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user 附加界面选项。一个用于内联键盘、自定义回复键盘、移除回复键盘或强制用户回复的 JSON 序列化对象 |
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 Message is returned. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future.
使用此方法发送音频文件,如果您希望 Telegram 客户端在音乐播放器中显示它们。您的音频必须为.MP3 或.M4A 格式。成功时,将返回发送的消息。目前,机器人可以发送大小不超过 50 MB 的音频文件,此限制将来可能会更改。
For sending voice messages, use the sendVoice method instead.
要发送语音消息,请改用 sendVoice 方法。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
business_connection_id 业务连接 ID | String 字符串 | Optional 可选 | Unique identifier of the business connection on behalf of which the message will be sent 代表将要发送消息的业务连接的唯一标识符 |
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target chat or username of the target channel (in the format @channelusername )目标聊天或目标频道用户名的唯一标识符(格式为 @channelusername ) |
message_thread_id | Integer 整数 | Optional 可选 | Unique identifier for the target message thread (topic) of the forum; for forum supergroups only 论坛目标消息线程(主题)的唯一标识符;仅适用于论坛超级群组 |
audio 音频 | InputFile or String InputFile 或 String | Yes 是 | 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. More information on Sending Files » 要发送的音频文件。传递一个文件 ID 作为字符串以发送存在于 Telegram 服务器上的音频文件(推荐),传递一个 HTTP URL 作为字符串让 Telegram 从互联网获取音频文件,或者使用 multipart/form-data 上传一个新的音频文件。有关发送文件的更多信息,请参见“发送文件”» |
caption 标题 | String 字符串 | Optional 可选 | Audio caption, 0-1024 characters after entities parsing 音频标题,实体解析后的 0-1024 个字符 |
parse_mode | String 字符串 | Optional 可选 | Mode for parsing entities in the audio caption. See formatting options for more details. 解析音频标题中实体的模式。有关格式化选项的更多详细信息,请参见。 |
caption_entities | Array of MessageEntity MessageEntity 数组 | Optional 可选 | A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode 标题中出现的特殊实体的 JSON 序列化列表,可以代替 parse_mode 指定 |
duration 持续时间 | Integer 整数 | Optional 可选 | Duration of the audio in seconds 音频的持续时间,单位为秒 |
performer 执行者 | String 字符串 | Optional 可选 | Performer 执行者 |
title 标题 | String 字符串 | Optional 可选 | Track name 曲目名称 |
thumbnail 缩略图 | InputFile or String 输入文件或字符串 | Optional 可选 | 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>. More information on Sending Files » 发送文件的缩略图;如果服务器端支持文件缩略图生成,则可以忽略。缩略图应为 JPEG 格式,大小应小于 200 kB。缩略图的宽度和高度不应超过 320。如果文件不是使用 multipart/form-data 上传的,则忽略此项。缩略图不能重复使用,只能作为新文件上传,因此如果缩略图是使用 multipart/form-data 在下上传的,您可以传递“attach://”。更多关于发送文件的信息» |
disable_notification 禁用通知 | Boolean 布尔值 | Optional 可选 | Sends the message silently. Users will receive a notification with no sound. 静默发送消息。用户将收到无声通知。 |
protect_content 保护内容 | Boolean 布尔值 | Optional 可选 | Protects the contents of the sent message from forwarding and saving 保护发送的消息内容不被转发和保存 |
allow_paid_broadcast | Boolean 布尔值 | Optional 可选 | Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance 传递 True 以允许每秒发送高达 1000 条消息,忽略广播限制,每条消息收取 0.1 个 Telegram Stars 的费用。相关 Stars 将从机器人的余额中扣除 |
message_effect_id 消息效果 ID | String 字符串 | Optional 可选 | Unique identifier of the message effect to be added to the message; for private chats only 要添加到消息中的消息效果的唯一标识符;仅限私人聊天 |
reply_parameters 回复参数 | ReplyParameters 回复参数 | Optional 可选 | Description of the message to reply to 要回复的消息描述 |
reply_markup 回复标记 | InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply InlineKeyboardMarkup 或 ReplyKeyboardMarkup 或 ReplyKeyboardRemove 或 ForceReply |
Optional 可选 | Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user 额外的界面选项。一个用于内联键盘、自定义回复键盘、移除回复键盘或强制用户回复的 JSON 序列化对象 |
Use this method to send general files. On success, the sent Message 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.
使用此方法发送一般文件。成功时,返回发送的消息。机器人目前可以发送大小不超过 50 MB 的任何类型的文件,此限制将来可能会更改。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
business_connection_id 业务连接 ID | String 字符串 | Optional 可选 | Unique identifier of the business connection on behalf of which the message will be sent 将要代表其发送消息的业务连接的唯一标识符 |
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target chat or username of the target channel (in the format @channelusername )目标聊天或目标频道的用户名的唯一标识符(格式为 @channelusername ) |
message_thread_id | Integer 整数 | Optional 可选 | Unique identifier for the target message thread (topic) of the forum; for forum supergroups only 论坛目标消息线程(主题)的唯一标识符;仅适用于论坛超级群组 |
document 文档 | InputFile or String InputFile 或 String | Yes 是 | 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. More information on Sending Files » 要发送的文件。传递一个 file_id 作为 String 来发送存在于 Telegram 服务器上的文件(推荐),传递一个 HTTP URL 作为 String 让 Telegram 从互联网获取文件,或者使用 multipart/form-data 上传一个新文件。更多关于发送文件的信息 » |
thumbnail 缩略图 | InputFile or String InputFile 或 String | Optional 可选 | 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>. More information on Sending Files » 发送文件的缩略图;如果服务器端支持生成文件的缩略图,则可以忽略此项。缩略图应为 JPEG 格式,大小应小于 200 kB。缩略图的宽度和高度不应超过 320。如果文件不是使用 multipart/form-data 上传的,则忽略此项。缩略图不能重复使用,只能作为新文件上传,因此如果缩略图是使用 multipart/form-data 在下上传的,您可以传递“attach://”。更多关于发送文件的信息请参见» |
caption 标题 | String 字符串 | Optional 可选 | Document caption (may also be used when resending documents by file_id), 0-1024 characters after entities parsing 文档标题(也可在通过 file_id 重新发送文档时使用),实体解析后的字符数为 0-1024 |
parse_mode | String 字符串 | Optional 可选 | Mode for parsing entities in the document caption. See formatting options for more details. 解析文档标题中实体的模式。有关格式化选项的更多详细信息,请参见。 |
caption_entities | Array of MessageEntity MessageEntity 数组 | Optional 可选 | A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode 标题中出现的特殊实体的 JSON 序列化列表,可以代替 parse_mode 指定 |
disable_content_type_detection 禁用内容类型检测 |
Boolean 布尔值 | Optional 可选 | Disables automatic server-side content type detection for files uploaded using multipart/form-data 禁用使用 multipart/form-data 上传文件的服务器端自动内容类型检测 |
disable_notification 禁用通知 | Boolean 布尔值 | Optional 可选 | Sends the message silently. Users will receive a notification with no sound. 静默发送消息。用户将收到无声通知。 |
protect_content 保护内容 | Boolean 布尔值 | Optional 可选 | Protects the contents of the sent message from forwarding and saving 保护发送的消息内容不被转发和保存 |
allow_paid_broadcast 允许付费广播 | Boolean 布尔值 | Optional 可选 | Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance 传递 True 以允许每秒发送最多 1000 条消息,忽略广播限制,每条消息收取 0.1 个 Telegram Stars 的费用。相关 Stars 将从机器人的余额中扣除 |
message_effect_id 消息效果 ID | String 字符串 | Optional 可选 | Unique identifier of the message effect to be added to the message; for private chats only 要添加到消息中的消息效果的唯一标识符;仅限私人聊天 |
reply_parameters 回复参数 | ReplyParameters 回复参数 | Optional 可选 | Description of the message to reply to 要回复的消息描述 |
reply_markup 回复标记 | InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply InlineKeyboardMarkup 或 ReplyKeyboardMarkup 或 ReplyKeyboardRemove 或 ForceReply |
Optional 可选 | Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user 附加界面选项。一个用于内联键盘、自定义回复键盘、移除回复键盘或强制用户回复的 JSON 序列化对象 |
Use this method to send video files, Telegram clients support MPEG4 videos (other formats may be sent as Document). On success, the sent Message is returned. Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future.
使用此方法发送视频文件,Telegram 客户端支持 MPEG4 视频(其他格式可能作为文档发送)。成功时,返回发送的消息。机器人目前可以发送大小不超过 50 MB 的视频文件,此限制将来可能会更改。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
business_connection_id 业务连接 ID | String 字符串 | Optional 可选 | Unique identifier of the business connection on behalf of which the message will be sent 将要代表其发送消息的业务连接的唯一标识符 |
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target chat or username of the target channel (in the format @channelusername )目标聊天或目标频道的用户名的唯一标识符(格式为 @channelusername ) |
message_thread_id | Integer 整数 | Optional 可选 | Unique identifier for the target message thread (topic) of the forum; for forum supergroups only 论坛目标消息线程(主题)的唯一标识符;仅适用于论坛超级群组 |
video 视频 | InputFile or String 输入文件或字符串 | Yes 是 | 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. More information on Sending Files » 要发送的视频。传递一个文件 ID 作为字符串以发送存在于 Telegram 服务器上的视频(推荐),传递一个 HTTP URL 作为字符串让 Telegram 从互联网获取视频,或者使用 multipart/form-data 上传新视频。更多关于发送文件的信息» |
duration 持续时间 | Integer 整数 | Optional 可选 | Duration of sent video in seconds 发送视频的持续时间(秒) |
width 宽度 | Integer 整数 | Optional 可选 | Video width 视频宽度 |
height 高度 | Integer 整数 | Optional 可选 | Video height 视频高度 |
thumbnail 缩略图 | InputFile or String InputFile 或 String | Optional 可选 | 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>. More information on Sending Files » 发送文件的缩略图;如果服务器端支持文件的缩略图生成,则可以忽略此项。缩略图应为 JPEG 格式,大小应小于 200 kB。缩略图的宽度和高度不应超过 320。如果文件不是使用 multipart/form-data 上传的,则忽略此项。缩略图不能重复使用,只能作为新文件上传,因此如果缩略图是使用 multipart/form-data 在 下上传的,您可以传递“attach://”。更多关于发送文件的信息请参见《发送文件》» |
cover 封面 | InputFile or String InputFile 或 String | Optional 可选 | Cover for the video in the message. 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. More information on Sending Files » 消息中视频的封面。传递 file_id 以发送存在于 Telegram 服务器上的文件(推荐),传递 HTTP URL 让 Telegram 从互联网获取文件,或者传递“attach://”以使用 multipart/form-data 在 名称下上传新的文件。更多关于发送文件的信息请参见《发送文件》» |
start_timestamp | Integer 整数 | Optional 可选 | Start timestamp for the video in the message 消息中视频的开始时间戳 |
caption 标题 | String 字符串 | Optional 可选 | Video caption (may also be used when resending videos by file_id), 0-1024 characters after entities parsing 视频标题(也可在通过 file_id 重新发送视频时使用),实体解析后 0-1024 个字符 |
parse_mode | String 字符串 | Optional 可选 | Mode for parsing entities in the video caption. See formatting options for more details. 解析视频标题中实体的模式。有关更多详细信息,请参阅格式化选项。 |
caption_entities | Array of MessageEntity MessageEntity 数组 | Optional 可选 | A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode 一个在标题中出现的特殊实体的 JSON 序列化列表,可以替代 parse_mode 来指定 |
show_caption_above_media 在媒体上方显示标题 |
Boolean 布尔值 | Optional 可选 | Pass True, if the caption must be shown above the message media 如果必须在消息媒体上方显示标题,请传递 True |
has_spoiler 有剧透 | Boolean 布尔值 | Optional 可选 | Pass True if the video needs to be covered with a spoiler animation 如果视频需要用剧透动画覆盖,请传递 True |
supports_streaming 支持流媒体 | Boolean 布尔值 | Optional 可选 | Pass True if the uploaded video is suitable for streaming 如果上传的视频适合流媒体播放,则传入 True |
disable_notification | Boolean 布尔值 | Optional 可选 | Sends the message silently. Users will receive a notification with no sound. 静默发送消息。用户将收到无声通知。 |
protect_content 保护内容 | Boolean 布尔值 | Optional 可选 | Protects the contents of the sent message from forwarding and saving 保护发送的消息内容不被转发和保存 |
allow_paid_broadcast | Boolean 布尔值 | Optional 可选 | Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance 将 True 传递给每秒允许最多 1000 条消息,忽略广播限制,每条消息收取 0.1 Telegram Stars 的费用。相关 Stars 将从机器人的余额中扣除。 |
message_effect_id 消息效果 ID | String 字符串 | Optional 可选 | Unique identifier of the message effect to be added to the message; for private chats only 要添加到消息中的消息效果的唯一标识符;仅限私人聊天 |
reply_parameters 回复参数 | ReplyParameters 回复参数 | Optional 可选 | Description of the message to reply to 要回复的消息描述 |
reply_markup 回复标记 | InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply InlineKeyboardMarkup 或 ReplyKeyboardMarkup 或 ReplyKeyboardRemove 或 ForceReply |
Optional 可选 | Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user 附加界面选项。一个用于内联键盘、自定义回复键盘、移除回复键盘或强制用户回复的 JSON 序列化对象 |
Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). On success, the sent Message is returned. Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future.
使用此方法发送动画文件(GIF 或 H.264/MPEG-4 AVC 无声视频)。成功时,返回发送的消息。当前,机器人可以发送大小不超过 50 MB 的动画文件,此限制将来可能会更改。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
business_connection_id 业务连接 ID | String 字符串 | Optional 可选 | Unique identifier of the business connection on behalf of which the message will be sent 将要代表其发送消息的业务连接的唯一标识符 |
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target chat or username of the target channel (in the format @channelusername )目标聊天的唯一标识符或目标频道的用户名(格式为 @channelusername ) |
message_thread_id | Integer 整数 | Optional 可选 | Unique identifier for the target message thread (topic) of the forum; for forum supergroups only 论坛目标消息线程(主题)的唯一标识符;仅适用于论坛超级群组 |
animation 动画 | InputFile or String InputFile 或 String | Yes 是 | 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. More information on Sending Files » 要发送的动画。传递一个 file_id 作为 String 来发送存在于 Telegram 服务器上的动画(推荐),传递一个 HTTP URL 作为 String 让 Telegram 从互联网获取动画,或者使用 multipart/form-data 上传新的动画。更多关于发送文件的信息» |
duration 持续时间 | Integer 整数 | Optional 可选 | Duration of sent animation in seconds 发送的动画的持续时间(秒) |
width 宽度 | Integer 整数 | Optional 可选 | Animation width 动画宽度 |
height 高度 | Integer 整数 | Optional 可选 | Animation height 动画高度 |
thumbnail 缩略图 | InputFile or String 输入文件或字符串 | Optional 可选 | 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>. More information on Sending Files » 发送文件的缩略图;如果服务器端支持文件的缩略图生成,则可以忽略此项。缩略图应为 JPEG 格式,大小应小于 200 kB。缩略图的宽度和高度不应超过 320。如果文件不是使用 multipart/form-data 上传的,则忽略此项。缩略图不能重复使用,只能作为新文件上传,因此如果缩略图是使用 multipart/form-data 在下上传的,您可以传递“attach://”。更多关于发送文件的信息请参见» |
caption 标题 | String 字符串 | Optional 可选 | Animation caption (may also be used when resending animation by file_id), 0-1024 characters after entities parsing 动画标题(也可在通过文件 ID 重新发送动画时使用),实体解析后 0-1024 个字符 |
parse_mode | String 字符串 | Optional 可选 | Mode for parsing entities in the animation caption. See formatting options for more details. 解析动画标题中实体的模式。有关更多详细信息,请参阅格式化选项。 |
caption_entities | Array of MessageEntity MessageEntity 数组 | Optional 可选 | A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode 一个在标题中出现的特殊实体的 JSON 序列化列表,可以替代 parse_mode 来指定 |
show_caption_above_media 在媒体上方显示标题 |
Boolean 布尔值 | Optional 可选 | Pass True, if the caption must be shown above the message media 如果必须在消息媒体上方显示标题,请传递 True |
has_spoiler 有剧透 | Boolean 布尔值 | Optional 可选 | Pass True if the animation needs to be covered with a spoiler animation 如果动画需要覆盖一个剧透动画,请传递 True |
disable_notification 禁用通知 | Boolean 布尔值 | Optional 可选 | Sends the message silently. Users will receive a notification with no sound. 静默发送消息。用户将收到无声通知。 |
protect_content 保护内容 | Boolean 布尔值 | Optional 可选 | Protects the contents of the sent message from forwarding and saving 保护发送的消息内容,防止转发和保存 |
allow_paid_broadcast 允许付费广播 | Boolean 布尔值 | Optional 可选 | Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance 将 True 传递给每秒允许最多 1000 条消息,忽略广播限制,每条消息收取 0.1 Telegram Stars 的费用。相关 Stars 将从机器人的余额中扣除。 |
message_effect_id 消息效果 ID | String 字符串 | Optional 可选 | Unique identifier of the message effect to be added to the message; for private chats only 要添加到消息中的消息效果的唯一标识符;仅限私人聊天 |
reply_parameters 回复参数 | ReplyParameters 回复参数 | Optional 可选 | Description of the message to reply to 要回复的消息描述 |
reply_markup 回复标记 | InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply InlineKeyboardMarkup 或 ReplyKeyboardMarkup 或 ReplyKeyboardRemove 或 ForceReply |
Optional 可选 | Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user 附加界面选项。一个用于内联键盘、自定义回复键盘、移除回复键盘或强制用户回复的 JSON 序列化对象 |
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, or in .MP3 format, or in .M4A format (other formats may be sent as Audio or Document). On success, the sent Message is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future.
使用此方法发送音频文件,如果您希望 Telegram 客户端将文件显示为可播放的语音消息。要使其工作,您的音频必须是用 OPUS 编码的 .OGG 文件,或 .MP3 格式,或 .M4A 格式(其他格式可能会作为音频或文档发送)。成功时,将返回发送的消息。机器人目前可以发送大小不超过 50 MB 的语音消息,此限制将来可能会更改。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
business_connection_id 业务连接 ID | String 字符串 | Optional 可选 | Unique identifier of the business connection on behalf of which the message will be sent 代表将要发送消息的业务连接的唯一标识符 |
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target chat or username of the target channel (in the format @channelusername )目标聊天或目标频道的用户名的唯一标识符(格式为 @channelusername ) |
message_thread_id | Integer 整数 | Optional 可选 | Unique identifier for the target message thread (topic) of the forum; for forum supergroups only 论坛目标消息线程(主题)的唯一标识符;仅适用于论坛超级群组 |
voice 语音 | InputFile or String 输入文件或字符串 | Yes 是 | 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. More information on Sending Files » 要发送的音频文件。传递一个文件 ID 作为字符串以发送存在于 Telegram 服务器上的文件(推荐),传递一个 HTTP URL 作为字符串让 Telegram 从互联网获取文件,或者使用 multipart/form-data 上传一个新文件。有关发送文件的更多信息,请参见《发送文件》» |
caption 标题 | String 字符串 | Optional 可选 | Voice message caption, 0-1024 characters after entities parsing 语音消息标题,实体解析后的 0-1024 个字符 |
parse_mode | String 字符串 | Optional 可选 | Mode for parsing entities in the voice message caption. See formatting options for more details. 解析语音消息标题中实体的模式。有关格式化选项的更多详细信息,请参见。 |
caption_entities | Array of MessageEntity MessageEntity 数组 | Optional 可选 | A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode 一个在标题中出现的特殊实体的 JSON 序列化列表,可以替代 parse_mode 来指定 |
duration 持续时间 | Integer 整数 | Optional 可选 | Duration of the voice message in seconds 语音消息的持续时间(秒) |
disable_notification 禁用通知 | Boolean 布尔值 | Optional 可选 | Sends the message silently. Users will receive a notification with no sound. 静默发送消息。用户将收到无声通知。 |
protect_content 保护内容 | Boolean 布尔值 | Optional 可选 | Protects the contents of the sent message from forwarding and saving 保护发送的消息内容,防止转发和保存 |
allow_paid_broadcast | Boolean 布尔值 | Optional 可选 | Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance 将 True 传递给每秒允许最多 1000 条消息,忽略广播限制,每条消息收取 0.1 Telegram Stars 的费用。相关 Stars 将从机器人的余额中扣除。 |
message_effect_id 消息效果 ID | String 字符串 | Optional 可选 | Unique identifier of the message effect to be added to the message; for private chats only 要添加到消息中的消息效果的唯一标识符;仅限私人聊天 |
reply_parameters 回复参数 | ReplyParameters 回复参数 | Optional 可选 | Description of the message to reply to 要回复的消息描述 |
reply_markup 回复标记 | InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply InlineKeyboardMarkup 或 ReplyKeyboardMarkup 或 ReplyKeyboardRemove 或 ForceReply |
Optional 可选 | Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user 附加界面选项。一个用于内联键盘、自定义回复键盘、移除回复键盘或强制用户回复的 JSON 序列化对象 |
As of v.4.0, Telegram clients support rounded square MPEG4 videos of up to 1 minute long. Use this method to send video messages. On success, the sent Message is returned.
从 v.4.0 版本开始,Telegram 客户端支持播放最长 1 分钟的圆角方形 MPEG4 视频。使用此方法发送视频消息。成功时,返回发送的消息。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
business_connection_id 业务连接 ID | String 字符串 | Optional 可选 | Unique identifier of the business connection on behalf of which the message will be sent 代表将要发送消息的业务连接的唯一标识符 |
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target chat or username of the target channel (in the format @channelusername )目标聊天或目标频道的用户名的唯一标识符(格式为 @channelusername ) |
message_thread_id | Integer 整数 | Optional 可选 | Unique identifier for the target message thread (topic) of the forum; for forum supergroups only 论坛目标消息线程(主题)的唯一标识符;仅适用于论坛超级群组 |
video_note 视频便笺 | InputFile or String InputFile 或 String | Yes 是 | 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. More information on Sending Files ». Sending video notes by a URL is currently unsupported 要发送的视频便笺。传递一个作为字符串的 file_id 以发送存在于 Telegram 服务器上的视频便笺(推荐),或者使用 multipart/form-data 上传新的视频。更多关于发送文件的信息请参见»发送文件。目前不支持通过 URL 发送视频便笺 |
duration 持续时间 | Integer 整数 | Optional 可选 | Duration of sent video in seconds 发送的视频时长(秒) |
length 长度 | Integer 整数 | Optional 可选 | Video width and height, i.e. diameter of the video message 视频宽度和高度,即视频消息的直径 |
thumbnail 缩略图 | InputFile or String 输入文件或字符串 | Optional 可选 | 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>. More information on Sending Files » 发送文件的缩略图;如果服务器端支持文件的缩略图生成,则可以忽略。缩略图应为 JPEG 格式,大小应小于 200 kB。缩略图的宽度和高度不应超过 320。如果文件不是使用 multipart/form-data 上传的,则忽略。缩略图不能重复使用,只能作为新文件上传,因此如果缩略图是使用 multipart/form-data 在下上传的,您可以传递“attach://”。更多关于发送文件的信息请参见»发送文件 |
disable_notification 禁用通知 | Boolean 布尔值 | Optional 可选 | Sends the message silently. Users will receive a notification with no sound. 静默发送消息。用户将收到无声音的通知。 |
protect_content 保护内容 | Boolean 布尔值 | Optional 可选 | Protects the contents of the sent message from forwarding and saving 保护发送的消息内容不被转发和保存 |
allow_paid_broadcast 允许付费广播 | Boolean 布尔值 | Optional 可选 | Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance 传递 True 以允许每秒发送高达 1000 条消息,忽略广播限制,每条消息收取 0.1 个 Telegram Stars 的费用。相关 Stars 将从机器人的余额中扣除 |
message_effect_id 消息效果 ID | String 字符串 | Optional 可选 | Unique identifier of the message effect to be added to the message; for private chats only 要添加到消息中的消息效果的唯一标识符;仅限私人聊天 |
reply_parameters 回复参数 | ReplyParameters 回复参数 | Optional 可选 | Description of the message to reply to 要回复的消息描述 |
reply_markup 回复标记 | InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply InlineKeyboardMarkup 或 ReplyKeyboardMarkup 或 ReplyKeyboardRemove 或 ForceReply |
Optional 可选 | Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user 附加界面选项。一个用于内联键盘、自定义回复键盘、移除回复键盘或强制用户回复的 JSON 序列化对象 |
Use this method to send paid media. On success, the sent Message is returned.
使用此方法发送付费媒体。成功时,返回发送的消息。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
business_connection_id 业务连接 ID | String 字符串 | Optional 可选 | Unique identifier of the business connection on behalf of which the message will be sent 代表将要发送消息的业务连接的唯一标识符 |
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target chat or username of the target channel (in the format @channelusername ). If the chat is a channel, all Telegram Star proceeds from this media will be credited to the chat's balance. Otherwise, they will be credited to the bot's balance.目标聊天的唯一标识符或目标频道的用户名(格式为 @channelusername )。如果聊天是频道,所有来自此媒体的 Telegram Star 收益将计入聊天的余额。否则,将计入机器人的余额。 |
star_count 星星数量 | Integer 整数 | Yes 是 | The number of Telegram Stars that must be paid to buy access to the media; 1-2500 购买媒体访问权所需支付的 Telegram Stars 数量;1-2500 |
media 媒体 | Array of InputPaidMedia InputPaidMedia 数组 | Yes 是 | A JSON-serialized array describing the media to be sent; up to 10 items 描述要发送的媒体的 JSON 序列化数组;最多 10 个项目 |
payload 负载 | String 字符串 | Optional 可选 | Bot-defined paid media payload, 0-128 bytes. This will not be displayed to the user, use it for your internal processes. 机器人定义的付费媒体负载,0-128 字节。这不会显示给用户,请用于您的内部流程。 |
caption 标题 | String 字符串 | Optional 可选 | Media caption, 0-1024 characters after entities parsing 媒体标题,实体解析后 0-1024 字符 |
parse_mode | String 字符串 | Optional 可选 | Mode for parsing entities in the media caption. See formatting options for more details. 解析媒体标题中实体的模式。请查看格式化选项以获取更多详细信息。 |
caption_entities | Array of MessageEntity MessageEntity 数组 | Optional 可选 | A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode 一个 JSON 序列化的特殊实体列表,这些实体出现在说明中,可以替代 parse_mode 指定 |
show_caption_above_media 在媒体上方显示标题 |
Boolean 布尔值 | Optional 可选 | Pass True, if the caption must be shown above the message media 如果说明必须显示在消息媒体上方,请传递 True |
disable_notification 禁用通知 | Boolean 布尔值 | Optional 可选 | Sends the message silently. Users will receive a notification with no sound. 静默发送消息。用户将收到无声音的通知。 |
protect_content 保护内容 | Boolean 布尔值 | Optional 可选 | Protects the contents of the sent message from forwarding and saving 保护发送的消息内容不被转发和保存 |
allow_paid_broadcast | Boolean 布尔值 | Optional 可选 | Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance 传递 True 以允许每秒发送高达 1000 条消息,忽略广播限制,每条消息收取 0.1 个 Telegram Stars 的费用。相关 Stars 将从机器人的余额中扣除 |
reply_parameters 回复参数 | ReplyParameters 回复参数 | Optional 可选 | Description of the message to reply to 回复消息的描述 |
reply_markup | InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply InlineKeyboardMarkup 或 ReplyKeyboardMarkup 或 ReplyKeyboardRemove 或 ForceReply |
Optional 可选 | Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user 附加界面选项。一个用于内联键盘、自定义回复键盘、移除回复键盘或强制用户回复的 JSON 序列化对象 |
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 Messages that were sent is returned.
使用此方法发送一组照片、视频、文档或音频作为相册。文档和音频文件只能与相同类型的消息组合在相册中。成功时,返回已发送的消息数组。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
business_connection_id 业务连接 ID | String 字符串 | Optional 可选 | Unique identifier of the business connection on behalf of which the message will be sent 代表将要发送消息的业务连接的唯一标识符 |
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target chat or username of the target channel (in the format @channelusername )目标聊天或目标频道的用户名的唯一标识符(格式为 @channelusername ) |
message_thread_id | Integer 整数 | Optional 可选 | Unique identifier for the target message thread (topic) of the forum; for forum supergroups only 论坛目标消息线程(主题)的唯一标识符;仅适用于论坛超级群组 |
media 媒体 | Array of InputMediaAudio, InputMediaDocument, InputMediaPhoto and InputMediaVideo InputMediaAudio、InputMediaDocument、InputMediaPhoto 和 InputMediaVideo 的数组 |
Yes 是 | A JSON-serialized array describing messages to be sent, must include 2-10 items 描述要发送的消息的 JSON 序列化数组,必须包含 2-10 个项目 |
disable_notification 禁用通知 | Boolean 布尔值 | Optional 可选 | Sends messages silently. Users will receive a notification with no sound. 静默发送消息。用户将收到无声通知。 |
protect_content 保护内容 | Boolean 布尔值 | Optional 可选 | Protects the contents of the sent messages from forwarding and saving 保护发送消息的内容,防止转发和保存 |
allow_paid_broadcast 允许付费广播 | Boolean 布尔值 | Optional 可选 | Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance 传递 True 以允许每秒发送最多 1000 条消息,忽略广播限制,每条消息收取 0.1 个 Telegram Stars 的费用。相关 Stars 将从机器人的余额中扣除 |
message_effect_id 消息效果 ID | String 字符串 | Optional 可选 | Unique identifier of the message effect to be added to the message; for private chats only 要添加到消息中的消息效果的唯一标识符;仅限私人聊天 |
reply_parameters 回复参数 | ReplyParameters 回复参数 | Optional 可选 | Description of the message to reply to 回复消息的描述 |
Use this method to send point on the map. On success, the sent Message is returned.
使用此方法在地图上发送点。成功时,返回发送的消息。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
business_connection_id 业务连接 ID | String 字符串 | Optional 可选 | Unique identifier of the business connection on behalf of which the message will be sent 代表将要发送消息的业务连接的唯一标识符 |
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target chat or username of the target channel (in the format @channelusername )目标聊天或目标频道的用户名的唯一标识符(格式为 @channelusername ) |
message_thread_id | Integer 整数 | Optional 可选 | Unique identifier for the target message thread (topic) of the forum; for forum supergroups only 论坛目标消息线程(主题)的唯一标识符;仅适用于论坛超级群组 |
latitude 纬度 | Float 浮点数 | Yes 是 | Latitude of the location 位置的纬度 |
longitude 经度 | Float 浮点数 | Yes 是 | Longitude of the location 位置的经度 |
horizontal_accuracy 水平精度 | Float 浮点数 | Optional 可选 | The radius of uncertainty for the location, measured in meters; 0-1500 位置的不确定性半径,以米为单位测量;0-1500 |
live_period 实时周期 | Integer 整数 | Optional 可选 | Period in seconds during which the location will be updated (see Live Locations, should be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely. 位置更新的时间间隔(以秒为单位),请参见实时位置。应在 60 到 86400 之间,或为 0x7FFFFFFF,表示可以无限期编辑的实时位置。 |
heading 航向 | Integer 整数 | Optional 可选 | For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified. 对于实时位置,用户移动的方向,以度为单位。如果指定,必须在 1 到 360 之间。 |
proximity_alert_radius 接近警报半径 | Integer 整数 | Optional 可选 | For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified. 对于实时位置,接近另一个聊天成员时的接近警报的最大距离,以米为单位。如果指定,必须在 1 到 100000 之间。 |
disable_notification 禁用通知 | Boolean 布尔值 | Optional 可选 | Sends the message silently. Users will receive a notification with no sound. 静默发送消息。用户将收到无声通知。 |
protect_content 保护内容 | Boolean 布尔值 | Optional 可选 | Protects the contents of the sent message from forwarding and saving 保护发送的消息内容不被转发和保存 |
allow_paid_broadcast | Boolean 布尔值 | Optional 可选 | Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance 传递 True 以允许每秒发送高达 1000 条消息,忽略广播限制,每条消息收取 0.1 个 Telegram Stars 的费用。相关 Stars 将从机器人的余额中扣除 |
message_effect_id 消息效果 ID | String 字符串 | Optional 可选 | Unique identifier of the message effect to be added to the message; for private chats only 要添加到消息中的消息效果的唯一标识符;仅限私人聊天 |
reply_parameters 回复参数 | ReplyParameters 回复参数 | Optional 可选 | Description of the message to reply to 回复消息的描述 |
reply_markup | InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply InlineKeyboardMarkup 或 ReplyKeyboardMarkup 或 ReplyKeyboardRemove 或 ForceReply |
Optional 可选 | Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user 附加界面选项。一个用于内联键盘、自定义回复键盘、移除回复键盘或强制用户回复的 JSON 序列化对象 |
Use this method to send information about a venue. On success, the sent Message is returned.
使用此方法发送有关场所的信息。成功时,返回发送的消息。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
business_connection_id 业务连接 ID | String 字符串 | Optional 可选 | Unique identifier of the business connection on behalf of which the message will be sent 代表将要发送消息的业务连接的唯一标识符 |
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target chat or username of the target channel (in the format @channelusername )目标聊天或目标频道的用户名的唯一标识符(格式为 @channelusername ) |
message_thread_id | Integer 整数 | Optional 可选 | Unique identifier for the target message thread (topic) of the forum; for forum supergroups only 论坛目标消息线程(主题)的唯一标识符;仅适用于论坛超级群组 |
latitude 纬度 | Float 浮点数 | Yes 是 | Latitude of the venue 场馆的纬度 |
longitude 经度 | Float 浮点数 | Yes 是 | Longitude of the venue 场馆的经度 |
title 标题 | String 字符串 | Yes 是 | Name of the venue 场所名称 |
address 地址 | String 字符串 | Yes 是 | Address of the venue 场馆地址 |
foursquare_id | String 字符串 | Optional 可选 | Foursquare identifier of the venue 场馆的 Foursquare 标识符 |
foursquare_type | String 字符串 | Optional 可选 | Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.) 场馆的 Foursquare 类型,如果已知。(例如,“arts_entertainment/default”,“arts_entertainment/aquarium”或“food/icecream”。) |
google_place_id | String 字符串 | Optional 可选 | Google Places identifier of the venue 场馆的 Google Places 标识符 |
google_place_type | String 字符串 | Optional 可选 | Google Places type of the venue. (See supported types.) 场所的 Google Places 类型。(参见支持的类型。) |
disable_notification 禁用通知 | Boolean 布尔值 | Optional 可选 | Sends the message silently. Users will receive a notification with no sound. 静默发送消息。用户将收到无声通知。 |
protect_content 保护内容 | Boolean 布尔值 | Optional 可选 | Protects the contents of the sent message from forwarding and saving 保护发送的消息内容不被转发和保存 |
allow_paid_broadcast | Boolean 布尔值 | Optional 可选 | Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance 传递 True 以允许每秒发送高达 1000 条消息,忽略广播限制,每条消息收取 0.1 个 Telegram Stars 的费用。相关 Stars 将从机器人的余额中扣除 |
message_effect_id 消息效果 ID | String 字符串 | Optional 可选 | Unique identifier of the message effect to be added to the message; for private chats only 要添加到消息中的消息效果的唯一标识符;仅限私人聊天 |
reply_parameters 回复参数 | ReplyParameters 回复参数 | Optional 可选 | Description of the message to reply to 回复消息的描述 |
reply_markup | InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply InlineKeyboardMarkup 或 ReplyKeyboardMarkup 或 ReplyKeyboardRemove 或 ForceReply |
Optional 可选 | Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user 额外的界面选项。一个用于内联键盘、自定义回复键盘、移除回复键盘或强制用户回复的 JSON 序列化对象 |
Use this method to send phone contacts. On success, the sent Message is returned.
使用此方法发送电话联系人。成功时,返回发送的消息。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
business_connection_id 业务连接 ID | String 字符串 | Optional 可选 | Unique identifier of the business connection on behalf of which the message will be sent 代表将要发送消息的业务连接的唯一标识符 |
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target chat or username of the target channel (in the format @channelusername )目标聊天或目标频道的用户名的唯一标识符(格式为 @channelusername ) |
message_thread_id | Integer 整数 | Optional 可选 | Unique identifier for the target message thread (topic) of the forum; for forum supergroups only 论坛目标消息线程(主题)的唯一标识符;仅适用于论坛超级群组 |
phone_number 电话号码 | String 字符串 | Yes 是 | Contact's phone number 联系人的电话号码 |
first_name 名 | String 字符串 | Yes 是 | Contact's first name 联系人的名字 |
last_name 姓氏 | String 字符串 | Optional 可选 | Contact's last name 联系人的姓氏 |
vcard | String 字符串 | Optional 可选 | Additional data about the contact in the form of a vCard, 0-2048 bytes 以 vCard 形式的联系人附加数据,0-2048 字节 |
disable_notification 禁用通知 | Boolean 布尔值 | Optional 可选 | Sends the message silently. Users will receive a notification with no sound. 静默发送消息。用户将收到无声通知。 |
protect_content 保护内容 | Boolean 布尔值 | Optional 可选 | Protects the contents of the sent message from forwarding and saving 保护发送的消息内容不被转发和保存 |
allow_paid_broadcast | Boolean 布尔值 | Optional 可选 | Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance 传递 True 以允许每秒发送高达 1000 条消息,忽略广播限制,每条消息收取 0.1 个 Telegram Stars 的费用。相关 Stars 将从机器人的余额中扣除 |
message_effect_id 消息效果 ID | String 字符串 | Optional 可选 | Unique identifier of the message effect to be added to the message; for private chats only 要添加到消息中的消息效果的唯一标识符;仅限私人聊天 |
reply_parameters 回复参数 | ReplyParameters 回复参数 | Optional 可选 | Description of the message to reply to 回复消息的描述 |
reply_markup | InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply InlineKeyboardMarkup 或 ReplyKeyboardMarkup 或 ReplyKeyboardRemove 或 ForceReply |
Optional 可选 | Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user 额外的界面选项。一个用于内联键盘、自定义回复键盘、移除回复键盘或强制用户回复的 JSON 序列化对象 |
Use this method to send a native poll. On success, the sent Message is returned.
使用此方法发送原生投票。成功时,返回发送的消息。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
business_connection_id 业务连接 ID | String 字符串 | Optional 可选 | Unique identifier of the business connection on behalf of which the message will be sent 代表将要发送消息的业务连接的唯一标识符 |
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target chat or username of the target channel (in the format @channelusername )目标聊天的唯一标识符或目标频道的用户名(格式为 @channelusername ) |
message_thread_id | Integer 整数 | Optional 可选 | Unique identifier for the target message thread (topic) of the forum; for forum supergroups only 论坛中目标消息线程(主题)的唯一标识符;仅适用于论坛超级群组 |
question 问题 | String 字符串 | Yes 是 | Poll question, 1-300 characters 投票问题,1-300 个字符 |
question_parse_mode 问题解析模式 | String 字符串 | Optional 可选 | Mode for parsing entities in the question. See formatting options for more details. Currently, only custom emoji entities are allowed 解析问题中实体的模式。有关更多详细信息,请参阅格式化选项。目前,仅允许自定义表情符号实体。 |
question_entities | Array of MessageEntity MessageEntity 数组 | Optional 可选 | A JSON-serialized list of special entities that appear in the poll question. It can be specified instead of question_parse_mode 投票问题中出现的特殊实体的 JSON 序列化列表。可以替代 question_parse_mode 指定。 |
options 选项 | Array of InputPollOption InputPollOption 数组 | Yes 是 | A JSON-serialized list of 2-10 answer options 2-10 个答案选项的 JSON 序列化列表 |
is_anonymous | Boolean 布尔值 | Optional 可选 | True, if the poll needs to be anonymous, defaults to True 如果投票需要匿名,则为 True,默认为 True |
type 类型 | String 字符串 | Optional 可选 | Poll type, “quiz” or “regular”, defaults to “regular” 投票类型,“quiz” 或 “regular”,默认为 “regular” |
allows_multiple_answers | Boolean 布尔值 | Optional 可选 | True, if the poll allows multiple answers, ignored for polls in quiz mode, defaults to False 如果投票允许多选,则为 True,在测验模式下的投票中被忽略,默认为 False |
correct_option_id | Integer 整数 | Optional 可选 | 0-based identifier of the correct answer option, required for polls in quiz mode 正确答案选项的 0 基标识符,测验模式下的投票所需 |
explanation 解释 | String 字符串 | Optional 可选 | 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 当用户选择错误答案或在测验风格的投票中点击灯泡图标时显示的文本,实体解析后最多 200 个字符和最多 2 个换行符 |
explanation_parse_mode | String 字符串 | Optional 可选 | Mode for parsing entities in the explanation. See formatting options for more details. 解析解释中实体的模式。有关更多详细信息,请参阅格式化选项。 |
explanation_entities 解释实体 | Array of MessageEntity MessageEntity 数组 | Optional 可选 | A JSON-serialized list of special entities that appear in the poll explanation. It can be specified instead of explanation_parse_mode 投票说明中出现的特殊实体的 JSON 序列化列表。可以替代 explanation_parse_mode 来指定 |
open_period 开放期限 | Integer 整数 | Optional 可选 | Amount of time in seconds the poll will be active after creation, 5-600. Can't be used together with close_date. 投票创建后活跃的时间,单位为秒,5-600。不能与 close_date 一起使用。 |
close_date 关闭日期 | Integer 整数 | Optional 可选 | 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 open_period. 投票将自动关闭的时间点(Unix 时间戳)。必须至少在未来 5 秒且不超过 600 秒。不能与 open_period 一起使用。 |
is_closed | Boolean 布尔值 | Optional 可选 | Pass True if the poll needs to be immediately closed. This can be useful for poll preview. 如果需要立即关闭投票,请传递 True。这对于投票预览很有用。 |
disable_notification 禁用通知 | Boolean 布尔值 | Optional 可选 | Sends the message silently. Users will receive a notification with no sound. 静默发送消息。用户将收到无声通知。 |
protect_content 保护内容 | Boolean 布尔值 | Optional 可选 | Protects the contents of the sent message from forwarding and saving 保护发送的消息内容不被转发和保存 |
allow_paid_broadcast | Boolean 布尔值 | Optional 可选 | Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance 传递 True 以允许每秒发送高达 1000 条消息,忽略广播限制,每条消息收取 0.1 个 Telegram Stars 的费用。相关 Stars 将从机器人的余额中扣除 |
message_effect_id 消息效果 ID | String 字符串 | Optional 可选 | Unique identifier of the message effect to be added to the message; for private chats only 要添加到消息中的消息效果的唯一标识符;仅限私人聊天 |
reply_parameters 回复参数 | ReplyParameters 回复参数 | Optional 可选 | Description of the message to reply to 回复消息的描述 |
reply_markup | InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply InlineKeyboardMarkup 或 ReplyKeyboardMarkup 或 ReplyKeyboardRemove 或 ForceReply |
Optional 可选 | Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user 额外的界面选项。一个用于内联键盘、自定义回复键盘、移除回复键盘或强制用户回复的 JSON 序列化对象 |
Use this method to send an animated emoji that will display a random value. On success, the sent Message is returned.
使用此方法发送一个动画表情符号,该表情符号将显示一个随机值。成功时,返回发送的消息。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
business_connection_id 业务连接 ID | String 字符串 | Optional 可选 | Unique identifier of the business connection on behalf of which the message will be sent 代表将要发送消息的业务连接的唯一标识符 |
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target chat or username of the target channel (in the format @channelusername )目标聊天或目标频道的用户名的唯一标识符(格式为 @channelusername ) |
message_thread_id | Integer 整数 | Optional 可选 | Unique identifier for the target message thread (topic) of the forum; for forum supergroups only 论坛目标消息线程(主题)的唯一标识符;仅适用于论坛超级群组 |
emoji 表情符号 | String 字符串 | Optional 可选 | Emoji on which the dice throw animation is based. Currently, must be one of “![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 基于骰子投掷动画的表情符号。目前,必须是“ ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
disable_notification 禁用通知 | Boolean 布尔值 | Optional 可选 | Sends the message silently. Users will receive a notification with no sound. 静默发送消息。用户将收到无声通知。 |
protect_content 保护内容 | Boolean 布尔值 | Optional 可选 | Protects the contents of the sent message from forwarding 保护发送的消息内容不被转发 |
allow_paid_broadcast | Boolean 布尔值 | Optional 可选 | Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance 传递 True 以允许每秒发送高达 1000 条消息,忽略广播限制,每条消息收取 0.1 个 Telegram Stars 的费用。相关 Stars 将从机器人的余额中扣除 |
message_effect_id 消息效果 ID | String 字符串 | Optional 可选 | Unique identifier of the message effect to be added to the message; for private chats only 要添加到消息中的消息效果的唯一标识符;仅限私人聊天 |
reply_parameters 回复参数 | ReplyParameters 回复参数 | Optional 可选 | Description of the message to reply to 回复消息的描述 |
reply_markup | InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply InlineKeyboardMarkup 或 ReplyKeyboardMarkup 或 ReplyKeyboardRemove 或 ForceReply |
Optional 可选 | Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user 额外的界面选项。一个用于内联键盘、自定义回复键盘、移除回复键盘或强制用户回复的 JSON 序列化对象 |
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 True on success.
当您需要告知用户机器人这边正在发生某些事情时,请使用此方法。状态设置为 5 秒或更短(当您的机器人发送消息时,Telegram 客户端会清除其正在输入的状态)。成功时返回 True。
Example: The ImageBot 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 sendChatAction with action = upload_photo. The user will see a “sending photo” status for the bot.
示例:ImageBot 需要一些时间来处理请求并上传图片。与其发送类似“正在检索图片,请稍候…”的文本消息,机器人可以使用 sendChatAction 并设置 action = upload_photo。用户将看到机器人的“正在发送照片”状态。
We only recommend using this method when a response from the bot will take a noticeable amount of time to arrive.
我们仅在机器人响应需要明显时间到达时推荐使用此方法。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
business_connection_id 业务连接 ID | String 字符串 | Optional 可选 | Unique identifier of the business connection on behalf of which the action will be sent 代表将要发送操作的业务连接的唯一标识符 |
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target chat or username of the target channel (in the format @channelusername )目标聊天或目标频道的用户名的唯一标识符(格式为 @channelusername ) |
message_thread_id | Integer 整数 | Optional 可选 | Unique identifier for the target message thread; for supergroups only 目标消息线程的唯一标识符;仅适用于超级群组 |
action 操作 | String 字符串 | Yes 是 | Type of action to broadcast. Choose one, depending on what the user is about to receive: typing for text messages, upload_photo for photos, record_video or upload_video for videos, record_voice or upload_voice for voice notes, upload_document for general files, choose_sticker for stickers, find_location for location data, record_video_note or upload_video_note for video notes. 要广播的操作类型。根据用户即将接收的内容选择一种:typing 用于文本消息,upload_photo 用于照片,record_video 或 upload_video 用于视频,record_voice 或 upload_voice 用于语音消息,upload_document 用于一般文件,choose_sticker 用于贴纸,find_location 用于位置数据,record_video_note 或 upload_video_note 用于视频消息。 |
Use this method to change the chosen reactions on a message. Service messages of some types can't be reacted to. Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel. Bots can't use paid reactions. Returns True on success.
使用此方法更改消息上的选择反应。某些类型的服务消息无法被反应。自动从频道转发到其讨论组的消息与频道中的消息具有相同的可用反应。机器人无法使用付费反应。成功时返回 True。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target chat or username of the target channel (in the format @channelusername )目标聊天或目标频道的用户名的唯一标识符(格式为 @channelusername ) |
message_id 消息 ID | Integer 整数 | Yes 是 | Identifier of the target message. If the message belongs to a media group, the reaction is set to the first non-deleted message in the group instead. 目标消息的标识符。如果消息属于媒体组,反应将设置到组中第一个未删除的消息上。 |
reaction 反应 | Array of ReactionType ReactionType 数组 | Optional 可选 | A JSON-serialized list of reaction types to set on the message. Currently, as non-premium users, bots can set up to one reaction per message. A custom emoji reaction can be used if it is either already present on the message or explicitly allowed by chat administrators. Paid reactions can't be used by bots. 一个 JSON 序列化的反应类型列表,用于设置消息上的反应。目前,作为非高级用户,机器人每个消息最多可以设置一个反应。如果自定义表情反应已经存在于消息上或聊天管理员明确允许,可以使用自定义表情反应。机器人无法使用付费反应。 |
is_big 是大的 | Boolean 布尔值 | Optional 可选 | Pass True to set the reaction with a big animation 传递 True 来设置带有大动画的反应 |
Use this method to get a list of profile pictures for a user. Returns a UserProfilePhotos object.
使用此方法获取用户的头像列表。返回一个 UserProfilePhotos 对象。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
user_id 用户 ID | Integer 整数 | Yes 是 | Unique identifier of the target user 目标用户的唯一标识符 |
offset 偏移量 | Integer 整数 | Optional 可选 | Sequential number of the first photo to be returned. By default, all photos are returned. 要返回的第一张照片的顺序号。默认情况下,返回所有照片。 |
limit 限制 | Integer 整数 | Optional 可选 | Limits the number of photos to be retrieved. Values between 1-100 are accepted. Defaults to 100. 限制要检索的照片数量。接受 1-100 之间的值。默认值为 100。 |
Changes the emoji status for a given user that previously allowed the bot to manage their emoji status via the Mini App method requestEmojiStatusAccess. Returns True on success.
更改指定用户的表情符号状态,该用户之前允许机器人通过 Mini App 方法 requestEmojiStatusAccess 管理其表情符号状态。成功时返回 True。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
user_id 用户 ID | Integer 整数 | Yes 是 | Unique identifier of the target user 目标用户的唯一标识符 |
emoji_status_custom_emoji_id | String 字符串 | Optional 可选 | Custom emoji identifier of the emoji status to set. Pass an empty string to remove the status. 要设置的表情符号状态的自定义表情符号标识符。传入空字符串以移除状态。 |
emoji_status_expiration_date | Integer 整数 | Optional 可选 | Expiration date of the emoji status, if any 表情符号状态的到期日期(如果有)。 |
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 File object is returned. The file can then be downloaded via the link https://api.telegram.org/file/bot<token>/<file_path>
, where <file_path>
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 getFile again.
使用此方法获取文件的基本信息并准备下载。目前,机器人可以下载大小不超过 20MB 的文件。成功时,返回一个 File 对象。然后可以通过链接 https://api.telegram.org/file/bot<token>/<file_path>
下载文件,其中 <file_path>
取自响应。保证链接至少有效 1 小时。链接过期后,可以通过再次调用 getFile 请求新的链接。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
file_id | String 字符串 | Yes 是 | File identifier to get information about 获取文件信息的文件标识符 |
Note: 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.
注意:此函数可能无法保留原始文件名和 MIME 类型。您应该在接收到文件对象时保存文件的 MIME 类型和名称(如果可用)。
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 unbanned first. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.
使用此方法在群组、超级群组或频道中封禁用户。对于超级群组和频道,用户在未被解禁前无法通过邀请链接等自行返回聊天。机器人必须是聊天中的管理员,并且必须拥有适当的管理员权限。此操作成功时返回 True。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target group or username of the target supergroup or channel (in the format @channelusername )目标群组的唯一标识符或目标超级群组或频道的用户名(格式为 @channelusername ) |
user_id 用户 ID | Integer 整数 | Yes 是 | Unique identifier of the target user 目标用户的唯一标识符 |
until_date 截止日期 | Integer 整数 | Optional 可选 | 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. 用户将被解禁的日期;Unix 时间。如果用户被封禁超过 366 天或从当前时间起少于 30 秒,则视为永久封禁。仅适用于超级群组和频道。 |
revoke_messages 撤销消息 | Boolean 布尔值 | Optional 可选 | Pass True to delete all messages from the chat for the user that is being removed. If False, the user will be able to see messages in the group that were sent before the user was removed. Always True for supergroups and channels. 传递 True 以删除被移除用户在聊天中的所有消息。如果为 False,用户将能够看到在其被移除之前发送到群组中的消息。对于超级群组和频道始终为 True。 |
Use this method to unban a previously banned user in a supergroup or channel. The user will not 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 removed from the chat. If you don't want this, use the parameter only_if_banned. Returns True on success.
使用此方法可以解除超级群组或频道中先前被禁用的用户的禁令。用户不会自动返回到群组或频道,但可以通过链接等方式加入。机器人必须是管理员才能使用此功能。默认情况下,此方法保证在调用后用户不是聊天成员,但可以加入。因此,如果用户是聊天成员,他们也将从聊天中移除。如果您不希望这样,请使用参数 only_if_banned。成功时返回 True。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target group or username of the target supergroup or channel (in the format @channelusername )目标群组的唯一标识符或目标超级群组或频道的用户名(格式为 @channelusername ) |
user_id 用户 ID | Integer 整数 | Yes 是 | Unique identifier of the target user 目标用户的唯一标识符 |
only_if_banned | Boolean 布尔值 | Optional 可选 | Do nothing if the user is not banned 如果用户未被禁用,则不执行任何操作 |
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 True for all permissions to lift restrictions from a user. Returns True on success.
使用此方法在超级群组中限制用户。机器人必须是超级群组的管理员才能使用此功能,并且必须拥有适当的管理员权限。传递 True 给所有权限以解除对用户的限制。成功时返回 True。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername )目标聊天的唯一标识符或目标超级群的用户名(格式为 @supergroupusername ) |
user_id 用户 ID | Integer 整数 | Yes 是 | Unique identifier of the target user 目标用户的唯一标识符 |
permissions 权限 | ChatPermissions 聊天权限 | Yes 是 | A JSON-serialized object for new user permissions 新用户权限的 JSON 序列化对象 |
use_independent_chat_permissions 使用独立聊天权限 |
Boolean 布尔值 | Optional 可选 | Pass True if chat permissions are set independently. Otherwise, the can_send_other_messages and can_add_web_page_previews permissions will imply the can_send_messages, can_send_audios, can_send_documents, can_send_photos, can_send_videos, can_send_video_notes, and can_send_voice_notes permissions; the can_send_polls permission will imply the can_send_messages permission. 如果聊天权限是独立设置的,则传入 True。否则,can_send_other_messages 和 can_send_web_page_previews 权限将暗示 can_send_messages、can_send_audios、can_send_documents、can_send_photos、can_send_videos、can_send_video_notes 和 can_send_voice_notes 权限;can_send_polls 权限将暗示 can_send_messages 权限。 |
until_date 截止日期 | Integer 整数 | Optional 可选 | 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 用户限制解除的日期;Unix 时间。如果用户被限制超过 366 天或从当前时间起少于 30 秒,则视为永久限制 |
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 False for all boolean parameters to demote a user. Returns True on success.
使用此方法在超级群组或频道中提升或降级用户。机器人必须是聊天中的管理员,并且必须拥有适当的管理员权限才能使用此功能。对于所有布尔参数传递 False 以降级用户。成功时返回 True。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target chat or username of the target channel (in the format @channelusername )目标聊天的唯一标识符或目标频道的用户名(格式为 @channelusername ) |
user_id 用户 ID | Integer 整数 | Yes 是 | Unique identifier of the target user 目标用户的唯一标识符 |
is_anonymous | Boolean 布尔值 | Optional 可选 | Pass True if the administrator's presence in the chat is hidden 如果管理员在聊天中的存在是隐藏的,则传递 True |
can_manage_chat | Boolean 布尔值 | Optional 可选 | Pass True if the administrator can access the chat event log, get boost list, see hidden supergroup and channel members, report spam messages and ignore slow mode. Implied by any other administrator privilege. 如果管理员可以访问聊天事件日志、获取提升列表、查看隐藏的超级群组和频道成员、举报垃圾信息并忽略慢速模式,则传递 True。任何其他管理员权限都暗示此权限。 |
can_delete_messages | Boolean 布尔值 | Optional 可选 | Pass True if the administrator can delete messages of other users 如果管理员可以删除其他用户的消息,则传递 True |
can_manage_video_chats | Boolean 布尔值 | Optional 可选 | Pass True if the administrator can manage video chats 如果管理员可以管理视频聊天,则传递 True |
can_restrict_members | Boolean 布尔值 | Optional 可选 | Pass True if the administrator can restrict, ban or unban chat members, or access supergroup statistics 如果管理员可以限制、封禁或解封聊天成员,或访问超级群统计,请传递 True |
can_promote_members | Boolean 布尔值 | Optional 可选 | Pass True 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) 如果管理员可以添加具有他们自己权限子集的新管理员,或降级他们直接或间接(由他任命的管理员所提拔的)提拔的管理员,请传递 True |
can_change_info | Boolean 布尔值 | Optional 可选 | Pass True if the administrator can change chat title, photo and other settings 如果管理员可以更改聊天标题、照片和其他设置,则传入 True |
can_invite_users | Boolean 布尔值 | Optional 可选 | Pass True if the administrator can invite new users to the chat 如果管理员可以邀请新用户加入聊天,请传递 True |
can_post_stories | Boolean 布尔值 | Optional 可选 | Pass True if the administrator can post stories to the chat 如果管理员可以向聊天发送故事,则传入 True |
can_edit_stories 可以编辑故事 | Boolean 布尔值 | Optional 可选 | Pass True if the administrator can edit stories posted by other users, post stories to the chat page, pin chat stories, and access the chat's story archive 如果管理员可以编辑其他用户发布的故事、向聊天页面发布故事、固定聊天故事并访问聊天的故事档案,则传入 True |
can_delete_stories 可以删除故事 | Boolean 布尔值 | Optional 可选 | Pass True if the administrator can delete stories posted by other users 如果管理员可以删除其他用户发布的故事,则传递 True |
can_post_messages 可以发布消息 | Boolean 布尔值 | Optional 可选 | Pass True if the administrator can post messages in the channel, or access channel statistics; for channels only 如果管理员可以在频道中发布消息,或访问频道统计数据,则传递 True;仅限频道 |
can_edit_messages | Boolean 布尔值 | Optional 可选 | Pass True if the administrator can edit messages of other users and can pin messages; for channels only 如果管理员可以编辑其他用户的消息并可以置顶消息,则传递 True;仅限频道 |
can_pin_messages | Boolean 布尔值 | Optional 可选 | Pass True if the administrator can pin messages; for supergroups only 如果管理员可以置顶消息,则传递 True;仅限超级群组 |
can_manage_topics 可以管理话题 | Boolean 布尔值 | Optional 可选 | Pass True if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only 如果用户被允许创建、重命名、关闭和重新打开论坛主题,则传递 True;仅限超级群组 |
Use this method to set a custom title for an administrator in a supergroup promoted by the bot. Returns True on success.
使用此方法为机器人提升的超级群组中的管理员设置自定义标题。成功时返回 True。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername )目标聊天的唯一标识符或目标超级群的用户名(格式为 @supergroupusername ) |
user_id 用户 ID | Integer 整数 | Yes 是 | Unique identifier of the target user 目标用户的唯一标识符 |
custom_title 自定义标题 | String 字符串 | Yes 是 | New custom title for the administrator; 0-16 characters, emoji are not allowed 管理员的新自定义标题;0-16 个字符,不允许使用表情符号 |
Use this method to ban a channel chat in a supergroup or a channel. Until the chat is unbanned, the owner of the banned chat won't be able to send messages on behalf of any of their channels. The bot must be an administrator in the supergroup or channel for this to work and must have the appropriate administrator rights. Returns True on success.
使用此方法禁止超级群组或频道中的频道聊天。在聊天被解禁之前,被禁聊天的所有者将无法代表其任何频道发送消息。机器人必须是超级群组或频道的管理员,并且必须拥有适当的管理员权限才能使用此功能。成功时返回 True。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target chat or username of the target channel (in the format @channelusername )目标聊天的唯一标识符或目标频道的用户名(格式为 @channelusername ) |
sender_chat_id 发送者聊天 ID | Integer 整数 | Yes 是 | Unique identifier of the target sender chat 目标发送者聊天的唯一标识符 |
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 True on success.
使用此方法解禁超级群组或频道中之前被禁的频道聊天。机器人必须是管理员才能使用此功能,并且必须拥有适当的管理员权限。成功时返回 True。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target chat or username of the target channel (in the format @channelusername )目标聊天的唯一标识符或目标频道的用户名(格式为 @channelusername ) |
sender_chat_id 发送者聊天 ID | Integer 整数 | Yes 是 | Unique identifier of the target sender chat 目标发送者聊天的唯一标识符 |
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 can_restrict_members administrator rights. Returns True on success.
使用此方法为所有成员设置默认聊天权限。机器人必须是群组或超级群组的管理员,并且必须拥有 can_restrict_members 管理员权限。此操作成功时返回 True。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername )目标聊天的唯一标识符或目标超级群的用户名(格式为 @supergroupusername ) |
permissions 权限 | ChatPermissions 聊天权限 | Yes 是 | A JSON-serialized object for new default chat permissions 新的默认聊天权限的 JSON 序列化对象 |
use_independent_chat_permissions | Boolean 布尔值 | Optional 可选 | Pass True if chat permissions are set independently. Otherwise, the can_send_other_messages and can_add_web_page_previews permissions will imply the can_send_messages, can_send_audios, can_send_documents, can_send_photos, can_send_videos, can_send_video_notes, and can_send_voice_notes permissions; the can_send_polls permission will imply the can_send_messages permission. 如果聊天权限是独立设置的,则传入 True。否则,can_send_other_messages 和 can_send_web_page_previews 权限将暗示 can_send_messages、can_send_audios、can_send_documents、can_send_photos、can_send_videos、can_send_video_notes 和 can_send_voice_notes 权限;can_send_polls 权限将暗示 can_send_messages 权限。 |
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 String on success.
使用此方法为聊天生成一个新的主要邀请链接;之前生成的主要链接将被撤销。机器人必须是聊天中的管理员才能使用此功能,并且必须拥有适当的管理员权限。成功时返回新的邀请链接作为字符串。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target chat or username of the target channel (in the format @channelusername )目标聊天的唯一标识符或目标频道的用户名(格式为 @channelusername ) |
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 exportChatInviteLink or by calling the getChat method. If your bot needs to generate a new primary invite link replacing its previous one, use exportChatInviteLink again.
注意:聊天中的每个管理员都会生成他们自己的邀请链接。机器人不能使用其他管理员生成的邀请链接。如果你希望你的机器人使用邀请链接,它需要生成自己的链接,使用 exportChatInviteLink 或通过调用 getChat 方法。如果你的机器人需要生成一个新的主要邀请链接来替换之前的链接,请再次使用 exportChatInviteLink。
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 revokeChatInviteLink. Returns the new invite link as ChatInviteLink object.
使用此方法为聊天创建一个额外的邀请链接。机器人必须是聊天中的管理员才能使用此功能,并且必须拥有适当的管理员权限。可以使用方法 revokeChatInviteLink 撤销该链接。返回新的邀请链接作为 ChatInviteLink 对象。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target chat or username of the target channel (in the format @channelusername )目标聊天的唯一标识符或目标频道的用户名(格式为 @channelusername ) |
name 名称 | String 字符串 | Optional 可选 | Invite link name; 0-32 characters 邀请链接名称;0-32 个字符 |
expire_date 过期日期 | Integer 整数 | Optional 可选 | Point in time (Unix timestamp) when the link will expire 链接到期的时间点(Unix 时间戳) |
member_limit 成员限制 | Integer 整数 | Optional 可选 | The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999 通过此邀请链接加入聊天后,聊天中同时可以成为成员的最大用户数;1-99999 |
creates_join_request 创建加入请求 | Boolean 布尔值 | Optional 可选 | True, if users joining the chat via the link need to be approved by chat administrators. If True, member_limit can't be specified 如果为 True,则通过链接加入聊天的用户需要聊天管理员批准。如果为 True,则不能指定 member_limit |
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 ChatInviteLink object.
使用此方法编辑由机器人创建的非主要邀请链接。机器人必须是聊天中的管理员才能使用此功能,并且必须拥有适当的管理员权限。返回编辑后的邀请链接作为 ChatInviteLink 对象。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target chat or username of the target channel (in the format @channelusername )目标聊天的唯一标识符或目标频道的用户名(格式为 @channelusername ) |
invite_link 邀请链接 | String 字符串 | Yes 是 | The invite link to edit 要编辑的邀请链接 |
name 名称 | String 字符串 | Optional 可选 | Invite link name; 0-32 characters 邀请链接名称;0-32 个字符 |
expire_date 过期日期 | Integer 整数 | Optional 可选 | Point in time (Unix timestamp) when the link will expire 链接将过期的时间点(Unix 时间戳) |
member_limit 成员限制 | Integer 整数 | Optional 可选 | The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999 通过此邀请链接加入聊天后,聊天中同时可以成为成员的最大用户数;1-99999 |
creates_join_request 创建加入请求 | Boolean 布尔值 | Optional 可选 | True, if users joining the chat via the link need to be approved by chat administrators. If True, member_limit can't be specified 如果通过链接加入聊天的用户需要聊天管理员批准,则为 True。如果为 True,则不能指定 member_limit |
Use this method to create a subscription invite link for a channel chat. The bot must have the can_invite_users administrator rights. The link can be edited using the method editChatSubscriptionInviteLink or revoked using the method revokeChatInviteLink. Returns the new invite link as a ChatInviteLink object.
使用此方法为频道聊天创建订阅邀请链接。机器人必须具有可以邀请用户的管理员权限。可以使用方法 editChatSubscriptionInviteLink 编辑链接,或使用方法 revokeChatInviteLink 撤销链接。返回新的邀请链接作为 ChatInviteLink 对象。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target channel chat or username of the target channel (in the format @channelusername )目标频道聊天的唯一标识符或目标频道的用户名(格式为 @channelusername ) |
name 名称 | String 字符串 | Optional 可选 | Invite link name; 0-32 characters 邀请链接名称;0-32 个字符 |
subscription_period 订阅周期 | Integer 整数 | Yes 是 | The number of seconds the subscription will be active for before the next payment. Currently, it must always be 2592000 (30 days). 订阅在下次付款前有效的秒数。目前必须始终为 2592000(30 天)。 |
subscription_price 订阅价格 | Integer 整数 | Yes 是 | The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat; 1-2500 用户最初以及在每个后续订阅期后必须支付的 Telegram Stars 数量,以成为聊天成员;1-2500 |
Use this method to edit a subscription invite link created by the bot. The bot must have the can_invite_users administrator rights. Returns the edited invite link as a ChatInviteLink object.
使用此方法编辑由机器人创建的订阅邀请链接。机器人必须拥有可以邀请用户的管理员权限。返回编辑后的邀请链接作为 ChatInviteLink 对象。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target chat or username of the target channel (in the format @channelusername )目标聊天的唯一标识符或目标频道的用户名(格式为 @channelusername ) |
invite_link 邀请链接 | String 字符串 | Yes 是 | The invite link to edit 要编辑的邀请链接 |
name 名称 | String 字符串 | Optional 可选 | Invite link name; 0-32 characters 邀请链接名称;0-32 个字符 |
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 ChatInviteLink object.
使用此方法撤销由机器人创建的邀请链接。如果撤销了主链接,将自动生成一个新链接。机器人必须是聊天中的管理员,并且必须拥有适当的管理员权限。此操作返回被撤销的邀请链接,格式为 ChatInviteLink 对象。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier of the target chat or username of the target channel (in the format @channelusername )目标聊天的唯一标识符或目标频道的用户名(格式为 @channelusername ) |
invite_link 邀请链接 | String 字符串 | Yes 是 | The invite link to revoke 要撤销的邀请链接 |
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 can_invite_users administrator right. Returns True on success.
使用此方法批准聊天加入请求。机器人必须是聊天中的管理员,并且必须拥有 can_invite_users 管理员权限。成功时返回 True。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target chat or username of the target channel (in the format @channelusername )目标聊天的唯一标识符或目标频道的用户名(格式为 @channelusername ) |
user_id 用户 ID | Integer 整数 | Yes 是 | Unique identifier of the target user 目标用户的唯一标识符 |
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 can_invite_users administrator right. Returns True on success.
使用此方法拒绝聊天加入请求。机器人必须是聊天中的管理员才能使用此功能,并且必须拥有邀请用户的管理员权限。成功时返回 True。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target chat or username of the target channel (in the format @channelusername )目标聊天的唯一标识符或目标频道的用户名(格式为 @channelusername ) |
user_id 用户 ID | Integer 整数 | Yes 是 | Unique identifier of the target user 目标用户的唯一标识符 |
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 True on success.
使用此方法为聊天设置新的个人资料照片。私人聊天的照片无法更改。机器人必须是聊天中的管理员才能使用此功能,并且必须拥有相应的管理员权限。成功时返回 True。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target chat or username of the target channel (in the format @channelusername )目标聊天的唯一标识符或目标频道的用户名(格式为 @channelusername ) |
photo 照片 | InputFile 输入文件 | Yes 是 | New chat photo, uploaded using multipart/form-data 新聊天照片,使用 multipart/form-data 上传 |
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 True on success.
使用此方法删除聊天照片。私人聊天的照片无法更改。机器人必须是聊天中的管理员才能使用此功能,并且必须拥有适当的管理员权限。成功时返回 True。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target chat or username of the target channel (in the format @channelusername )目标聊天的唯一标识符或目标频道的用户名(格式为 @channelusername ) |
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 True on success.
使用此方法更改聊天的标题。私人聊天的标题无法更改。机器人必须是聊天中的管理员才能使用此功能,并且必须拥有适当的管理员权限。成功时返回 True。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target chat or username of the target channel (in the format @channelusername )目标聊天的唯一标识符或目标频道的用户名(格式为 @channelusername ) |
title 标题 | String 字符串 | Yes 是 | New chat title, 1-128 characters 新的聊天标题,1-128 个字符 |
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 True on success.
使用此方法更改群组、超级群组或频道的描述。机器人必须是聊天中的管理员才能工作,并且必须拥有相应的管理员权限。成功时返回 True。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target chat or username of the target channel (in the format @channelusername )目标聊天的唯一标识符或目标频道的用户名(格式为 @channelusername ) |
description 描述 | String 字符串 | Optional 可选 | New chat description, 0-255 characters 新聊天描述,0-255 个字符 |
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 True on success.
使用此方法将消息添加到聊天中的固定消息列表中。如果聊天不是私人聊天,机器人必须是聊天中的管理员才能工作,并且必须在超级群组中拥有 'can_pin_messages' 管理员权限,或在频道中拥有 'can_edit_messages' 管理员权限。成功时返回 True。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
business_connection_id 业务连接 ID | String 字符串 | Optional 可选 | Unique identifier of the business connection on behalf of which the message will be pinned 代表将要固定的消息的业务连接的唯一标识符 |
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target chat or username of the target channel (in the format @channelusername )目标聊天的唯一标识符或目标频道的用户名(格式为 @channelusername ) |
message_id 消息 ID | Integer 整数 | Yes 是 | Identifier of a message to pin 要固定的消息的标识符 |
disable_notification 禁用通知 | Boolean 布尔值 | Optional 可选 | Pass True 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. 如果不需要向所有聊天成员发送关于新固定消息的通知,请传递 True。在频道和私人聊天中,通知始终被禁用。 |
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 True on success.
使用此方法从聊天中已固定的消息列表中移除一条消息。如果聊天不是私人聊天,机器人必须是聊天中的管理员才能使用此功能,并且在超级群组中必须拥有“can_pin_messages”管理员权限,或者在频道中必须拥有“can_edit_messages”管理员权限。成功时返回 True。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
business_connection_id 业务连接 ID | String 字符串 | Optional 可选 | Unique identifier of the business connection on behalf of which the message will be unpinned 代表将要取消固定的消息的业务连接的唯一标识符 |
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target chat or username of the target channel (in the format @channelusername )目标聊天的唯一标识符或目标频道的用户名(格式为 @channelusername ) |
message_id 消息 ID | Integer 整数 | Optional 可选 | Identifier of the message to unpin. Required if business_connection_id is specified. If not specified, the most recent pinned message (by sending date) will be unpinned. 要取消置顶的消息的标识符。如果指定了 business_connection_id,则为必填项。如果未指定,将取消置顶最新的置顶消息(按发送日期)。 |
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 True on success.
使用此方法清除聊天中的置顶消息列表。如果聊天不是私人聊天,机器人必须是聊天中的管理员才能使用此功能,并且在超级群组中必须拥有“can_pin_messages”管理员权限,或者在频道中必须拥有“can_edit_messages”管理员权限。成功时返回 True。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target chat or username of the target channel (in the format @channelusername )目标聊天的唯一标识符或目标频道的用户名(格式为 @channelusername ) |
Use this method for your bot to leave a group, supergroup or channel. Returns True on success.
使用此方法让您的机器人离开群组、超级群组或频道。成功时返回 True。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername )目标聊天或目标超级群组或频道的唯一标识符或用户名(格式为 @channelusername ) |
Use this method to get up-to-date information about the chat. Returns a ChatFullInfo object on success.
使用此方法获取有关聊天的最新信息。成功时返回一个 ChatFullInfo 对象。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername )目标聊天或目标超级群组或频道的用户名的唯一标识符(格式为 @channelusername ) |
Use this method to get a list of administrators in a chat, which aren't bots. Returns an Array of ChatMember objects.
使用此方法获取聊天中非机器人的管理员列表。返回一个 ChatMember 对象数组。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername )目标聊天的唯一标识符或目标超级群组或频道的用户名(格式为 @channelusername ) |
Use this method to get the number of members in a chat. Returns Int on success.
使用此方法获取聊天中的成员数量。成功时返回 Int。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername )目标聊天或目标超级群组或频道的唯一标识符(格式为 @channelusername ) |
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 ChatMember object on success.
使用此方法获取聊天成员的信息。如果机器人在聊天中是管理员,此方法仅保证对其他用户有效。成功时返回一个 ChatMember 对象。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername )目标聊天或目标超级群组或频道的唯一标识符(格式为 @channelusername ) |
user_id 用户 ID | Integer 整数 | Yes 是 | Unique identifier of the target user 目标用户的唯一标识符 |
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 can_set_sticker_set optionally returned in getChat requests to check if the bot can use this method. Returns True on success.
使用此方法为超级群设置新的群组贴纸集。机器人必须是聊天中的管理员才能使用此功能,并且必须拥有适当的管理员权限。使用 getChat 请求中可选返回的 can_set_sticker_set 字段来检查机器人是否可以使用此方法。成功时返回 True。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername )目标聊天的唯一标识符或目标超级群的用户名(格式为 @supergroupusername ) |
sticker_set_name 贴纸集名称 | String 字符串 | Yes 是 | Name of the sticker set to be set as the group sticker set 将要设置为群组贴纸集的贴纸集名称 |
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 can_set_sticker_set optionally returned in getChat requests to check if the bot can use this method. Returns True on success.
使用此方法从超级群组中删除一个群组贴纸集。机器人必须是聊天中的管理员才能使用此功能,并且必须拥有适当的管理员权限。使用 getChat 请求中可选返回的 can_set_sticker_set 字段来检查机器人是否可以使用此方法。成功时返回 True。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername )目标聊天的唯一标识符或目标超级群的用户名(格式为 @supergroupusername ) |
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 Sticker objects.
使用此方法获取自定义表情贴纸,这些贴纸可以被任何用户用作论坛话题图标。不需要参数。返回一个 Sticker 对象数组。
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 can_manage_topics administrator rights. Returns information about the created topic as a ForumTopic object.
使用此方法在论坛超级群聊中创建主题。机器人必须是聊天的管理员才能使用此功能,并且必须拥有 can_manage_topics 管理员权限。返回创建的主题信息,格式为 ForumTopic 对象。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername )目标聊天的唯一标识符或目标超级群的用户名(格式为 @supergroupusername ) |
name 名称 | String 字符串 | Yes 是 | Topic name, 1-128 characters 主题名称,1-128 个字符 |
icon_color 图标颜色 | Integer 整数 | Optional 可选 | 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) 主题图标的颜色,RGB 格式。目前必须是以下之一:7322096 (0x6FB9F0)、16766590 (0xFFD67E)、13338331 (0xCB86DB)、9367192 (0x8EEE98)、16749490 (0xFF93B2)或 16478047 (0xFB6F5F) |
icon_custom_emoji_id | String 字符串 | Optional 可选 | Unique identifier of the custom emoji shown as the topic icon. Use getForumTopicIconStickers to get all allowed custom emoji identifiers. 显示为主题图标的自定义表情符号的唯一标识符。使用 getForumTopicIconStickers 获取所有允许的自定义表情符号标识符。 |
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 the can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success.
使用此方法编辑论坛超级群聊中的主题名称和图标。机器人必须是聊天的管理员才能使用此功能,并且必须拥有 can_manage_topics 管理员权限,除非它是主题的创建者。成功时返回 True。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername )目标聊天的唯一标识符或目标超级群的用户名(格式为 @supergroupusername ) |
message_thread_id | Integer 整数 | Yes 是 | Unique identifier for the target message thread of the forum topic 论坛主题目标消息线程的唯一标识符 |
name 名称 | String 字符串 | Optional 可选 | New topic name, 0-128 characters. If not specified or empty, the current name of the topic will be kept 新主题名称,0-128 个字符。如果未指定或为空,将保留当前主题名称 |
icon_custom_emoji_id | String 字符串 | Optional 可选 | New unique identifier of the custom emoji shown as the topic icon. Use getForumTopicIconStickers to get all allowed custom emoji identifiers. Pass an empty string to remove the icon. If not specified, the current icon will be kept 显示为主题图标的自定义表情符号的新唯一标识符。使用 getForumTopicIconStickers 获取所有允许的自定义表情符号标识符。传递一个空字符串以移除图标。如果未指定,将保留当前图标 |
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 can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success.
使用此方法关闭论坛超级群聊中的开放话题。机器人必须是聊天中的管理员才能使用此功能,并且必须拥有 can_manage_topics 管理员权限,除非它是话题的创建者。成功时返回 True。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername )目标聊天的唯一标识符或目标超级群的用户名(格式为 @supergroupusername ) |
message_thread_id | Integer 整数 | Yes 是 | Unique identifier for the target message thread of the forum topic 论坛话题目标消息线程的唯一标识符 |
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 can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success.
使用此方法重新打开论坛超级群聊中的已关闭话题。机器人必须是聊天中的管理员才能使用此功能,并且必须拥有 can_manage_topics 管理员权限,除非它是话题的创建者。成功时返回 True。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername )目标聊天的唯一标识符或目标超级群的用户名(格式为 @supergroupusername ) |
message_thread_id | Integer 整数 | Yes 是 | Unique identifier for the target message thread of the forum topic 论坛话题目标消息线程的唯一标识符 |
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 can_delete_messages administrator rights. Returns True on success.
使用此方法删除论坛超级群聊中的论坛主题及其所有消息。机器人必须是聊天中的管理员才能使用此功能,并且必须拥有可以删除消息的管理员权限。成功时返回 True。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername )目标聊天的唯一标识符或目标超级群的用户名(格式为 @supergroupusername ) |
message_thread_id | Integer 整数 | Yes 是 | Unique identifier for the target message thread of the forum topic 论坛主题目标消息线程的唯一标识符 |
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 can_pin_messages administrator right in the supergroup. Returns True on success.
使用此方法清除论坛主题中置顶消息的列表。机器人必须是聊天中的管理员才能使用此功能,并且必须在超级群组中拥有可以置顶消息的管理员权限。成功时返回 True。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername )目标聊天的唯一标识符或目标超级群的用户名(格式为 @supergroupusername ) |
message_thread_id | Integer 整数 | Yes 是 | Unique identifier for the target message thread of the forum topic 论坛主题目标消息线程的唯一标识符 |
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 the can_manage_topics administrator rights. Returns True on success.
使用此方法编辑论坛超级群聊中“通用”主题的名称。机器人必须是聊天中的管理员,并且必须拥有 can_manage_topics 管理员权限。此操作成功时返回 True。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername )目标聊天的唯一标识符或目标超级群的用户名(格式为 @supergroupusername ) |
name 名称 | String 字符串 | Yes 是 | New topic name, 1-128 characters 新主题名称,1-128 个字符 |
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 can_manage_topics administrator rights. Returns True on success.
使用此方法关闭论坛超级群聊中的“常规”主题。机器人必须是聊天中的管理员才能使用此功能,并且必须拥有 can_manage_topics 管理员权限。成功时返回 True。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername )目标聊天的唯一标识符或目标超级群的用户名(格式为 @supergroupusername ) |
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 can_manage_topics administrator rights. The topic will be automatically unhidden if it was hidden. Returns True on success.
使用此方法重新打开论坛超级群聊中已关闭的“常规”主题。机器人必须是聊天中的管理员才能使用此功能,并且必须拥有 can_manage_topics 管理员权限。如果主题被隐藏,将自动取消隐藏。成功时返回 True。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername )目标聊天的唯一标识符或目标超级群的用户名(格式为 @supergroupusername ) |
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 can_manage_topics administrator rights. The topic will be automatically closed if it was open. Returns True on success.
使用此方法隐藏论坛超级群聊中的“常规”主题。机器人必须是聊天中的管理员才能使用此功能,并且必须拥有 can_manage_topics 管理员权限。如果主题是打开的,将自动关闭。成功时返回 True。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername )目标聊天的唯一标识符或目标超级群的用户名(格式为 @supergroupusername ) |
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 can_manage_topics administrator rights. Returns True on success.
使用此方法在论坛超级群聊中取消隐藏“常规”主题。机器人必须是聊天中的管理员才能使用此功能,并且必须拥有 can_manage_topics 管理员权限。成功时返回 True。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername )目标聊天的唯一标识符或目标超级群的用户名(格式为 @supergroupusername ) |
Use this method to clear the list of pinned messages in a General forum topic. The bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup. Returns True on success.
使用此方法清除常规论坛主题中已固定的消息列表。机器人必须是聊天中的管理员才能使用此功能,并且必须在超级群中拥有 can_pin_messages 管理员权限。成功时返回 True。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername )目标聊天的唯一标识符或目标超级群的用户名(格式为 @supergroupusername ) |
Use this method to send answers to callback queries sent from inline keyboards. The answer will be displayed to the user as a notification at the top of the chat screen or as an alert. On success, True is returned.
使用此方法发送对从内联键盘发送的回调查询的回答。回答将作为聊天屏幕顶部的通知或警报显示给用户。成功时返回 True。
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 @BotFather and accept the terms. Otherwise, you may use links like
t.me/your_bot?start=XXXX
that open your bot with a parameter.
或者,用户可以被重定向到指定的游戏 URL。为了此选项能够工作,您必须首先通过@BotFather 为您的机器人创建一个游戏并接受条款。否则,您可以使用像t.me/your_bot?start=XXXX
这样的链接,以参数方式打开您的机器人。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
callback_query_id | String 字符串 | Yes 是 | Unique identifier for the query to be answered 要回答的查询的唯一标识符 |
text 文本 | String 字符串 | Optional 可选 | Text of the notification. If not specified, nothing will be shown to the user, 0-200 characters 通知的文本。如果未指定,则不会向用户显示任何内容,0-200 个字符 |
show_alert | Boolean 布尔值 | Optional 可选 | If True, an alert will be shown by the client instead of a notification at the top of the chat screen. Defaults to false. 如果为真,客户端将显示警报而不是在聊天屏幕顶部显示通知。默认为假。 |
url | String 字符串 | Optional 可选 | URL that will be opened by the user's client. If you have created a Game and accepted the conditions via @BotFather, specify the URL that opens your game - note that this will only work if the query comes from a callback_game button. 用户客户端将打开的 URL。如果您已经创建了一个游戏并通过@BotFather 接受了条件,请指定打开您游戏的 URL - 请注意,这仅在查询来自 callback_game 按钮时有效。 Otherwise, you may use links like t.me/your_bot?start=XXXX that open your bot with a parameter.否则,您可以使用像 t.me/your_bot?start=XXXX 这样的链接来打开带参数的机器人。 |
cache_time 缓存时间 | Integer 整数 | Optional 可选 | 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. 回调查询结果在客户端可以缓存的最大时间(秒)。Telegram 应用从 3.14 版本开始支持缓存。默认为 0。 |
Use this method to get the list of boosts added to a chat by a user. Requires administrator rights in the chat. Returns a UserChatBoosts object.
使用此方法获取用户添加到聊天的增强列表。需要在聊天中具有管理员权限。返回一个 UserChatBoosts 对象。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the chat or username of the channel (in the format @channelusername )聊天的唯一标识符或频道的用户名(格式为 @channelusername ) |
user_id 用户 ID | Integer 整数 | Yes 是 | Unique identifier of the target user 目标用户的唯一标识符 |
Use this method to get information about the connection of the bot with a business account. Returns a BusinessConnection object on success.
使用此方法获取机器人与业务账户的连接信息。成功时返回一个 BusinessConnection 对象。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
business_connection_id 业务连接 ID | String 字符串 | Yes 是 | Unique identifier of the business connection 业务连接的唯一标识符 |
Use this method to change the list of the bot's commands. See this manual for more details about bot commands. Returns True on success.
使用此方法更改机器人命令列表。有关机器人命令的更多详细信息,请参阅此手册。成功时返回 True。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
commands 命令 | Array of BotCommand BotCommand 数组 | Yes 是 | 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. 要设置为机器人命令列表的 JSON 序列化机器人命令列表。最多可以指定 100 个命令。 |
scope 范围 | BotCommandScope 机器人命令范围 | Optional 可选 | A JSON-serialized object, describing scope of users for which the commands are relevant. Defaults to BotCommandScopeDefault. 一个 JSON 序列化的对象,描述命令适用的用户范围。默认为 BotCommandScopeDefault。 |
language_code 语言代码 | String 字符串 | Optional 可选 | 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 一个两字母的 ISO 639-1 语言代码。如果为空,命令将应用于给定范围内所有没有专用命令的用户。 |
Use this method to delete the list of the bot's commands for the given scope and user language. After deletion, higher level commands will be shown to affected users. Returns True on success.
使用此方法删除给定范围和用户语言的机器人命令列表。删除后,受影响的用户将显示更高级别的命令。成功时返回 True。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
scope 范围 | BotCommandScope 机器人命令范围 | Optional 可选 | A JSON-serialized object, describing scope of users for which the commands are relevant. Defaults to BotCommandScopeDefault. 一个 JSON 序列化的对象,描述命令适用的用户范围。默认为 BotCommandScopeDefault。 |
language_code 语言代码 | String 字符串 | Optional 可选 | 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 一个两字母的 ISO 639-1 语言代码。如果为空,命令将应用于给定范围内所有没有专用命令的用户。 |
Use this method to get the current list of the bot's commands for the given scope and user language. Returns an Array of BotCommand objects. If commands aren't set, an empty list is returned.
使用此方法获取机器人在给定范围和用户语言下的当前命令列表。返回一个 BotCommand 对象数组。如果未设置命令,则返回空列表。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
scope 范围 | BotCommandScope 机器人命令范围 | Optional 可选 | A JSON-serialized object, describing scope of users. Defaults to BotCommandScopeDefault. 一个 JSON 序列化的对象,描述用户范围。默认为 BotCommandScopeDefault。 |
language_code 语言代码 | String 字符串 | Optional 可选 | A two-letter ISO 639-1 language code or an empty string 一个两字母的 ISO 639-1 语言代码或一个空字符串 |
Use this method to change the bot's name. Returns True on success.
使用此方法更改机器人的名称。成功时返回 True。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
name 名称 | String 字符串 | Optional 可选 | New bot name; 0-64 characters. Pass an empty string to remove the dedicated name for the given language. 新机器人名称;0-64 个字符。传递一个空字符串以删除指定语言的专用名称。 |
language_code 语言代码 | String 字符串 | Optional 可选 | 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. 两个字母的 ISO 639-1 语言代码。如果为空,则名称将显示给所有没有专用名称的语言的用户。 |
Use this method to get the current bot name for the given user language. Returns BotName on success.
使用此方法获取给定用户语言的当前机器人名称。成功时返回 BotName。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
language_code 语言代码 | String 字符串 | Optional 可选 | A two-letter ISO 639-1 language code or an empty string 两个字母的 ISO 639-1 语言代码或空字符串 |
Use this method to change the bot's description, which is shown in the chat with the bot if the chat is empty. Returns True on success.
使用此方法更改机器人的描述,如果聊天为空,该描述将显示在与机器人的聊天中。成功时返回 True。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
description 描述 | String 字符串 | Optional 可选 | New bot description; 0-512 characters. Pass an empty string to remove the dedicated description for the given language. 新的机器人描述;0-512 个字符。传递一个空字符串以删除给定语言的专用描述。 |
language_code 语言代码 | String 字符串 | Optional 可选 | 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. 一个两字母的 ISO 639-1 语言代码。如果为空,则描述将应用于所有没有专用描述的用户语言。 |
Use this method to get the current bot description for the given user language. Returns BotDescription on success.
使用此方法获取给定用户语言的当前机器人描述。成功时返回 BotDescription。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
language_code 语言代码 | String 字符串 | Optional 可选 | A two-letter ISO 639-1 language code or an empty string 一个两字母的 ISO 639-1 语言代码或一个空字符串 |
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 True on success.
使用此方法更改机器人的简短描述,该描述显示在机器人资料页面上,并在用户分享机器人时随链接一起发送。成功时返回 True。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
short_description 简短描述 | String 字符串 | Optional 可选 | New short description for the bot; 0-120 characters. Pass an empty string to remove the dedicated short description for the given language. 机器人的新简短描述;0-120 个字符。传递一个空字符串以删除指定语言的专用简短描述。 |
language_code 语言代码 | String 字符串 | Optional 可选 | 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. 两个字母的 ISO 639-1 语言代码。如果为空,简短描述将应用于所有没有专用简短描述的用户语言。 |
Use this method to get the current bot short description for the given user language. Returns BotShortDescription on success.
使用此方法获取给定用户语言的当前机器人简短描述。成功时返回 BotShortDescription。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
language_code 语言代码 | String 字符串 | Optional 可选 | A two-letter ISO 639-1 language code or an empty string 一个两字母的 ISO 639-1 语言代码或一个空字符串 |
Use this method to change the bot's menu button in a private chat, or the default menu button. Returns True on success.
使用此方法更改机器人在私人聊天中的菜单按钮,或默认菜单按钮。成功时返回 True。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
chat_id | Integer 整数 | Optional 可选 | Unique identifier for the target private chat. If not specified, default bot's menu button will be changed 目标私人聊天的唯一标识符。如果未指定,将更改默认的机器人菜单按钮 |
menu_button | MenuButton 菜单按钮 | Optional 可选 | A JSON-serialized object for the bot's new menu button. Defaults to MenuButtonDefault 一个用于机器人新菜单按钮的 JSON 序列化对象。默认为 MenuButtonDefault |
Use this method to get the current value of the bot's menu button in a private chat, or the default menu button. Returns MenuButton on success.
使用此方法获取机器人在私人聊天中的菜单按钮的当前值,或默认菜单按钮。成功时返回 MenuButton。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
chat_id | Integer 整数 | Optional 可选 | Unique identifier for the target private chat. If not specified, default bot's menu button will be returned 目标私人聊天的唯一标识符。如果未指定,将返回默认的机器人菜单按钮 |
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 True on success.
使用此方法更改机器人被添加为群组或频道的管理员时请求的默认管理员权限。这些权限将建议给用户,但用户可以在添加机器人之前自由修改列表。成功时返回 True。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
rights 权限 | ChatAdministratorRights 聊天管理员权限 | Optional 可选 | A JSON-serialized object describing new default administrator rights. If not specified, the default administrator rights will be cleared. 一个描述新的默认管理员权限的 JSON 序列化对象。如果未指定,默认管理员权限将被清除。 |
for_channels 对于频道 | Boolean 布尔值 | Optional 可选 | Pass True 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. 传递 True 以更改机器人在频道中的默认管理员权限。否则,将更改机器人在群组和超级群组的默认管理员权限。 |
Use this method to get the current default administrator rights of the bot. Returns ChatAdministratorRights on success.
使用此方法获取机器人当前的默认管理员权限。成功时返回 ChatAdministratorRights。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
for_channels 频道 | Boolean 布尔值 | Optional 可选 | Pass True to get default administrator rights of the bot in channels. Otherwise, default administrator rights of the bot for groups and supergroups will be returned. 传递 True 以获取机器人在频道中的默认管理员权限。否则,将返回机器人在群组和超级群组中的默认管理员权限。 |
Methods and objects used in the inline mode are described in the Inline mode section.
内联模式中使用的方法和对象在内联模式部分中有描述。
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 inline keyboards using callback queries, but can also help reduce clutter in conversations with regular chat bots.
以下方法允许您更改消息历史记录中现有的消息,而不是发送一个包含操作结果的新消息。这对于使用回调查询的内联键盘消息最有用,但也可以帮助减少与常规聊天机器人的对话中的混乱。
Please note, that it is currently only possible to edit messages without reply_markup or with inline keyboards.
请注意,目前只能编辑没有 reply_markup 或带有内联键盘的消息。
Use this method to edit text and game messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.
使用此方法来编辑文本和游戏消息。成功时,如果编辑的消息不是内联消息,则返回编辑后的消息,否则返回 True。请注意,未由机器人发送且不包含内联键盘的业务消息只能在发送后的 48 小时内编辑。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
business_connection_id 业务连接 ID | String 字符串 | Optional 可选 | Unique identifier of the business connection on behalf of which the message to be edited was sent 代表要编辑的消息发送的业务连接的唯一标识符 |
chat_id | Integer or String 整数或字符串 | Optional 可选 | Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername )如果未指定 inline_message_id,则为必填项。目标聊天的唯一标识符或目标频道的用户名(格式为 @channelusername ) |
message_id 消息 ID | Integer 整数 | Optional 可选 | Required if inline_message_id is not specified. Identifier of the message to edit 如果未指定 inline_message_id,则为必填项。编辑消息的标识符 |
inline_message_id | String 字符串 | Optional 可选 | Required if chat_id and message_id are not specified. Identifier of the inline message 如果未指定 chat_id 和 message_id,则为必填项。内联消息的标识符 |
text 文本 | String 字符串 | Yes 是 | New text of the message, 1-4096 characters after entities parsing 消息的新文本,实体解析后为 1-4096 个字符 |
parse_mode 解析模式 | String 字符串 | Optional 可选 | Mode for parsing entities in the message text. See formatting options for more details. 解析消息文本中实体的模式。有关更多详细信息,请参阅格式化选项。 |
entities 实体 | Array of MessageEntity MessageEntity 数组 | Optional 可选 | A JSON-serialized list of special entities that appear in message text, which can be specified instead of parse_mode 消息文本中出现的特殊实体的 JSON 序列化列表,可以替代 parse_mode 指定 |
link_preview_options | LinkPreviewOptions 链接预览选项 | Optional 可选 | Link preview generation options for the message 消息的链接预览生成选项 |
reply_markup | InlineKeyboardMarkup 内联键盘标记 | Optional 可选 | A JSON-serialized object for an inline keyboard. 内联键盘的 JSON 序列化对象。 |
Use this method to edit captions of messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.
使用此方法编辑消息的标题。如果编辑成功,如果编辑的消息不是内联消息,则返回编辑后的消息,否则返回 True。请注意,未由机器人发送且不包含内联键盘的业务消息只能在发送后 48 小时内编辑。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
business_connection_id 业务连接 ID | String 字符串 | Optional 可选 | Unique identifier of the business connection on behalf of which the message to be edited was sent 代表发送要编辑的消息的业务连接的唯一标识符 |
chat_id | Integer or String 整数或字符串 | Optional 可选 | Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername )如果未指定 inline_message_id,则为必填项。目标聊天的唯一标识符或目标频道的用户名(格式为 @channelusername ) |
message_id 消息 ID | Integer 整数 | Optional 可选 | Required if inline_message_id is not specified. Identifier of the message to edit 如果未指定 inline_message_id,则为必填项。要编辑的消息的标识符 |
inline_message_id | String 字符串 | Optional 可选 | Required if chat_id and message_id are not specified. Identifier of the inline message 如果未指定 chat_id 和 message_id,则为必填项。内联消息的标识符 |
caption 标题 | String 字符串 | Optional 可选 | New caption of the message, 0-1024 characters after entities parsing 消息的新标题,实体解析后 0-1024 个字符 |
parse_mode 解析模式 | String 字符串 | Optional 可选 | Mode for parsing entities in the message caption. See formatting options for more details. 解析消息标题中实体的模式。查看格式化选项以获取更多详情。 |
caption_entities 标题实体 | Array of MessageEntity MessageEntity 数组 | Optional 可选 | A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode 标题中出现的特殊实体的 JSON 序列化列表,可以代替 parse_mode 指定 |
show_caption_above_media 在媒体上方显示标题 |
Boolean 布尔值 | Optional 可选 | Pass True, if the caption must be shown above the message media. Supported only for animation, photo and video messages. 如果标题必须显示在消息媒体上方,请传递 True。仅支持动画、照片和视频消息。 |
reply_markup | InlineKeyboardMarkup 内联键盘标记 | Optional 可选 | A JSON-serialized object for an inline keyboard. 内联键盘的 JSON 序列化对象。 |
Use this method to edit animation, audio, document, photo, or video messages, or to add media to text 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 Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.
使用此方法编辑动画、音频、文档、照片或视频消息,或向文本消息添加媒体。如果消息是消息相册的一部分,则只能将其编辑为音频相册的音频、文档相册的文档,或者其他情况下的照片或视频。当编辑内联消息时,不能上传新文件;请使用之前通过其 file_id 上传的文件或指定一个 URL。成功时,如果编辑的消息不是内联消息,则返回编辑后的消息,否则返回 True。请注意,机器人未发送且不包含内联键盘的业务消息只能在发送后 48 小时内编辑。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
business_connection_id 业务连接 ID | String 字符串 | Optional 可选 | Unique identifier of the business connection on behalf of which the message to be edited was sent 代表发送要编辑的消息的业务连接的唯一标识符 |
chat_id | Integer or String 整数或字符串 | Optional 可选 | Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername )如果未指定 inline_message_id,则为必填项。目标聊天的唯一标识符或目标频道的用户名(格式为 @channelusername ) |
message_id 消息 ID | Integer 整数 | Optional 可选 | Required if inline_message_id is not specified. Identifier of the message to edit 如果未指定 inline_message_id,则为必填项。要编辑的消息的标识符 |
inline_message_id | String 字符串 | Optional 可选 | Required if chat_id and message_id are not specified. Identifier of the inline message 如果未指定 chat_id 和 message_id,则为必填项。内联消息的标识符 |
media 媒体 | InputMedia 输入媒体 | Yes 是 | A JSON-serialized object for a new media content of the message 消息的新媒体内容的 JSON 序列化对象 |
reply_markup | InlineKeyboardMarkup 内联键盘标记 | Optional 可选 | A JSON-serialized object for a new inline keyboard. 一个用于新内联键盘的 JSON 序列化对象。 |
Use this method to edit live location messages. A location can be edited until its live_period expires or editing is explicitly disabled by a call to stopMessageLiveLocation. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.
使用此方法编辑实时位置消息。位置可以在其 live_period 过期之前或通过调用 stopMessageLiveLocation 明确禁用编辑之前进行编辑。成功时,如果编辑的消息不是内联消息,则返回编辑后的消息,否则返回 True。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
business_connection_id 业务连接 ID | String 字符串 | Optional 可选 | Unique identifier of the business connection on behalf of which the message to be edited was sent 代表发送要编辑的消息的业务连接的唯一标识符 |
chat_id | Integer or String 整数或字符串 | Optional 可选 | Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername )如果未指定 inline_message_id,则为必需项。目标聊天的唯一标识符或目标频道的用户名(格式为 @channelusername ) |
message_id 消息 ID | Integer 整数 | Optional 可选 | Required if inline_message_id is not specified. Identifier of the message to edit 如果未指定 inline_message_id,则为必填项。编辑消息的标识符 |
inline_message_id | String 字符串 | Optional 可选 | Required if chat_id and message_id are not specified. Identifier of the inline message 如果未指定 chat_id 和 message_id,则为必填项。内联消息的标识符 |
latitude 纬度 | Float 浮点数 | Yes 是 | Latitude of new location 新位置的纬度 |
longitude 经度 | Float 浮点数 | Yes 是 | Longitude of new location 新位置的经度 |
live_period 实时周期 | Integer 整数 | Optional 可选 | New period in seconds during which the location can be updated, starting from the message send date. If 0x7FFFFFFF is specified, then the location can be updated forever. Otherwise, the new value must not exceed the current live_period by more than a day, and the live location expiration date must remain within the next 90 days. If not specified, then live_period remains unchanged 从消息发送日期开始,位置可以更新的新周期(以秒为单位)。如果指定了 0x7FFFFFFF,则位置可以永远更新。否则,新值不得超过当前 live_period 一天以上,且实时位置到期日期必须保持在未来 90 天内。如果未指定,则 live_period 保持不变 |
horizontal_accuracy 水平精度 | Float 浮点数 | Optional 可选 | The radius of uncertainty for the location, measured in meters; 0-1500 位置的不确定性半径,以米为单位测量;0-1500 |
heading 航向 | Integer 整数 | Optional 可选 | Direction in which the user is moving, in degrees. Must be between 1 and 360 if specified. 用户移动的方向,单位为度。如果指定,必须在 1 到 360 之间。 |
proximity_alert_radius 接近警报半径 | Integer 整数 | Optional 可选 | The maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified. 接近另一个聊天成员时的接近警报的最大距离,单位为米。如果指定,必须在 1 到 100000 之间。 |
reply_markup | InlineKeyboardMarkup 内联键盘标记 | Optional 可选 | A JSON-serialized object for a new inline keyboard. 一个用于新内联键盘的 JSON 序列化对象。 |
Use this method to stop updating a live location message before live_period expires. On success, if the message is not an inline message, the edited Message is returned, otherwise True is returned.
在 live_period 到期之前使用此方法停止更新实时位置消息。成功时,如果消息不是内联消息,则返回已编辑的消息,否则返回 True。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
business_connection_id 业务连接 ID | String 字符串 | Optional 可选 | Unique identifier of the business connection on behalf of which the message to be edited was sent 代表发送要编辑的消息的业务连接的唯一标识符 |
chat_id | Integer or String 整数或字符串 | Optional 可选 | Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername )如果未指定 inline_message_id,则为必填。目标聊天的唯一标识符或目标频道的用户名(格式为 @channelusername ) |
message_id 消息 ID | Integer 整数 | Optional 可选 | Required if inline_message_id is not specified. Identifier of the message with live location to stop 如果未指定 inline_message_id,则为必填。停止实时位置消息的标识符 |
inline_message_id | String 字符串 | Optional 可选 | Required if chat_id and message_id are not specified. Identifier of the inline message 如果未指定 chat_id 和 message_id,则为必填。内联消息的标识符 |
reply_markup | InlineKeyboardMarkup 内联键盘标记 | Optional 可选 | A JSON-serialized object for a new inline keyboard. 一个用于新内联键盘的 JSON 序列化对象。 |
Use this method to edit only the reply markup of messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.
使用此方法仅编辑消息的回复标记。如果编辑的消息不是内联消息,则返回编辑后的消息,否则返回 True。请注意,未由机器人发送且不包含内联键盘的业务消息只能在发送后 48 小时内编辑。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
business_connection_id 业务连接 ID | String 字符串 | Optional 可选 | Unique identifier of the business connection on behalf of which the message to be edited was sent 代表发送要编辑的消息的业务连接的唯一标识符 |
chat_id | Integer or String 整数或字符串 | Optional 可选 | Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername )如果未指定 inline_message_id,则需要。目标聊天的唯一标识符或目标频道的用户名(格式为 @channelusername ) |
message_id 消息 ID | Integer 整数 | Optional 可选 | Required if inline_message_id is not specified. Identifier of the message to edit 如果未指定 inline_message_id,则为必填项。编辑消息的标识符 |
inline_message_id | String 字符串 | Optional 可选 | Required if chat_id and message_id are not specified. Identifier of the inline message 如果未指定 chat_id 和 message_id,则为必填项。内联消息的标识符 |
reply_markup | InlineKeyboardMarkup 内联键盘标记 | Optional 可选 | A JSON-serialized object for an inline keyboard. 内联键盘的 JSON 序列化对象 |
Use this method to stop a poll which was sent by the bot. On success, the stopped Poll is returned.
使用此方法停止由机器人发送的投票。成功时,返回已停止的投票。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
business_connection_id 业务连接 ID | String 字符串 | Optional 可选 | Unique identifier of the business connection on behalf of which the message to be edited was sent 代表发送待编辑消息的业务连接的唯一标识符 |
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target chat or username of the target channel (in the format @channelusername )目标聊天的唯一标识符或目标频道的用户名(格式为 @channelusername ) |
message_id 消息 ID | Integer 整数 | Yes 是 | Identifier of the original message with the poll 带有投票的原始消息的标识符 |
reply_markup | InlineKeyboardMarkup 内联键盘标记 | Optional 可选 | A JSON-serialized object for a new message inline keyboard. 用于新消息内联键盘的 JSON 序列化对象 |
Use this method to delete a message, including service messages, with the following limitations:
使用此方法删除消息,包括服务消息,具有以下限制:
- A message can only be deleted if it was sent less than 48 hours ago.
- 只有在消息发送不到 48 小时内才能删除该消息。
- Service messages about a supergroup, channel, or forum topic creation can't be deleted.
- 关于超级群组、频道或论坛主题创建的服务消息无法删除。
- A dice message in a private chat can only be deleted if it was sent more than 24 hours ago.
- 私人聊天中的骰子消息只有在发送超过 24 小时后才能删除。
- Bots can delete outgoing messages in private chats, groups, and supergroups.
- 机器人可以在私人聊天、群组和超级群组中删除发出的消息。
- Bots can delete incoming messages in private chats.
- 机器人可以在私人聊天中删除收到的消息。
- Bots granted can_post_messages permissions can delete outgoing messages in channels.
- 被授予 can_post_messages 权限的机器人可以在频道中删除发出的消息。
- If the bot is an administrator of a group, it can delete any message there.
- 如果机器人是群组的管理员,它可以删除该群组中的任何消息。
- If the bot has can_delete_messages permission in a supergroup or a channel, it can delete any message there.
- 如果机器人在超级群组或频道中拥有 can_delete_messages 权限,它可以删除那里的任何消息。
Returns True on success. 成功时返回 True。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target chat or username of the target channel (in the format @channelusername )目标聊天的唯一标识符或目标频道的用户名(格式为 @channelusername ) |
message_id 消息 ID | Integer 整数 | Yes 是 | Identifier of the message to delete 要删除的消息的标识符 |
Use this method to delete multiple messages simultaneously. If some of the specified messages can't be found, they are skipped. Returns True on success.
使用此方法可以同时删除多条消息。如果某些指定的消息找不到,它们会被跳过。成功时返回 True。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target chat or username of the target channel (in the format @channelusername )目标聊天的唯一标识符或目标频道的用户名(格式为 @channelusername ) |
message_ids 消息 ID | Array of Integer 整数数组 | Yes 是 | A JSON-serialized list of 1-100 identifiers of messages to delete. See deleteMessage for limitations on which messages can be deleted 一个 JSON 序列化的消息标识符列表,包含 1-100 条要删除的消息。有关可以删除哪些消息的限制,请参见 deleteMessage。 |
The following methods and objects allow your bot to handle stickers and sticker sets.
以下方法和对象允许您的机器人处理贴纸和贴纸集。
This object represents a sticker.
此对象代表一个贴纸。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
file_id | String 字符串 | Identifier for this file, which can be used to download or reuse the file 此文件的标识符,可用于下载或重用该文件 |
file_unique_id | String 字符串 | 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. 此文件的唯一标识符,应随时间和不同机器人保持相同。不能用于下载或重新使用文件。 |
type 类型 | String 字符串 | 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 is_animated and is_video. 贴纸的类型,目前有“regular”、“mask”、“custom_emoji”三种。贴纸的类型与其格式无关,格式由字段 is_animated 和 is_video 决定。 |
width 宽度 | Integer 整数 | Sticker width 贴纸宽度 |
height 高度 | Integer 整数 | Sticker height 贴纸高度 |
is_animated 是动画 | Boolean 布尔值 | True, if the sticker is animated 如果贴纸是动画的,则为 True |
is_video 是视频 | Boolean 布尔值 | True, if the sticker is a video sticker 如果贴纸是视频贴纸,则为 True |
thumbnail 缩略图 | PhotoSize 照片尺寸 | Optional. Sticker thumbnail in the .WEBP or .JPG format 可选。贴纸缩略图,格式为.WEBP 或.JPG |
emoji 表情符号 | String 字符串 | Optional. Emoji associated with the sticker 可选。与贴纸关联的表情符号 |
set_name | String 字符串 | Optional. Name of the sticker set to which the sticker belongs 可选。贴纸所属的贴纸集名称 |
premium_animation | File 文件 | Optional. For premium regular stickers, premium animation for the sticker 可选。对于高级常规贴纸,高级动画用于贴纸。 |
mask_position 面具位置 | MaskPosition 面具位置 | Optional. For mask stickers, the position where the mask should be placed 可选。对于面具贴纸,面具应放置的位置 |
custom_emoji_id | String 字符串 | Optional. For custom emoji stickers, unique identifier of the custom emoji 可选。对于自定义表情贴纸,自定义表情的唯一标识符 |
needs_repainting 需要重新绘制 | True 真 | Optional. True, 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 可选。如果贴纸必须重新绘制为消息中的文本颜色、表情符号状态中的 Telegram Premium 徽章颜色、聊天照片上的白色颜色,或在其他地方的其他适当颜色,则为 True |
file_size | Integer 整数 | Optional. File size in bytes 可选。文件大小(以字节为单位) |
This object represents a sticker set.
这个对象代表一个贴纸集。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
name 名称 | String 字符串 | Sticker set name 贴纸集名称 |
title 标题 | String 字符串 | Sticker set title 贴纸集标题 |
sticker_type 贴纸类型 | String 字符串 | Type of stickers in the set, currently one of “regular”, “mask”, “custom_emoji” 贴纸集中的贴纸类型,目前有“普通”、“面具”、“自定义表情符号”之一 |
stickers 贴纸 | Array of Sticker 贴纸数组 | List of all set stickers 所有设置的贴纸列表 |
thumbnail 缩略图 | PhotoSize 照片尺寸 | Optional. Sticker set thumbnail in the .WEBP, .TGS, or .WEBM format 可选。贴纸集缩略图,格式为.WEBP、.TGS 或.WEBM |
This object describes the position on faces where a mask should be placed by default.
此对象描述了默认情况下口罩应放置在面部的位置。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
point 点 | String 字符串 | The part of the face relative to which the mask should be placed. One of “forehead”, “eyes”, “mouth”, or “chin”. 相对于口罩应放置的面部部分。可以是“前额”、“眼睛”、“嘴巴”或“下巴”之一。 |
x_shift | Float 浮点数 | 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. 以口罩宽度为单位,根据面部大小测量的 X 轴位移,从左到右。例如,选择-1.0 将口罩放置在默认口罩位置的左侧。 |
y_shift y_偏移 | Float 浮点数 | 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. 按 Y 轴偏移,单位为按面部大小缩放的掩码高度,从上到下。例如,1.0 将掩码放置在默认掩码位置的正下方。 |
scale 缩放 | Float 浮点数 | Mask scaling coefficient. For example, 2.0 means double size. 掩码缩放系数。例如,2.0 表示双倍大小。 |
This object describes a sticker to be added to a sticker set.
此对象描述要添加到贴纸集中的贴纸。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
sticker 贴纸 | InputFile or String 输入文件或字符串 | The added sticker. Pass a file_id 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. More information on Sending Files » 添加的贴纸。传递一个文件 ID 作为字符串以发送已存在于 Telegram 服务器上的文件,传递一个 HTTP URL 作为字符串让 Telegram 从互联网获取文件,使用 multipart/form-data 上传一个新文件,或者传递“attach://”以 multipart/form-data 方式在名称下上传一个新文件。动画和视频贴纸不能通过 HTTP URL 上传。更多关于发送文件的信息请查看» |
format 格式 | String 字符串 | Format of the added sticker, must be one of “static” for a .WEBP or .PNG image, “animated” for a .TGS animation, “video” for a .WEBM video 添加的贴纸格式,必须是“static”表示.WEBP 或.PNG 图像,“animated”表示.TGS 动画,“video”表示.WEBM 视频之一 |
emoji_list 表情符号列表 | Array of String 字符串数组 | List of 1-20 emoji associated with the sticker 与贴纸相关联的 1-20 个表情符号列表 |
mask_position | MaskPosition | Optional. Position where the mask should be placed on faces. For “mask” stickers only. 可选。面具应放置在面部的位置,仅适用于“面具”贴纸。 |
keywords 关键词 | Array of String 字符串数组 | Optional. List of 0-20 search keywords for the sticker with total length of up to 64 characters. For “regular” and “custom_emoji” stickers only. 可选。贴纸的搜索关键词列表,包含 0 到 20 个关键词,总长度不超过 64 个字符。仅适用于“regular”和“custom_emoji”贴纸。 |
Use this method to send static .WEBP, animated .TGS, or video .WEBM stickers. On success, the sent Message is returned.
使用此方法发送静态 .WEBP、动画 .TGS 或视频 .WEBM 贴纸。成功时,返回发送的消息。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
business_connection_id 业务连接 ID | String 字符串 | Optional 可选 | Unique identifier of the business connection on behalf of which the message will be sent 代表将要发送消息的业务连接的唯一标识符 |
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target chat or username of the target channel (in the format @channelusername )目标聊天的唯一标识符或目标频道的用户名(格式为 @channelusername ) |
message_thread_id | Integer 整数 | Optional 可选 | Unique identifier for the target message thread (topic) of the forum; for forum supergroups only 论坛中目标消息线程(主题)的唯一标识符;仅适用于论坛超级群组 |
sticker 贴纸 | InputFile or String 输入文件或字符串 | Yes 是 | 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, .TGS, or .WEBM sticker using multipart/form-data. More information on Sending Files ». Video and animated stickers can't be sent via an HTTP URL. 要发送的贴纸。传递一个 file_id 作为字符串以发送存在于 Telegram 服务器上的文件(推荐),传递一个 HTTP URL 作为字符串让 Telegram 从互联网获取 .WEBP 贴纸,或者使用 multipart/form-data 上传新的 .WEBP、.TGS 或 .WEBM 贴纸。关于发送文件的更多信息请参见 »。视频和动画贴纸不能通过 HTTP URL 发送。 |
emoji 表情符号 | String 字符串 | Optional 可选 | Emoji associated with the sticker; only for just uploaded stickers 与贴纸关联的表情符号;仅适用于刚上传的贴纸 |
disable_notification 禁用通知 | Boolean 布尔值 | Optional 可选 | Sends the message silently. Users will receive a notification with no sound. 静默发送消息。用户将收到无声通知。 |
protect_content 保护内容 | Boolean 布尔值 | Optional 可选 | Protects the contents of the sent message from forwarding and saving 保护发送的消息内容不被转发和保存 |
allow_paid_broadcast | Boolean 布尔值 | Optional 可选 | Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance 传递 True 以允许每秒发送高达 1000 条消息,忽略广播限制,每条消息收取 0.1 个 Telegram Stars 的费用。相关 Stars 将从机器人的余额中扣除 |
message_effect_id 消息效果 ID | String 字符串 | Optional 可选 | Unique identifier of the message effect to be added to the message; for private chats only 要添加到消息中的消息效果的唯一标识符;仅限私人聊天 |
reply_parameters 回复参数 | ReplyParameters 回复参数 | Optional 可选 | Description of the message to reply to 回复消息的描述 |
reply_markup | InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply InlineKeyboardMarkup 或 ReplyKeyboardMarkup 或 ReplyKeyboardRemove 或 ForceReply |
Optional 可选 | Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user 额外的界面选项。一个用于内联键盘、自定义回复键盘、移除回复键盘或强制用户回复的 JSON 序列化对象 |
Use this method to get a sticker set. On success, a StickerSet object is returned.
使用此方法获取贴纸集。成功时,返回一个 StickerSet 对象。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
name 名称 | String 字符串 | Yes 是 | Name of the sticker set 贴纸集的名称 |
Use this method to get information about custom emoji stickers by their identifiers. Returns an Array of Sticker objects.
使用此方法通过它们的标识符获取自定义表情贴纸的信息。返回一个 Sticker 对象数组。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
custom_emoji_ids 自定义表情符号 ID | Array of String 字符串数组 | Yes 是 | A JSON-serialized list of custom emoji identifiers. At most 200 custom emoji identifiers can be specified. JSON 序列化的自定义表情符号标识符列表。最多可以指定 200 个自定义表情符号标识符。 |
Use this method to upload a file with a sticker for later use in the createNewStickerSet, addStickerToSet, or replaceStickerInSet methods (the file can be used multiple times). Returns the uploaded File on success.
使用此方法上传一个贴纸文件,以便稍后在 createNewStickerSet、addStickerToSet 或 replaceStickerInSet 方法中使用(该文件可以多次使用)。成功时返回已上传的文件。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
user_id 用户 ID | Integer 整数 | Yes 是 | User identifier of sticker file owner 贴纸文件所有者的用户标识符 |
sticker 贴纸 | InputFile 输入文件 | Yes 是 | A file with the sticker in .WEBP, .PNG, .TGS, or .WEBM format. See https://core.telegram.org/stickers for technical requirements. More information on Sending Files » 带有贴纸的文件,格式为 .WEBP、.PNG、.TGS 或 .WEBM。请参阅 https://core.telegram.org/stickers 了解技术要求。有关发送文件的更多信息 » |
sticker_format 贴纸格式 | String 字符串 | Yes 是 | Format of the sticker, must be one of “static”, “animated”, “video” 贴纸的格式,必须是“静态”、“动画”或“视频”之一 |
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 True on success.
使用此方法创建由用户拥有的新贴纸集。机器人将能够编辑所创建的贴纸集。成功时返回 True。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
user_id 用户 ID | Integer 整数 | Yes 是 | User identifier of created sticker set owner 创建的贴纸集所有者的用户标识符 |
name 名称 | String 字符串 | Yes 是 | Short name of sticker set, to be used in t.me/addstickers/ URLs (e.g., animals). Can contain only English letters, digits and underscores. Must begin with a letter, can't contain consecutive underscores and must end in "_by_<bot_username>" . <bot_username> is case insensitive. 1-64 characters.贴纸集的简称,用于 t.me/addstickers/ URL 中(例如,animals)。只能包含英文字母、数字和下划线。必须以字母开头,不能包含连续的下划线,并且必须以 "_by_<bot_username>" 结尾。 <bot_username> 不区分大小写。1-64 个字符。 |
title 标题 | String 字符串 | Yes 是 | Sticker set title, 1-64 characters 贴纸集标题,1-64 个字符 |
stickers 贴纸 | Array of InputSticker InputSticker 数组 | Yes 是 | A JSON-serialized list of 1-50 initial stickers to be added to the sticker set 一个 JSON 序列化的列表,包含 1-50 个初始贴纸,将添加到贴纸集中 |
sticker_type 贴纸类型 | String 字符串 | Optional 可选 | Type of stickers in the set, pass “regular”, “mask”, or “custom_emoji”. By default, a regular sticker set is created. 集合中贴纸的类型,传入“regular”、“mask”或“custom_emoji”。默认创建常规贴纸集合。 |
needs_repainting 需要重新绘制 | Boolean 布尔值 | Optional 可选 | Pass True 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 如果贴纸集合中的贴纸在消息中使用时必须重新涂成文本颜色,在作为表情状态使用时使用强调色,在聊天照片上使用时为白色,或根据上下文使用其他适当的颜色,则传入 True;仅适用于自定义表情贴纸集合 |
Use this method to add a new sticker to a set created by the bot. Emoji sticker sets can have up to 200 stickers. Other sticker sets can have up to 120 stickers. Returns True on success.
使用此方法向机器人创建的集合中添加新贴纸。表情贴纸集合最多可包含 200 个贴纸。其他贴纸集合最多可包含 120 个贴纸。成功时返回 True。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
user_id 用户 ID | Integer 整数 | Yes 是 | User identifier of sticker set owner 贴纸集合所有者的用户标识符 |
name 名称 | String 字符串 | Yes 是 | Sticker set name 贴纸集名称 |
sticker 贴纸 | InputSticker 输入贴纸 | Yes 是 | 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. 一个包含已添加贴纸信息的 JSON 序列化对象。如果完全相同的贴纸已经添加到集合中,则集合不会发生变化。 |
Use this method to move a sticker in a set created by the bot to a specific position. Returns True on success.
使用此方法将机器人创建的集合中的贴纸移动到特定位置。成功时返回 True。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
sticker 贴纸 | String 字符串 | Yes 是 | File identifier of the sticker 贴纸的文件标识符 |
position 位置 | Integer 整数 | Yes 是 | New sticker position in the set, zero-based 集合中新贴纸的位置,基于零 |
Use this method to delete a sticker from a set created by the bot. Returns True on success.
使用此方法从机器人创建的集合中删除贴纸。成功时返回 True。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
sticker 贴纸 | String 字符串 | Yes 是 | File identifier of the sticker 贴纸的文件标识符 |
Use this method to replace an existing sticker in a sticker set with a new one. The method is equivalent to calling deleteStickerFromSet, then addStickerToSet, then setStickerPositionInSet. Returns True on success.
使用此方法可以用新的贴纸替换贴纸集中现有的贴纸。该方法相当于调用 deleteStickerFromSet,然后 addStickerToSet,最后 setStickerPositionInSet。成功时返回 True。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
user_id 用户 ID | Integer 整数 | Yes 是 | User identifier of the sticker set owner 贴纸集所有者的用户标识符 |
name 名称 | String 字符串 | Yes 是 | Sticker set name 贴纸集名称 |
old_sticker 旧贴纸 | String 字符串 | Yes 是 | File identifier of the replaced sticker 被替换贴纸的文件标识符 |
sticker 贴纸 | InputSticker | Yes 是 | 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 remains unchanged. 一个包含已添加贴纸信息的 JSON 序列化对象。如果完全相同的贴纸已经添加到集合中,则集合保持不变。 |
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 True on success.
使用此方法更改分配给常规或自定义表情贴纸的表情符号列表。贴纸必须属于机器人创建的贴纸集合。成功时返回 True。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
sticker 贴纸 | String 字符串 | Yes 是 | File identifier of the sticker 贴纸的文件标识符 |
emoji_list | Array of String 字符串数组 | Yes 是 | A JSON-serialized list of 1-20 emoji associated with the sticker 与贴纸关联的 1-20 个表情符号的 JSON 序列化列表 |
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 True on success.
使用此方法更改分配给常规或自定义表情符号贴纸的搜索关键词。贴纸必须属于机器人创建的贴纸集。成功时返回 True。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
sticker 贴纸 | String 字符串 | Yes 是 | File identifier of the sticker 贴纸的文件标识符 |
keywords 关键词 | Array of String 字符串数组 | Optional 可选 | A JSON-serialized list of 0-20 search keywords for the sticker with total length of up to 64 characters 贴纸的 0-20 个搜索关键词的 JSON 序列化列表,总长度不超过 64 个字符 |
Use this method to change the mask position of a mask sticker. The sticker must belong to a sticker set that was created by the bot. Returns True on success.
使用此方法更改遮罩贴纸的遮罩位置。贴纸必须属于由机器人创建的贴纸集。成功时返回 True。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
sticker 贴纸 | String 字符串 | Yes 是 | File identifier of the sticker 贴纸的文件标识符 |
mask_position | MaskPosition | Optional 可选 | A JSON-serialized object with the position where the mask should be placed on faces. Omit the parameter to remove the mask position. 一个 JSON 序列化的对象,包含遮罩应放置在面部的位置。省略参数以移除遮罩位置。 |
Use this method to set the title of a created sticker set. Returns True on success.
使用此方法设置已创建的贴纸集的标题。成功时返回 True。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
name 名称 | String 字符串 | Yes 是 | Sticker set name 贴纸集名称 |
title 标题 | String 字符串 | Yes 是 | Sticker set title, 1-64 characters 贴纸集标题,1-64 个字符 |
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 True on success.
使用此方法设置常规或面具贴纸集的缩略图。缩略图文件的格式必须与贴纸集中的贴纸格式匹配。成功时返回 True。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
name 名称 | String 字符串 | Yes 是 | Sticker set name 贴纸集名称 |
user_id 用户 ID | Integer 整数 | Yes 是 | User identifier of the sticker set owner 贴纸集所有者的用户标识符 |
thumbnail 缩略图 | InputFile or String 输入文件或字符串 | Optional 可选 | A .WEBP or .PNG image with the thumbnail, must be up to 128 kilobytes in size and have a width and height of exactly 100px, or a .TGS animation with a thumbnail up to 32 kilobytes in size (see https://core.telegram.org/stickers#animation-requirements for animated sticker technical requirements), or a .WEBM video with the thumbnail up to 32 kilobytes in size; see https://core.telegram.org/stickers#video-requirements for video sticker technical requirements. Pass a file_id 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. More information on Sending Files ». 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. .WEBP 或 .PNG 图像带有缩略图,大小必须不超过 128 千字节,宽度和高度必须正好为 100px,或者带有缩略图的 .TGS 动画,大小不超过 32 千字节(有关动画贴纸的技术要求,请参见 https://core.telegram.org/stickers#animation-requirements),或者带有缩略图的 .WEBM 视频,大小不超过 32 千字节;有关视频贴纸的技术要求,请参见 https://core.telegram.org/stickers#video-requirements。传递一个 file_id 作为字符串以发送已存在于 Telegram 服务器上的文件,传递一个 HTTP URL 作为字符串让 Telegram 从互联网获取文件,或者使用 multipart/form-data 上传一个新文件。有关发送文件的更多信息,请参见 Sending Files »。动画和视频贴纸集的缩略图不能通过 HTTP URL 上传。如果省略,则丢弃缩略图并使用第一张贴纸作为缩略图。 |
format 格式 | String 字符串 | Yes 是 | Format of the thumbnail, must be one of “static” for a .WEBP or .PNG image, “animated” for a .TGS animation, or “video” for a .WEBM video 缩略图的格式,必须是“static”表示.WEBP 或.PNG 图像,“animated”表示.TGS 动画,或“video”表示.WEBM 视频之一 |
Use this method to set the thumbnail of a custom emoji sticker set. Returns True on success.
使用此方法设置自定义表情贴纸集的缩略图。成功时返回 True。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
name 名称 | String 字符串 | Yes 是 | Sticker set name 贴纸集名称 |
custom_emoji_id | String 字符串 | Optional 可选 | 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. 来自贴纸集的自定义表情标识符;传递一个空字符串以删除缩略图,并使用第一个贴纸作为缩略图。 |
Use this method to delete a sticker set that was created by the bot. Returns True on success.
使用此方法删除由机器人创建的贴纸集。成功时返回 True。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
name 名称 | String 字符串 | Yes 是 | Sticker set name 贴纸集名称 |
This object represents a gift that can be sent by the bot.
此对象代表一个可以由机器人发送的礼物。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
id | String 字符串 | Unique identifier of the gift 礼物的唯一标识符 |
sticker 贴纸 | Sticker 贴纸 | The sticker that represents the gift 代表礼物的贴纸 |
star_count 星星数量 | Integer 整数 | The number of Telegram Stars that must be paid to send the sticker 发送贴纸需要支付的 Telegram 星星数量 |
upgrade_star_count | Integer 整数 | Optional. The number of Telegram Stars that must be paid to upgrade the gift to a unique one 可选。升级礼物至独特礼物所需支付的 Telegram Stars 数量 |
total_count 总数 | Integer 整数 | Optional. The total number of the gifts of this type that can be sent; for limited gifts only 可选。此类礼物可发送的总数量;仅限于限量礼物 |
remaining_count 剩余数量 | Integer 整数 | Optional. The number of remaining gifts of this type that can be sent; for limited gifts only 可选。此类礼物可发送的剩余数量;仅限于限量礼物 |
This object represent a list of gifts.
这个对象代表一个礼物列表。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
gifts 礼物 | Array of Gift 礼物数组 | The list of gifts 礼物列表 |
Returns the list of gifts that can be sent by the bot to users and channel chats. Requires no parameters. Returns a Gifts object.
返回机器人可以发送给用户和频道聊天的礼物列表。不需要参数。返回一个 Gifts 对象。
Sends a gift to the given user or channel chat. The gift can't be converted to Telegram Stars by the receiver. Returns True on success.
向指定用户或频道聊天发送礼物。接收者无法将礼物转换为 Telegram 星星。成功时返回 True。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
user_id 用户 ID | Integer 整数 | Optional 可选 | Required if chat_id is not specified. Unique identifier of the target user who will receive the gift. 如果未指定 chat_id,则为必填项。将接收礼物的目标用户的唯一标识符。 |
chat_id | Integer or String 整数或字符串 | Optional 可选 | Required if user_id is not specified. Unique identifier for the chat or username of the channel (in the format @channelusername ) that will receive the gift.如果未指定 user_id,则为必填项。将接收礼物的聊天或频道的唯一标识符或频道用户名(格式为 @channelusername )。 |
gift_id 礼物 ID | String 字符串 | Yes 是 | Identifier of the gift 礼物的标识符 |
pay_for_upgrade | Boolean 布尔值 | Optional 可选 | Pass True to pay for the gift upgrade from the bot's balance, thereby making the upgrade free for the receiver 传递 True 以从机器人的余额中支付礼物升级费用,从而使接收者免费获得升级 |
text 文本 | String 字符串 | Optional 可选 | Text that will be shown along with the gift; 0-128 characters 将与礼物一起显示的文本;0-128 个字符 |
text_parse_mode 文本解析模式 | String 字符串 | Optional 可选 | Mode for parsing entities in the text. See formatting options for more details. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, and “custom_emoji” are ignored. 用于解析文本中实体的模式。请参阅格式化选项以获取更多详细信息。除了“粗体”、“斜体”、“下划线”、“删除线”、“剧透”和“自定义表情符号”之外的实体将被忽略。 |
text_entities 文本实体 | Array of MessageEntity MessageEntity 数组 | Optional 可选 | A JSON-serialized list of special entities that appear in the gift text. It can be specified instead of text_parse_mode. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, and “custom_emoji” are ignored. 礼物文本中出现的特殊实体的 JSON 序列化列表。可以代替 text_parse_mode 指定。除了“bold”、“italic”、“underline”、“strikethrough”、“spoiler”和“custom_emoji”之外的实体将被忽略。 |
Verifies a user on behalf of the organization which is represented by the bot. Returns True on success.
代表机器人代表的组织验证用户。成功时返回 True。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
user_id 用户 ID | Integer 整数 | Yes 是 | Unique identifier of the target user 目标用户的唯一标识符 |
custom_description 自定义描述 | String 字符串 | Optional 可选 | Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description. 验证的自定义描述;0-70 个字符。如果组织不允许提供自定义验证描述,则必须为空。 |
Verifies a chat on behalf of the organization which is represented by the bot. Returns True on success.
代表机器人所代表的组织验证聊天。成功时返回 True。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target chat or username of the target channel (in the format @channelusername )目标聊天的唯一标识符或目标频道的用户名(格式为 @channelusername ) |
custom_description 自定义描述 | String 字符串 | Optional 可选 | Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description. 验证的自定义描述;0-70 个字符。如果组织不允许提供自定义验证描述,则必须为空。 |
Removes verification from a user who is currently verified on behalf of the organization represented by the bot. Returns True on success.
从当前代表机器人所代表的组织验证的用户中移除验证。成功时返回 True。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
user_id 用户 ID | Integer 整数 | Yes 是 | Unique identifier of the target user 目标用户的唯一标识符 |
Removes verification from a chat that is currently verified on behalf of the organization represented by the bot. Returns True on success.
移除代表机器人所属组织当前已验证的聊天的验证。成功时返回 True。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target chat or username of the target channel (in the format @channelusername )目标聊天的唯一标识符或目标频道的用户名(格式为 @channelusername ) |
The following methods and objects allow your bot to work in inline mode.
以下方法和对象允许您的机器人在内联模式下工作。
Please see our Introduction to Inline bots for more details.
请参阅我们的内联机器人介绍以获取更多详情。
To enable this option, send the /setinline
command to @BotFather and provide the placeholder text that the user will see in the input field after typing your bot's name.
要启用此选项,请向@BotFather 发送 /setinline
命令,并提供用户在输入字段中输入您的机器人名称后将看到的占位符文本。
This object represents an incoming inline query. When the user sends an empty query, your bot could return some default or trending results.
此对象代表一个传入的内联查询。当用户发送一个空查询时,您的机器人可以返回一些默认或热门结果。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
id | String 字符串 | Unique identifier for this query 此查询的唯一标识符 |
from 来自 | User 用户 | Sender 发送者 |
query 查询 | String 字符串 | Text of the query (up to 256 characters) 查询文本(最多 256 个字符) |
offset 偏移量 | String 字符串 | Offset of the results to be returned, can be controlled by the bot 返回结果的偏移量,可由机器人控制 |
chat_type 聊天类型 | String 字符串 | Optional. 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 可选。发送内联查询的聊天类型。可以是“sender”(与内联查询发送者的一对一聊天)、“private”(私人聊天)、“group”(群组)、“supergroup”(超级群组)或“channel”(频道)。对于从官方客户端和大多数第三方客户端发送的请求,聊天类型应始终已知,除非请求是从秘密聊天中发送的 |
location 位置 | Location 位置 | Optional. Sender location, only for bots that request user location 可选。发送者位置,仅适用于请求用户位置的机器人 |
Use this method to send answers to an inline query. On success, True is returned.
使用此方法发送对内联查询的回答。成功时,返回 True。
No more than 50 results per query are allowed.
每个查询最多允许 50 个结果。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
inline_query_id 内联查询 ID | String 字符串 | Yes 是 | Unique identifier for the answered query 已回答查询的唯一标识符 |
results 结果 | Array of InlineQueryResult InlineQueryResult 数组 |
Yes 是 | A JSON-serialized array of results for the inline query 内联查询结果的 JSON 序列化数组 |
cache_time 缓存时间 | Integer 整数 | Optional 可选 | The maximum amount of time in seconds that the result of the inline query may be cached on the server. Defaults to 300. 内联查询结果在服务器上可缓存的最大时间(秒)。默认为 300。 |
is_personal | Boolean 布尔值 | Optional 可选 | Pass True 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. 如果查询结果只能在服务器端为发送查询的用户缓存,则传入 True。默认情况下,相同查询的结果可以返回给任何发送相同查询的用户。 |
next_offset | String 字符串 | Optional 可选 | 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. 传入客户端在下一次查询中应发送的偏移量,以接收更多结果。如果没有更多结果或不支持分页,则传入空字符串。偏移量长度不能超过 64 字节。 |
button 按钮 | InlineQueryResultsButton | Optional 可选 | A JSON-serialized object describing a button to be shown above inline query results 描述显示在内联查询结果上方的按钮的 JSON 序列化对象 |
This object represents a button to be shown above inline query results. You must use exactly one of the optional fields.
此对象代表显示在内联查询结果上方的按钮。您必须使用可选字段中的一个。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
text 文本 | String 字符串 | Label text on the button 按钮上的标签文本 |
web_app | WebAppInfo 网络应用信息 | Optional. Description of the Web App 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 switchInlineQuery inside the Web App. 可选。当用户按下按钮时将启动的 Web 应用的描述。Web 应用将能够使用 Web 应用内的 switchInlineQuery 方法切换回内联模式。 |
start_parameter | String 字符串 | Optional. Deep-linking parameter for the /start message sent to the bot when a user presses the button. 1-64 characters, only A-Z , a-z , 0-9 , _ and - are allowed.可选。深度链接参数,用于用户按下按钮时发送给机器人的/start 消息。1-64 个字符,只允许 A-Z 、 a-z 、 0-9 、 _ 和 - 。Example: 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 switch_inline button so that the user can easily return to the chat where they wanted to use the bot's inline capabilities. 示例:一个发送 YouTube 视频的内联机器人可以要求用户将其 YouTube 账户连接到机器人,以便相应地调整搜索结果。为此,它会在结果上方或甚至在显示任何结果之前显示一个“连接您的 YouTube 账户”按钮。用户按下按钮,转到与机器人的私人聊天,并在这样做时传递一个启动参数,指示机器人返回一个 OAuth 链接。完成后,机器人可以提供一个 switch_inline 按钮,以便用户可以轻松返回到他们想要使用机器人内联功能的聊天。 |
This object represents one result of an inline query. Telegram clients currently support results of the following 20 types:
此对象代表内联查询的一个结果。当前 Telegram 客户端支持以下 20 种类型的结果:
Note: All URLs passed in inline query results will be available to end users and therefore must be assumed to be public.
注意:所有在内联查询结果中传递的 URL 都将对最终用户可用,因此必须假定它们是公开的。
Represents a link to an article or web page.
表示指向文章或网页的链接。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | String 字符串 | Type of the result, must be article 结果的类型,必须是文章 |
id | String 字符串 | Unique identifier for this result, 1-64 Bytes 此结果的唯一标识符,1-64 字节 |
title 标题 | String 字符串 | Title of the result 结果的标题 |
input_message_content 输入消息内容 | InputMessageContent | Content of the message to be sent 要发送的消息内容 |
reply_markup | InlineKeyboardMarkup 内联键盘标记 | Optional. Inline keyboard attached to the message 可选。附加到消息的内联键盘 |
url | String 字符串 | Optional. URL of the result 可选。结果的 URL |
description 描述 | String 字符串 | Optional. Short description of the result 可选。结果的简短描述 |
thumbnail_url 缩略图 URL | String 字符串 | Optional. Url of the thumbnail for the result 可选。结果的缩略图 URL |
thumbnail_width 缩略图宽度 | Integer 整数 | Optional. Thumbnail width 可选。缩略图宽度 |
thumbnail_height 缩略图高度 | Integer 整数 | Optional. Thumbnail height 可选。缩略图高度 |
Represents a link to a photo. By default, this photo will be sent by the user with optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the photo.
表示一个照片链接。默认情况下,用户将发送此照片,并可选择添加说明文字。或者,您可以使用 input_message_content 发送指定内容的消息,而不是照片。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | String 字符串 | Type of the result, must be photo 结果类型,必须是照片 |
id | String 字符串 | Unique identifier for this result, 1-64 bytes 此结果的唯一标识符,1-64 字节 |
photo_url | String 字符串 | A valid URL of the photo. Photo must be in JPEG format. Photo size must not exceed 5MB 照片的有效 URL。照片必须为 JPEG 格式。照片大小不得超过 5MB |
thumbnail_url 缩略图 URL | String 字符串 | URL of the thumbnail for the photo 照片的缩略图 URL |
photo_width 照片宽度 | Integer 整数 | Optional. Width of the photo 可选。照片的宽度 |
photo_height 照片高度 | Integer 整数 | Optional. Height of the photo 可选。照片的高度 |
title 标题 | String 字符串 | Optional. Title for the result 可选。结果的标题 |
description 描述 | String 字符串 | Optional. Short description of the result 可选。结果的简短描述 |
caption 标题 | String 字符串 | Optional. Caption of the photo to be sent, 0-1024 characters after entities parsing 可选。要发送的照片的标题,实体解析后 0-1024 个字符 |
parse_mode 解析模式 | String 字符串 | Optional. Mode for parsing entities in the photo caption. See formatting options for more details. 可选。用于解析照片说明中实体的模式。请参阅格式选项以获取更多详细信息。 |
caption_entities 标题实体 | Array of MessageEntity MessageEntity 数组 | Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode 可选。说明中出现的特殊实体列表,可以替代 parse_mode 指定 |
show_caption_above_media 在媒体上方显示标题 |
Boolean 布尔值 | Optional. Pass True, if the caption must be shown above the message media 可选。如果说明必须显示在消息媒体上方,请传递 True |
reply_markup | InlineKeyboardMarkup 内联键盘标记 | Optional. Inline keyboard attached to the message 可选。附加到消息的内联键盘 |
input_message_content | InputMessageContent 输入消息内容 | Optional. Content of the message to be sent instead of the photo 可选。代替照片发送的消息内容 |
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 input_message_content to send a message with the specified content instead of the animation.
表示一个指向动画 GIF 文件的链接。默认情况下,此动画 GIF 文件将由用户发送,并可选择添加说明文字。或者,您可以使用 input_message_content 发送指定内容的消息,而不是动画。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | String 字符串 | Type of the result, must be gif 结果类型,必须是 gif |
id | String 字符串 | Unique identifier for this result, 1-64 bytes 此结果的唯一标识符,1-64 字节 |
gif_url | String 字符串 | A valid URL for the GIF file GIF 文件的有效 URL |
gif_width | Integer 整数 | Optional. Width of the GIF 可选。GIF 的宽度 |
gif_height gif 高度 | Integer 整数 | Optional. Height of the GIF 可选。GIF 的高度 |
gif_duration gif 时长 | Integer 整数 | Optional. Duration of the GIF in seconds 可选。GIF 的时长(秒) |
thumbnail_url 缩略图 URL | String 字符串 | URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result 结果的静态(JPEG 或 GIF)或动画(MPEG4)缩略图的 URL |
thumbnail_mime_type 缩略图 MIME 类型 | String 字符串 | Optional. MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”, or “video/mp4”. Defaults to “image/jpeg” 可选。缩略图的 MIME 类型,必须是“image/jpeg”、“image/gif”或“video/mp4”之一。默认为“image/jpeg”。 |
title 标题 | String 字符串 | Optional. Title for the result 可选。结果的标题 |
caption 标题 | String 字符串 | Optional. Caption of the GIF file to be sent, 0-1024 characters after entities parsing 可选。发送的 GIF 文件的说明文字,实体解析后 0-1024 个字符 |
parse_mode 解析模式 | String 字符串 | Optional. Mode for parsing entities in the caption. See formatting options for more details. 可选。说明文字中实体解析的模式。查看格式化选项以获取更多详情。 |
caption_entities 标题实体 | Array of MessageEntity MessageEntity 数组 | Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode 可选。说明中出现的特殊实体列表,可以替代 parse_mode 指定 |
show_caption_above_media 在媒体上方显示标题 |
Boolean 布尔值 | Optional. Pass True, if the caption must be shown above the message media 可选。如果说明必须显示在消息媒体上方,请传递 True |
reply_markup | InlineKeyboardMarkup 内联键盘标记 | Optional. Inline keyboard attached to the message 可选。附加到消息的内联键盘 |
input_message_content | InputMessageContent 输入消息内容 | Optional. Content of the message to be sent instead of the GIF animation 可选。代替 GIF 动画发送的消息内容 |
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 input_message_content to send a message with the specified content instead of the animation.
表示一个视频动画的链接(无声的 H.264/MPEG-4 AVC 视频)。默认情况下,此动画 MPEG-4 文件将由用户发送,并可选择添加说明文字。或者,您可以使用 input_message_content 发送指定内容的消息,而不是动画。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | String 字符串 | Type of the result, must be mpeg4_gif 结果的类型,必须是 mpeg4_gif |
id | String 字符串 | Unique identifier for this result, 1-64 bytes 此结果的唯一标识符,1-64 字节 |
mpeg4_url | String 字符串 | A valid URL for the MPEG4 file MPEG4 文件的有效 URL |
mpeg4_width | Integer 整数 | Optional. Video width 可选。视频宽度 |
mpeg4_height mpeg4 高度 | Integer 整数 | Optional. Video height 可选。视频高度 |
mpeg4_duration mpeg4 时长 | Integer 整数 | Optional. Video duration in seconds 可选。视频时长(秒) |
thumbnail_url 缩略图 URL | String 字符串 | URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result 结果的静态(JPEG 或 GIF)或动画(MPEG4)缩略图的 URL |
thumbnail_mime_type 缩略图 MIME 类型 | String 字符串 | Optional. MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”, or “video/mp4”. Defaults to “image/jpeg” 可选。缩略图的 MIME 类型,必须是“image/jpeg”、“image/gif”或“video/mp4”之一。默认为“image/jpeg” |
title 标题 | String 字符串 | Optional. Title for the result 可选。结果的标题 |
caption 标题 | String 字符串 | Optional. Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing 可选。将发送的 MPEG-4 文件的说明,实体解析后 0-1024 个字符 |
parse_mode 解析模式 | String 字符串 | Optional. Mode for parsing entities in the caption. See formatting options for more details. 可选。解析说明中实体的模式。查看格式化选项以获取更多详情。 |
caption_entities 标题实体 | Array of MessageEntity MessageEntity 数组 | Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode 可选。说明中出现的特殊实体列表,可以替代 parse_mode 指定 |
show_caption_above_media 在媒体上方显示标题 |
Boolean 布尔值 | Optional. Pass True, if the caption must be shown above the message media 可选。如果说明必须显示在消息媒体上方,请传递 True |
reply_markup | InlineKeyboardMarkup 内联键盘标记 | Optional. Inline keyboard attached to the message 可选。附加到消息的内联键盘 |
input_message_content | InputMessageContent | Optional. Content of the message to be sent instead of the video animation 可选。代替视频动画发送的消息内容 |
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 input_message_content to send a message with the specified content instead of the video.
表示一个链接到包含嵌入式视频播放器或视频文件的页面。默认情况下,用户将发送此视频文件,并可选择添加说明。或者,您可以使用 input_message_content 发送指定内容的消息,而非视频。
If an InlineQueryResultVideo message contains an embedded video (e.g., YouTube), you must replace its content using input_message_content.
如果 InlineQueryResultVideo 消息包含嵌入式视频(例如,YouTube),您必须使用 input_message_content 替换其内容。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | String 字符串 | Type of the result, must be video 结果类型,必须是视频 |
id | String 字符串 | Unique identifier for this result, 1-64 bytes 此结果的唯一标识符,1-64 字节 |
video_url | String 字符串 | A valid URL for the embedded video player or video file 嵌入式视频播放器或视频文件的有效 URL |
mime_type MIME 类型 | String 字符串 | MIME type of the content of the video URL, “text/html” or “video/mp4” 视频 URL 内容的 MIME 类型,“text/html”或“video/mp4” |
thumbnail_url | String 字符串 | URL of the thumbnail (JPEG only) for the video 视频缩略图的 URL(仅限 JPEG) |
title 标题 | String 字符串 | Title for the result 结果标题 |
caption 标题 | String 字符串 | Optional. Caption of the video to be sent, 0-1024 characters after entities parsing 可选。视频标题,实体解析后 0-1024 个字符 |
parse_mode 解析模式 | String 字符串 | Optional. Mode for parsing entities in the video caption. See formatting options for more details. 可选。解析视频标题中实体的模式。查看格式化选项以获取更多详情。 |
caption_entities 标题实体 | Array of MessageEntity MessageEntity 数组 | Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode 可选。说明中出现的特殊实体列表,可以替代 parse_mode 指定 |
show_caption_above_media 在媒体上方显示标题 |
Boolean 布尔值 | Optional. Pass True, if the caption must be shown above the message media 可选。如果说明必须显示在消息媒体上方,请传递 True |
video_width 视频宽度 | Integer 整数 | Optional. Video width 可选。视频宽度 |
video_height 视频高度 | Integer 整数 | Optional. Video height 可选。视频高度 |
video_duration 视频时长 | Integer 整数 | Optional. Video duration in seconds 可选。视频时长(秒) |
description 描述 | String 字符串 | Optional. Short description of the result 可选。结果的简短描述 |
reply_markup | InlineKeyboardMarkup 内联键盘标记 | Optional. Inline keyboard attached to the message 可选。附加到消息的内联键盘 |
input_message_content | InputMessageContent | Optional. Content of the message to be sent instead of the video. This field is required if InlineQueryResultVideo is used to send an HTML-page as a result (e.g., a YouTube video). 可选。如果使用 InlineQueryResultVideo 发送 HTML 页面作为结果(例如 YouTube 视频),则需要填写此字段以代替视频发送的消息内容。 |
Represents a link to an MP3 audio file. By default, this audio file will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the audio.
表示一个指向 MP3 音频文件的链接。默认情况下,该音频文件将由用户发送。或者,您可以使用 input_message_content 发送指定内容的消息,而不是音频。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | String 字符串 | Type of the result, must be audio 结果的类型,必须是音频 |
id | String 字符串 | Unique identifier for this result, 1-64 bytes 此结果的唯一标识符,1-64 字节 |
audio_url 音频 URL | String 字符串 | A valid URL for the audio file 音频文件的有效 URL |
title 标题 | String 字符串 | Title 标题 |
caption 标题 | String 字符串 | Optional. Caption, 0-1024 characters after entities parsing 可选。标题,实体解析后 0-1024 个字符 |
parse_mode 解析模式 | String 字符串 | Optional. Mode for parsing entities in the audio caption. See formatting options for more details. 可选。解析音频标题中实体的模式。查看格式化选项以获取更多详情。 |
caption_entities 标题实体 | Array of MessageEntity MessageEntity 数组 | Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode 可选。说明中出现的特殊实体列表,可以替代 parse_mode 指定 |
performer 执行者 | String 字符串 | Optional. Performer 可选。表演者 |
audio_duration | Integer 整数 | Optional. Audio duration in seconds 可选。音频时长(秒) |
reply_markup | InlineKeyboardMarkup 内联键盘标记 | Optional. Inline keyboard attached to the message 可选。附加到消息的内联键盘 |
input_message_content | InputMessageContent | Optional. Content of the message to be sent instead of the audio 可选。代替音频发送的消息内容 |
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 input_message_content to send a message with the specified content instead of the the voice message.
表示一个链接到以 OPUS 编码的.OGG 容器中的语音录音。默认情况下,此语音录音将由用户发送。或者,您可以使用 input_message_content 发送指定内容的消息,而不是语音消息。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | String 字符串 | Type of the result, must be voice 结果类型,必须是 voice |
id | String 字符串 | Unique identifier for this result, 1-64 bytes 此结果的唯一标识符,1-64 字节 |
voice_url | String 字符串 | A valid URL for the voice recording 语音录音的有效 URL |
title 标题 | String 字符串 | Recording title 录音标题 |
caption 标题 | String 字符串 | Optional. Caption, 0-1024 characters after entities parsing 可选。说明文字,实体解析后 0-1024 个字符 |
parse_mode 解析模式 | String 字符串 | Optional. Mode for parsing entities in the voice message caption. See formatting options for more details. 可选。解析语音消息说明文字中的实体的模式。查看格式选项以获取更多详情。 |
caption_entities 标题实体 | Array of MessageEntity MessageEntity 数组 | Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode 可选。说明中出现的特殊实体列表,可以替代 parse_mode 指定 |
voice_duration 语音时长 | Integer 整数 | Optional. Recording duration in seconds 可选。录音时长,单位为秒 |
reply_markup | InlineKeyboardMarkup 内联键盘标记 | Optional. Inline keyboard attached to the message 可选。附加到消息的内联键盘 |
input_message_content | InputMessageContent 输入消息内容 | Optional. Content of the message to be sent instead of the voice recording 可选。代替语音录音发送的消息内容 |
Represents a link to a file. By default, this file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the file. Currently, only .PDF and .ZIP files can be sent using this method.
代表一个文件链接。默认情况下,用户将发送此文件,并可选择添加说明文字。或者,您可以使用 input_message_content 发送指定内容的消息,而不是文件。目前,仅支持通过此方法发送 .PDF 和 .ZIP 文件。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | String 字符串 | Type of the result, must be document 结果类型,必须是文档 |
id | String 字符串 | Unique identifier for this result, 1-64 bytes 此结果的唯一标识符,1-64 字节 |
title 标题 | String 字符串 | Title for the result 结果标题 |
caption 标题 | String 字符串 | Optional. Caption of the document to be sent, 0-1024 characters after entities parsing 可选。要发送的文档的标题,实体解析后 0-1024 个字符 |
parse_mode 解析模式 | String 字符串 | Optional. Mode for parsing entities in the document caption. See formatting options for more details. 可选。解析文档标题中实体的模式。有关更多详细信息,请参阅格式化选项。 |
caption_entities 标题实体 | Array of MessageEntity MessageEntity 数组 | Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode 可选。说明中出现的特殊实体列表,可以替代 parse_mode 指定 |
document_url | String 字符串 | A valid URL for the file 文件的有效 URL |
mime_type MIME 类型 | String 字符串 | MIME type of the content of the file, either “application/pdf” or “application/zip” 文件内容的 MIME 类型,可以是“application/pdf”或“application/zip” |
description 描述 | String 字符串 | Optional. Short description of the result 可选。结果的简短描述 |
reply_markup | InlineKeyboardMarkup 内联键盘标记 | Optional. Inline keyboard attached to the message 可选。附加到消息的内联键盘 |
input_message_content | InputMessageContent 输入消息内容 | Optional. Content of the message to be sent instead of the file 可选。代替文件发送的消息内容 |
thumbnail_url 缩略图 URL | String 字符串 | Optional. URL of the thumbnail (JPEG only) for the file 可选。文件缩略图的 URL(仅限 JPEG) |
thumbnail_width 缩略图宽度 | Integer 整数 | Optional. Thumbnail width 可选。缩略图宽度 |
thumbnail_height 缩略图高度 | Integer 整数 | Optional. Thumbnail height 可选。缩略图高度 |
Represents a location on a map. By default, the location will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the location.
表示地图上的一个位置。默认情况下,位置将由用户发送。或者,您可以使用 input_message_content 发送指定内容的消息,而不是位置。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | String 字符串 | Type of the result, must be location 结果的类型,必须是位置 |
id | String 字符串 | Unique identifier for this result, 1-64 Bytes 此结果的唯一标识符,1-64 字节 |
latitude 纬度 | Float 浮点数 | Location latitude in degrees 位置的纬度,单位为度 |
longitude 经度 | Float 浮点数 | Location longitude in degrees 位置的经度,单位为度 |
title 标题 | String 字符串 | Location title 位置标题 |
horizontal_accuracy 水平精度 | Float 浮点数 | Optional. The radius of uncertainty for the location, measured in meters; 0-1500 可选。位置的不确定性半径,以米为单位测量;0-1500 |
live_period 实时周期 | Integer 整数 | Optional. Period in seconds during which the location can be updated, should be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely. 可选。位置可以更新的周期,单位为秒,应在 60 到 86400 之间,或为 0x7FFFFFFF,表示可以无限期编辑的实时位置。 |
heading 航向 | Integer 整数 | Optional. For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified. 可选。对于实时位置,用户移动的方向,以度为单位。如果指定,必须在 1 到 360 之间。 |
proximity_alert_radius 接近警报半径 | Integer 整数 | Optional. For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified. 可选。对于实时位置,接近另一个聊天成员时触发接近警报的最大距离,单位为米。如果指定,必须在 1 到 100000 之间。 |
reply_markup | InlineKeyboardMarkup 内联键盘标记 | Optional. Inline keyboard attached to the message 可选。附加到消息的内联键盘 |
input_message_content | InputMessageContent 输入消息内容 | Optional. Content of the message to be sent instead of the location 可选。代替位置发送的消息内容 |
thumbnail_url 缩略图 URL | String 字符串 | Optional. Url of the thumbnail for the result 可选。结果的缩略图 URL |
thumbnail_width 缩略图宽度 | Integer 整数 | Optional. Thumbnail width 可选。缩略图宽度 |
thumbnail_height 缩略图高度 | Integer 整数 | Optional. Thumbnail height 可选。缩略图高度 |
Represents a venue. By default, the venue will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the venue.
表示一个场所。默认情况下,场所将由用户发送。或者,您可以使用 input_message_content 发送指定内容的消息,而不是场所。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | String 字符串 | Type of the result, must be venue 结果的类型,必须是场所 |
id | String 字符串 | Unique identifier for this result, 1-64 Bytes 此结果的唯一标识符,1-64 字节 |
latitude 纬度 | Float 浮点数 | Latitude of the venue location in degrees 场所位置的纬度,单位为度 |
longitude 经度 | Float 浮点数 | Longitude of the venue location in degrees 场所位置的经度,单位为度 |
title 标题 | String 字符串 | Title of the venue 场所的标题 |
address 地址 | String 字符串 | Address of the venue 场馆地址 |
foursquare_id | String 字符串 | Optional. Foursquare identifier of the venue if known 可选。如果已知场所的 Foursquare 标识符 |
foursquare_type | String 字符串 | Optional. Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.) 可选。如果已知场所的 Foursquare 类型。(例如,“arts_entertainment/default”,“arts_entertainment/aquarium”或“food/icecream”。) |
google_place_id | String 字符串 | Optional. Google Places identifier of the venue 可选。场所的 Google Places 标识符 |
google_place_type | String 字符串 | Optional. Google Places type of the venue. (See supported types.) 可选。场所的 Google Places 类型。(请参阅支持的类型。) |
reply_markup | InlineKeyboardMarkup 内联键盘标记 | Optional. Inline keyboard attached to the message 可选。附加到消息的内联键盘 |
input_message_content | InputMessageContent 输入消息内容 | Optional. Content of the message to be sent instead of the venue 可选。代替场所发送的消息内容 |
thumbnail_url 缩略图 URL | String 字符串 | Optional. Url of the thumbnail for the result 可选。结果的缩略图 URL |
thumbnail_width 缩略图宽度 | Integer 整数 | Optional. Thumbnail width 可选。缩略图宽度 |
thumbnail_height 缩略图高度 | Integer 整数 | Optional. Thumbnail height 可选。缩略图高度 |
Represents a contact with a phone number. By default, this contact will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the contact.
表示一个带有电话号码的联系人。默认情况下,此联系人将由用户发送。或者,您可以使用 input_message_content 来发送指定内容的消息,而不是联系人。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | String 字符串 | Type of the result, must be contact 结果的类型,必须是联系人 |
id | String 字符串 | Unique identifier for this result, 1-64 Bytes 此结果的唯一标识符,1-64 字节 |
phone_number 电话号码 | String 字符串 | Contact's phone number 联系人的电话号码 |
first_name 名 | String 字符串 | Contact's first name 联系人的名字 |
last_name 姓氏 | String 字符串 | Optional. Contact's last name 可选。联系人的姓氏 |
vcard | String 字符串 | Optional. Additional data about the contact in the form of a vCard, 0-2048 bytes 可选。关于联系人的附加数据,vCard 格式,0-2048 字节 |
reply_markup | InlineKeyboardMarkup 内联键盘标记 | Optional. Inline keyboard attached to the message 可选。附加到消息的内联键盘 |
input_message_content | InputMessageContent 输入消息内容 | Optional. Content of the message to be sent instead of the contact 可选。代替联系人发送的消息内容 |
thumbnail_url 缩略图 URL | String 字符串 | Optional. Url of the thumbnail for the result 可选。结果的缩略图 URL |
thumbnail_width 缩略图宽度 | Integer 整数 | Optional. Thumbnail width 可选。缩略图宽度 |
thumbnail_height 缩略图高度 | Integer 整数 | Optional. Thumbnail height 可选。缩略图高度 |
Represents a Game. 表示一个游戏。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | String 字符串 | Type of the result, must be game 结果的类型,必须是游戏 |
id | String 字符串 | Unique identifier for this result, 1-64 bytes 此结果的唯一标识符,1-64 字节 |
game_short_name | String 字符串 | Short name of the game 游戏的简称 |
reply_markup | InlineKeyboardMarkup 内联键盘标记 | Optional. Inline keyboard attached to the message 可选。附加到消息的内联键盘 |
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 input_message_content to send a message with the specified content instead of the photo.
表示存储在 Telegram 服务器上的照片链接。默认情况下,此照片将由用户发送,并附带可选的说明。或者,您可以使用 input_message_content 发送指定内容的消息,而不是照片。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | String 字符串 | Type of the result, must be photo 结果类型,必须是照片 |
id | String 字符串 | Unique identifier for this result, 1-64 bytes 此结果的唯一标识符,1-64 字节 |
photo_file_id 照片文件 ID | String 字符串 | A valid file identifier of the photo 有效的照片文件标识符 |
title 标题 | String 字符串 | Optional. Title for the result 可选。结果的标题 |
description 描述 | String 字符串 | Optional. Short description of the result 可选。结果的简短描述 |
caption 标题 | String 字符串 | Optional. Caption of the photo to be sent, 0-1024 characters after entities parsing 可选。要发送的照片的标题,实体解析后 0-1024 个字符 |
parse_mode 解析模式 | String 字符串 | Optional. Mode for parsing entities in the photo caption. See formatting options for more details. 可选。用于解析照片说明中实体的模式。请参阅格式选项以获取更多详细信息。 |
caption_entities 标题实体 | Array of MessageEntity MessageEntity 数组 | Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode 可选。说明中出现的特殊实体列表,可以替代 parse_mode 指定 |
show_caption_above_media 在媒体上方显示标题 |
Boolean 布尔值 | Optional. Pass True, if the caption must be shown above the message media 可选。如果说明必须显示在消息媒体上方,请传递 True |
reply_markup | InlineKeyboardMarkup 内联键盘标记 | Optional. Inline keyboard attached to the message 可选。附加到消息的内联键盘 |
input_message_content | InputMessageContent | Optional. Content of the message to be sent instead of the photo 可选。代替照片发送的消息内容 |
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 input_message_content to send a message with specified content instead of the animation.
表示存储在 Telegram 服务器上的动画 GIF 文件的链接。默认情况下,用户将发送此动画 GIF 文件,并可选择添加说明。或者,您可以使用 input_message_content 发送指定内容的消息,而不发送动画。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | String 字符串 | Type of the result, must be gif 结果的类型,必须是 gif |
id | String 字符串 | Unique identifier for this result, 1-64 bytes 此结果的唯一标识符,1-64 字节 |
gif_file_id gif 文件 ID | String 字符串 | A valid file identifier for the GIF file GIF 文件的有效文件标识符 |
title 标题 | String 字符串 | Optional. Title for the result 可选。结果的标题 |
caption 标题 | String 字符串 | Optional. Caption of the GIF file to be sent, 0-1024 characters after entities parsing 可选。发送的 GIF 文件的说明文字,实体解析后 0-1024 个字符 |
parse_mode 解析模式 | String 字符串 | Optional. Mode for parsing entities in the caption. See formatting options for more details. 可选。解析说明中实体的模式。查看格式化选项以获取更多详情。 |
caption_entities 标题实体 | Array of MessageEntity MessageEntity 数组 | Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode 可选。说明中出现的特殊实体列表,可以替代 parse_mode 指定 |
show_caption_above_media 在媒体上方显示标题 |
Boolean 布尔值 | Optional. Pass True, if the caption must be shown above the message media 可选。如果说明必须显示在消息媒体上方,请传递 True |
reply_markup | InlineKeyboardMarkup 内联键盘标记 | Optional. Inline keyboard attached to the message 可选。附加到消息的内联键盘 |
input_message_content | InputMessageContent 输入消息内容 | Optional. Content of the message to be sent instead of the GIF animation 可选。代替 GIF 动画发送的消息内容 |
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 input_message_content to send a message with the specified content instead of the animation.
表示存储在 Telegram 服务器上的视频动画(H.264/MPEG-4 AVC 视频无声音)的链接。默认情况下,用户将发送此动画 MPEG-4 文件,并附带可选的说明。或者,您可以使用 input_message_content 发送指定内容的消息,而不是发送动画。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | String 字符串 | Type of the result, must be mpeg4_gif 结果的类型,必须是 mpeg4_gif |
id | String 字符串 | Unique identifier for this result, 1-64 bytes 此结果的唯一标识符,1-64 字节 |
mpeg4_file_id | String 字符串 | A valid file identifier for the MPEG4 file MPEG4 文件的有效文件标识符 |
title 标题 | String 字符串 | Optional. Title for the result 可选。结果的标题 |
caption 标题 | String 字符串 | Optional. Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing 可选。将发送的 MPEG-4 文件的说明,实体解析后 0-1024 个字符 |
parse_mode 解析模式 | String 字符串 | Optional. Mode for parsing entities in the caption. See formatting options for more details. 可选。解析说明中实体的模式。查看格式化选项以获取更多详情。 |
caption_entities 标题实体 | Array of MessageEntity MessageEntity 数组 | Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode 可选。说明中出现的特殊实体列表,可以替代 parse_mode 指定 |
show_caption_above_media 在媒体上方显示标题 |
Boolean 布尔值 | Optional. Pass True, if the caption must be shown above the message media 可选。如果说明必须显示在消息媒体上方,请传递 True |
reply_markup | InlineKeyboardMarkup 内联键盘标记 | Optional. Inline keyboard attached to the message 可选。附加到消息的内联键盘 |
input_message_content | InputMessageContent 输入消息内容 | Optional. Content of the message to be sent instead of the video animation 可选。代替视频动画发送的消息内容 |
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 input_message_content to send a message with the specified content instead of the sticker.
表示存储在 Telegram 服务器上的贴纸的链接。默认情况下,用户将发送此贴纸。或者,您可以使用 input_message_content 发送指定内容的消息,而不是发送贴纸。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | String 字符串 | Type of the result, must be sticker 结果的类型,必须是贴纸 |
id | String 字符串 | Unique identifier for this result, 1-64 bytes 此结果的唯一标识符,1-64 字节 |
sticker_file_id 贴纸文件 ID | String 字符串 | A valid file identifier of the sticker 贴纸的有效文件标识符 |
reply_markup | InlineKeyboardMarkup 内联键盘标记 | Optional. Inline keyboard attached to the message 可选。附加到消息的内联键盘 |
input_message_content | InputMessageContent 输入消息内容 | Optional. Content of the message to be sent instead of the sticker 可选。代替贴纸发送的消息内容 |
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 input_message_content to send a message with the specified content instead of the file.
表示存储在 Telegram 服务器上的文件的链接。默认情况下,用户将发送此文件,并可选择添加说明。或者,您可以使用 input_message_content 发送指定内容的消息,而不是文件。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | String 字符串 | Type of the result, must be document 结果类型,必须是文档 |
id | String 字符串 | Unique identifier for this result, 1-64 bytes 此结果的唯一标识符,1-64 字节 |
title 标题 | String 字符串 | Title for the result 结果的标题 |
document_file_id | String 字符串 | A valid file identifier for the file 文件的有效文件标识符 |
description 描述 | String 字符串 | Optional. Short description of the result 可选。结果的简短描述 |
caption 标题 | String 字符串 | Optional. Caption of the document to be sent, 0-1024 characters after entities parsing 可选。要发送的文档的标题,实体解析后 0-1024 个字符 |
parse_mode 解析模式 | String 字符串 | Optional. Mode for parsing entities in the document caption. See formatting options for more details. 可选。解析文档标题中实体的模式。有关更多详细信息,请参阅格式化选项。 |
caption_entities 标题实体 | Array of MessageEntity MessageEntity 数组 | Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode 可选。说明中出现的特殊实体列表,可以替代 parse_mode 指定 |
reply_markup | InlineKeyboardMarkup 内联键盘标记 | Optional. Inline keyboard attached to the message 可选。附加到消息的内联键盘 |
input_message_content | InputMessageContent 输入消息内容 | Optional. Content of the message to be sent instead of the file 可选。代替文件发送的消息内容 |
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 input_message_content to send a message with the specified content instead of the video.
表示存储在 Telegram 服务器上的视频文件的链接。默认情况下,用户将发送此视频文件,并附带可选的说明。或者,您可以使用 input_message_content 发送指定内容的消息,而不是视频。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | String 字符串 | Type of the result, must be video 结果类型,必须是视频 |
id | String 字符串 | Unique identifier for this result, 1-64 bytes 此结果的唯一标识符,1-64 字节 |
video_file_id | String 字符串 | A valid file identifier for the video file 视频文件的有效文件标识符 |
title 标题 | String 字符串 | Title for the result 结果的标题 |
description 描述 | String 字符串 | Optional. Short description of the result 可选。结果的简短描述 |
caption 标题 | String 字符串 | Optional. Caption of the video to be sent, 0-1024 characters after entities parsing 可选。视频标题,实体解析后 0-1024 个字符 |
parse_mode 解析模式 | String 字符串 | Optional. Mode for parsing entities in the video caption. See formatting options for more details. 可选。解析视频标题中实体的模式。查看格式化选项以获取更多详情。 |
caption_entities 标题实体 | Array of MessageEntity MessageEntity 数组 | Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode 可选。说明中出现的特殊实体列表,可以替代 parse_mode 指定 |
show_caption_above_media 在媒体上方显示标题 |
Boolean 布尔值 | Optional. Pass True, if the caption must be shown above the message media 可选。如果说明必须显示在消息媒体上方,请传递 True |
reply_markup | InlineKeyboardMarkup 内联键盘标记 | Optional. Inline keyboard attached to the message 可选。附加到消息的内联键盘 |
input_message_content | InputMessageContent 输入消息内容 | Optional. Content of the message to be sent instead of the video 可选。代替视频发送的消息内容 |
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 input_message_content to send a message with the specified content instead of the voice message.
表示存储在 Telegram 服务器上的语音消息的链接。默认情况下,此语音消息将由用户发送。或者,您可以使用 input_message_content 发送指定内容的消息,而不是语音消息。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | String 字符串 | Type of the result, must be voice 结果类型,必须是语音 |
id | String 字符串 | Unique identifier for this result, 1-64 bytes 此结果的唯一标识符,1-64 字节 |
voice_file_id | String 字符串 | A valid file identifier for the voice message 语音消息的有效文件标识符 |
title 标题 | String 字符串 | Voice message title 语音消息标题 |
caption 标题 | String 字符串 | Optional. Caption, 0-1024 characters after entities parsing 可选。标题,实体解析后 0-1024 个字符 |
parse_mode 解析模式 | String 字符串 | Optional. Mode for parsing entities in the voice message caption. See formatting options for more details. 可选。用于解析语音消息标题中实体的模式。请参阅格式化选项以获取更多详细信息。 |
caption_entities 标题实体 | Array of MessageEntity MessageEntity 数组 | Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode 可选。说明中出现的特殊实体列表,可以替代 parse_mode 指定 |
reply_markup | InlineKeyboardMarkup 内联键盘标记 | Optional. Inline keyboard attached to the message 可选。附加到消息的内联键盘 |
input_message_content | InputMessageContent 输入消息内容 | Optional. Content of the message to be sent instead of the voice message 可选。代替语音消息发送的消息内容 |
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 input_message_content to send a message with the specified content instead of the audio.
代表存储在 Telegram 服务器上的 MP3 音频文件的链接。默认情况下,此音频文件将由用户发送。或者,您可以使用 input_message_content 发送指定内容的消息,而不是音频。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | String 字符串 | Type of the result, must be audio 结果的类型,必须是音频 |
id | String 字符串 | Unique identifier for this result, 1-64 bytes 此结果的唯一标识符,1-64 字节 |
audio_file_id | String 字符串 | A valid file identifier for the audio file 音频文件的有效文件标识符 |
caption 标题 | String 字符串 | Optional. Caption, 0-1024 characters after entities parsing 可选。标题,实体解析后的 0-1024 个字符 |
parse_mode 解析模式 | String 字符串 | Optional. Mode for parsing entities in the audio caption. See formatting options for more details. 可选。解析音频标题中实体的模式。查看格式化选项以获取更多详情。 |
caption_entities 标题实体 | Array of MessageEntity MessageEntity 数组 | Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode 可选。说明中出现的特殊实体列表,可以替代 parse_mode 指定 |
reply_markup | InlineKeyboardMarkup 内联键盘标记 | Optional. Inline keyboard attached to the message 可选。附加到消息的内联键盘 |
input_message_content | InputMessageContent 输入消息内容 | Optional. Content of the message to be sent instead of the audio 可选。代替音频发送的消息内容 |
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:
此对象代表作为内联查询结果发送的消息内容。Telegram 客户端目前支持以下 5 种类型:
Represents the content of a text message to be sent as the result of an inline query.
表示作为内联查询结果发送的文本消息的内容。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
message_text 消息文本 | String 字符串 | Text of the message to be sent, 1-4096 characters 要发送的消息文本,1-4096 个字符 |
parse_mode 解析模式 | String 字符串 | Optional. Mode for parsing entities in the message text. See formatting options for more details. 可选。用于解析消息文本中实体的模式。请参阅格式化选项以获取更多详情。 |
entities 实体 | Array of MessageEntity MessageEntity 数组 | Optional. List of special entities that appear in message text, which can be specified instead of parse_mode 可选。消息文本中出现的特殊实体列表,可替代 parse_mode 指定 |
link_preview_options | LinkPreviewOptions 链接预览选项 | Optional. Link preview generation options for the message 可选。消息的链接预览生成选项 |
Represents the content of a location message to be sent as the result of an inline query.
表示作为内联查询结果发送的位置消息的内容。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
latitude 纬度 | Float 浮点数 | Latitude of the location in degrees 位置的纬度,单位为度 |
longitude 经度 | Float 浮点数 | Longitude of the location in degrees 位置的经度,单位为度 |
horizontal_accuracy 水平精度 | Float 浮点数 | Optional. The radius of uncertainty for the location, measured in meters; 0-1500 可选。位置的不确定性半径,以米为单位测量;0-1500 |
live_period 实时周期 | Integer 整数 | Optional. Period in seconds during which the location can be updated, should be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely. 可选。在此期间内可以更新位置的秒数,应在 60 到 86400 之间,或者对于可以无限期编辑的实时位置为 0x7FFFFFFF。 |
heading 航向 | Integer 整数 | Optional. For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified. 可选。对于实时位置,用户移动的方向,单位为度。如果指定,必须在 1 到 360 之间。 |
proximity_alert_radius 接近警报半径 | Integer 整数 | Optional. For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified. 可选。对于实时位置,接近另一个聊天成员时的接近警报的最大距离,单位为米。如果指定,必须在 1 到 100000 之间。 |
Represents the content of a venue message to be sent as the result of an inline query.
表示作为内联查询结果发送的场所消息的内容。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
latitude 纬度 | Float 浮点数 | Latitude of the venue in degrees 场所的纬度,单位为度 |
longitude 经度 | Float 浮点数 | Longitude of the venue in degrees 场所的经度,单位为度 |
title 标题 | String 字符串 | Name of the venue 场所名称 |
address 地址 | String 字符串 | Address of the venue 场馆地址 |
foursquare_id | String 字符串 | Optional. Foursquare identifier of the venue, if known 可选。如果已知,场所的 Foursquare 标识符 |
foursquare_type | String 字符串 | Optional. Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.) 可选。如果已知,场所的 Foursquare 类型。(例如,“arts_entertainment/default”,“arts_entertainment/aquarium”或“food/icecream”。) |
google_place_id | String 字符串 | Optional. Google Places identifier of the venue 可选。场所的 Google Places 标识符 |
google_place_type | String 字符串 | Optional. Google Places type of the venue. (See supported types.) 可选。场所的 Google Places 类型。(请参阅支持的类型。) |
Represents the content of a contact message to be sent as the result of an inline query.
表示作为内联查询结果发送的联系人消息的内容。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
phone_number 电话号码 | String 字符串 | Contact's phone number 联系人的电话号码 |
first_name 名 | String 字符串 | Contact's first name 联系人的名字 |
last_name 姓氏 | String 字符串 | Optional. Contact's last name 可选。联系人的姓氏 |
vcard | String 字符串 | Optional. Additional data about the contact in the form of a vCard, 0-2048 bytes 可选。关于联系人的附加数据,vCard 格式,0-2048 字节 |
Represents the content of an invoice message to be sent as the result of an inline query.
表示作为内联查询结果发送的发票消息的内容。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
title 标题 | String 字符串 | Product name, 1-32 characters 产品名称,1-32 个字符 |
description 描述 | String 字符串 | Product description, 1-255 characters 产品描述,1-255 个字符 |
payload 负载 | String 字符串 | Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use it for your internal processes. 机器人定义的发票负载,1-128 字节。这不会显示给用户,用于您的内部流程。 |
provider_token | String 字符串 | Optional. Payment provider token, obtained via @BotFather. Pass an empty string for payments in Telegram Stars. 可选。支付提供商令牌,通过@BotFather 获得。使用空字符串表示通过 Telegram Stars 支付。 |
currency 货币 | String 字符串 | Three-letter ISO 4217 currency code, see more on currencies. Pass “XTR” for payments in Telegram Stars. 三字母 ISO 4217 货币代码,了解更多关于货币的信息。使用“XTR”表示通过 Telegram Stars 支付。 |
prices 价格 | Array of LabeledPrice LabeledPrice 数组 | Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in Telegram Stars. 价格明细,一个 JSON 序列化的组件列表(例如产品价格、税费、折扣、配送费、配送税、奖金等)。对于 Telegram Stars 支付,必须包含一个项目。 |
max_tip_amount | Integer 整数 | Optional. The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145 . See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in Telegram Stars.可选。接受的小费最大金额,以货币的最小单位表示(整数,不是浮点数/双精度数)。例如,对于最大小费 US$ 1.45 ,传递 max_tip_amount = 145 。参见 currencies.json 中的 exp 参数,它显示每种货币小数点后的位数(大多数货币为 2)。默认为 0。不支持 Telegram Stars 支付。 |
suggested_tip_amounts | Array of Integer 整数数组 | Optional. A JSON-serialized array of suggested amounts of tip in the smallest units of the currency (integer, not 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 max_tip_amount. 可选。一个 JSON 序列化的建议小费金额数组,以货币的最小单位表示(整数,不是浮点数/双精度数)。最多可以指定 4 个建议小费金额。建议的小费金额必须为正数,按严格递增顺序传递,并且不得超过 max_tip_amount。 |
provider_data 提供者数据 | String 字符串 | Optional. 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. 可选。用于发票数据的 JSON 序列化对象,将与支付提供者共享。支付提供者应提供所需字段的详细描述。 |
photo_url | String 字符串 | Optional. URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service. 可选。发票的产品照片 URL。可以是商品的照片或服务的营销图片。 |
photo_size 照片大小 | Integer 整数 | Optional. Photo size in bytes 可选。照片大小,单位为字节 |
photo_width 照片宽度 | Integer 整数 | Optional. Photo width 可选。照片宽度 |
photo_height 照片高度 | Integer 整数 | Optional. Photo height 可选。照片高度 |
need_name | Boolean 布尔值 | Optional. Pass True if you require the user's full name to complete the order. Ignored for payments in Telegram Stars. 可选。如果需要用户的全名来完成订单,请传递 True。对于 Telegram Stars 支付将被忽略。 |
need_phone_number | Boolean 布尔值 | Optional. Pass True if you require the user's phone number to complete the order. Ignored for payments in Telegram Stars. 可选。如果需要用户的电话号码来完成订单,请传入 True。对于 Telegram Stars 支付将被忽略。 |
need_email | Boolean 布尔值 | Optional. Pass True if you require the user's email address to complete the order. Ignored for payments in Telegram Stars. 可选。如果需要用户的电子邮件地址来完成订单,请传入 True。对于 Telegram Stars 支付将被忽略。 |
need_shipping_address | Boolean 布尔值 | Optional. Pass True if you require the user's shipping address to complete the order. Ignored for payments in Telegram Stars. 可选。如果需要用户的送货地址来完成订单,请传入 True。对于 Telegram Stars 支付将被忽略。 |
send_phone_number_to_provider 将电话号码发送给提供商 |
Boolean 布尔值 | Optional. Pass True if the user's phone number should be sent to the provider. Ignored for payments in Telegram Stars. 可选。如果应将用户的电话号码发送给提供商,请传递 True。对于 Telegram Stars 中的支付将被忽略。 |
send_email_to_provider 将电子邮件发送给提供商 | Boolean 布尔值 | Optional. Pass True if the user's email address should be sent to the provider. Ignored for payments in Telegram Stars. 可选。如果应将用户的电子邮件地址发送给提供商,请传递 True。对于 Telegram Stars 中的支付将被忽略。 |
is_flexible | Boolean 布尔值 | Optional. Pass True if the final price depends on the shipping method. Ignored for payments in Telegram Stars. 可选。如果最终价格取决于配送方式,则传入 True。对于使用 Telegram Stars 支付的订单,此参数将被忽略。 |
Represents a result of an inline query that was chosen by the user and sent to their chat partner.
代表用户选择并发送给聊天伙伴的内联查询结果。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
result_id | String 字符串 | The unique identifier for the result that was chosen 被选择结果的唯一标识符。 |
from 来自 | User 用户 | The user that chose the result 选择结果的用户 |
location 位置 | Location 位置 | Optional. Sender location, only for bots that require user location 可选。发送者位置,仅适用于需要用户位置的机器人 |
inline_message_id | String 字符串 | Optional. Identifier of the sent inline message. Available only if there is an inline keyboard attached to the message. Will be also received in callback queries and can be used to edit the message. 可选。发送的内联消息的标识符。仅当消息附带内联键盘时可用。也会在回调查询中接收到,并可用于编辑消息。 |
query 查询 | String 字符串 | The query that was used to obtain the result 用于获取结果的查询 |
Note: It is necessary to enable inline feedback via @BotFather in order to receive these objects in updates.
注意:需要通过@BotFather 启用内联反馈才能在更新中接收这些对象。
Use this method to set the result of an interaction with a Web App and send a corresponding message on behalf of the user to the chat from which the query originated. On success, a SentWebAppMessage object is returned.
使用此方法设置与 Web 应用的交互结果,并代表用户向查询发起聊天发送相应的消息。成功时,返回一个 SentWebAppMessage 对象。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
web_app_query_id | String 字符串 | Yes 是 | Unique identifier for the query to be answered 要回答的查询的唯一标识符 |
result 结果 | InlineQueryResult 内联查询结果 | Yes 是 | A JSON-serialized object describing the message to be sent 描述要发送的消息的 JSON 序列化对象 |
Describes an inline message sent by a Web App on behalf of a user.
描述由 Web App 代表用户发送的内联消息。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
inline_message_id | String 字符串 | Optional. Identifier of the sent inline message. Available only if there is an inline keyboard attached to the message. 可选。发送的内联消息的标识符。仅在消息附带内联键盘时可用。 |
Stores a message that can be sent by a user of a Mini App. Returns a PreparedInlineMessage object.
存储一个可以由小程序用户发送的消息。返回一个 PreparedInlineMessage 对象。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
user_id 用户 ID | Integer 整数 | Yes 是 | Unique identifier of the target user that can use the prepared message 可以使用预设消息的目标用户的唯一标识符 |
result 结果 | InlineQueryResult | Yes 是 | A JSON-serialized object describing the message to be sent 描述要发送的消息的 JSON 序列化对象 |
allow_user_chats 允许用户聊天 | Boolean 布尔值 | Optional 可选 | Pass True if the message can be sent to private chats with users 如果消息可以发送到与用户的私人聊天中,请传递 True |
allow_bot_chats 允许机器人聊天 | Boolean 布尔值 | Optional 可选 | Pass True if the message can be sent to private chats with bots 如果消息可以发送到与机器人的私人聊天中,请传递 True |
allow_group_chats 允许群组聊天 | Boolean 布尔值 | Optional 可选 | Pass True if the message can be sent to group and supergroup chats 如果消息可以发送到群组和超级群组聊天中,请传递 True |
allow_channel_chats | Boolean 布尔值 | Optional 可选 | Pass True if the message can be sent to channel chats 如果消息可以发送到频道聊天中,请传递 True |
Describes an inline message to be sent by a user of a Mini App.
描述一个由小程序用户发送的内联消息。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
id | String 字符串 | Unique identifier of the prepared message 预设消息的唯一标识符 |
expiration_date 到期日期 | Integer 整数 | Expiration date of the prepared message, in Unix time. Expired prepared messages can no longer be used 预设消息的过期日期,以 Unix 时间表示。过期的预设消息将无法再使用 |
Your bot can accept payments from Telegram users. Please see the introduction to payments for more details on the process and how to set up payments for your bot.
您的机器人可以接受来自 Telegram 用户的支付。请参阅支付介绍,了解更多关于流程以及如何为您的机器人设置支付的详细信息。
Use this method to send invoices. On success, the sent Message is returned.
使用此方法发送发票。成功时,返回已发送的消息。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
chat_id | Integer or String 整数或字符串 | Yes 是 | Unique identifier for the target chat or username of the target channel (in the format @channelusername )目标聊天的唯一标识符或目标频道的用户名(格式为 @channelusername ) |
message_thread_id | Integer 整数 | Optional 可选 | Unique identifier for the target message thread (topic) of the forum; for forum supergroups only 论坛中目标消息线程(主题)的唯一标识符;仅适用于论坛超级群组 |
title 标题 | String 字符串 | Yes 是 | Product name, 1-32 characters 产品名称,1-32 个字符 |
description 描述 | String 字符串 | Yes 是 | Product description, 1-255 characters 产品描述,1-255 个字符 |
payload 负载 | String 字符串 | Yes 是 | Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use it for your internal processes. 机器人定义的发票负载,1-128 字节。这不会显示给用户,用于您的内部流程。 |
provider_token | String 字符串 | Optional 可选 | Payment provider token, obtained via @BotFather. Pass an empty string for payments in Telegram Stars. 支付提供商令牌,通过@BotFather 获得。使用空字符串进行 Telegram Stars 支付。 |
currency 货币 | String 字符串 | Yes 是 | Three-letter ISO 4217 currency code, see more on currencies. Pass “XTR” for payments in Telegram Stars. 三字母 ISO 4217 货币代码,了解更多关于货币的信息。支付 Telegram Stars 时请使用“XTR”。 |
prices 价格 | Array of LabeledPrice LabeledPrice 数组 | Yes 是 | Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in Telegram Stars. 价格明细,JSON 序列化的组件列表(例如产品价格、税费、折扣、运费、运费税、奖金等)。支付 Telegram Stars 时必须包含一个项目。 |
max_tip_amount 最大小费金额 | Integer 整数 | Optional 可选 | The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145 . See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in Telegram Stars.接受的小费最大金额,以货币的最小单位表示(整数,不是浮点数/双精度数)。例如,对于最大小费 US$ 1.45 ,请传递 max_tip_amount = 145 。请参阅 currencies.json 中的 exp 参数,它显示了每种货币小数点后的位数(大多数货币为 2)。默认为 0。不支持在 Telegram Stars 中支付。 |
suggested_tip_amounts 建议的小费金额 | Array of Integer 整数数组 | Optional 可选 | A JSON-serialized array of suggested amounts of tips in the smallest units of the currency (integer, not 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 max_tip_amount. 建议的小费金额的 JSON 序列化数组,以货币的最小单位表示(整数,不是浮点数/双精度数)。最多可以指定 4 个建议的小费金额。建议的小费金额必须为正数,按严格递增的顺序传递,并且不得超过 max_tip_amount。 |
start_parameter | String 字符串 | Optional 可选 | Unique deep-linking parameter. If left empty, forwarded copies of the sent message will have a Pay 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 URL button with a deep link to the bot (instead of a Pay button), with the value used as the start parameter 唯一的深度链接参数。如果留空,转发的已发送消息将有一个支付按钮,允许多个用户直接从转发的消息中支付,使用相同的发票。如果非空,转发的已发送消息将有一个带有深度链接到机器人的 URL 按钮(而不是支付按钮),使用该值作为开始参数。 |
provider_data 提供者数据 | String 字符串 | Optional 可选 | 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. JSON 序列化的发票数据,将与支付提供者共享。支付提供者应提供所需字段的详细描述。 |
photo_url | String 字符串 | Optional 可选 | 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. 发票的产品照片 URL。可以是商品的照片或服务的营销图片。人们更喜欢看到他们所支付的东西。 |
photo_size 照片大小 | Integer 整数 | Optional 可选 | Photo size in bytes 照片大小(以字节为单位) |
photo_width 照片宽度 | Integer 整数 | Optional 可选 | Photo width 照片宽度 |
photo_height 照片高度 | Integer 整数 | Optional 可选 | Photo height 照片高度 |
need_name 需要姓名 | Boolean 布尔值 | Optional 可选 | Pass True if you require the user's full name to complete the order. Ignored for payments in Telegram Stars. 如果您需要用户的全名来完成订单,请传递 True。对于 Telegram Stars 支付将被忽略。 |
need_phone_number 需要电话号码 | Boolean 布尔值 | Optional 可选 | Pass True if you require the user's phone number to complete the order. Ignored for payments in Telegram Stars. 如果您需要用户的电话号码来完成订单,请传递 True。对于 Telegram Stars 支付将被忽略。 |
need_email 需要电子邮件 | Boolean 布尔值 | Optional 可选 | Pass True if you require the user's email address to complete the order. Ignored for payments in Telegram Stars. 如果需要用户的电子邮件地址来完成订单,请传递 True。对于 Telegram Stars 支付将被忽略。 |
need_shipping_address | Boolean 布尔值 | Optional 可选 | Pass True if you require the user's shipping address to complete the order. Ignored for payments in Telegram Stars. 如果需要用户的送货地址来完成订单,请传递 True。对于 Telegram Stars 支付将被忽略。 |
send_phone_number_to_provider | Boolean 布尔值 | Optional 可选 | Pass True if the user's phone number should be sent to the provider. Ignored for payments in Telegram Stars. 如果用户的电话号码应发送给提供者,请传递 True。对于 Telegram Stars 支付将被忽略。 |
send_email_to_provider 向提供商发送电子邮件 | Boolean 布尔值 | Optional 可选 | Pass True if the user's email address should be sent to the provider. Ignored for payments in Telegram Stars. 如果用户的电子邮件地址应发送给提供商,则传入 True。对于 Telegram Stars 支付,此参数将被忽略。 |
is_flexible | Boolean 布尔值 | Optional 可选 | Pass True if the final price depends on the shipping method. Ignored for payments in Telegram Stars. 如果最终价格取决于配送方式,则传入 True。对于使用 Telegram Stars 支付的订单,此参数将被忽略。 |
disable_notification 禁用通知 | Boolean 布尔值 | Optional 可选 | Sends the message silently. Users will receive a notification with no sound. 静默发送消息。用户将收到无声通知。 |
protect_content 保护内容 | Boolean 布尔值 | Optional 可选 | Protects the contents of the sent message from forwarding and saving 保护发送的消息内容不被转发和保存 |
allow_paid_broadcast | Boolean 布尔值 | Optional 可选 | Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance 传递 True 以允许每秒发送高达 1000 条消息,忽略广播限制,每条消息收取 0.1 个 Telegram Stars 的费用。相关 Stars 将从机器人的余额中扣除 |
message_effect_id 消息效果 ID | String 字符串 | Optional 可选 | Unique identifier of the message effect to be added to the message; for private chats only 要添加到消息中的消息效果的唯一标识符;仅限私人聊天 |
reply_parameters 回复参数 | ReplyParameters 回复参数 | Optional 可选 | Description of the message to reply to 回复消息的描述 |
reply_markup | InlineKeyboardMarkup 内联键盘标记 | Optional 可选 | A JSON-serialized object for an inline keyboard. If empty, one 'Pay total price ' button will be shown. If not empty, the first button must be a Pay button.一个用于内联键盘的 JSON 序列化对象。如果为空,将显示一个“支付 total price ”按钮。如果不为空,第一个按钮必须是支付按钮。 |
Use this method to create a link for an invoice. Returns the created invoice link as String on success.
使用此方法创建发票链接。成功时返回创建的发票链接字符串。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
business_connection_id 业务连接 ID | String 字符串 | Optional 可选 | Unique identifier of the business connection on behalf of which the link will be created. For payments in Telegram Stars only. 代表将创建链接的业务连接的唯一标识符。仅用于 Telegram Stars 支付。 |
title 标题 | String 字符串 | Yes 是 | Product name, 1-32 characters 产品名称,1-32 个字符 |
description 描述 | String 字符串 | Yes 是 | Product description, 1-255 characters 产品描述,1-255 个字符 |
payload 负载 | String 字符串 | Yes 是 | Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use it for your internal processes. 机器人定义的发票负载,1-128 字节。这不会显示给用户,用于您的内部流程。 |
provider_token 提供商令牌 | String 字符串 | Optional 可选 | Payment provider token, obtained via @BotFather. Pass an empty string for payments in Telegram Stars. 支付提供商令牌,通过@BotFather 获得。使用空字符串进行 Telegram Stars 支付。 |
currency 货币 | String 字符串 | Yes 是 | Three-letter ISO 4217 currency code, see more on currencies. Pass “XTR” for payments in Telegram Stars. 三字母 ISO 4217 货币代码,了解更多关于货币的信息。支付 Telegram Stars 时请使用“XTR”。 |
prices 价格 | Array of LabeledPrice LabeledPrice 数组 | Yes 是 | Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in Telegram Stars. 价格明细,一个 JSON 序列化的组件列表(例如产品价格、税费、折扣、配送费用、配送税、奖金等)。支付 Telegram Stars 时必须包含一个项目。 |
subscription_period 订阅周期 | Integer 整数 | Optional 可选 | The number of seconds the subscription will be active for before the next payment. The currency must be set to “XTR” (Telegram Stars) if the parameter is used. Currently, it must always be 2592000 (30 days) if specified. Any number of subscriptions can be active for a given bot at the same time, including multiple concurrent subscriptions from the same user. Subscription price must no exceed 2500 Telegram Stars. 订阅在下次支付前有效的秒数。如果使用此参数,货币必须设置为“XTR”(Telegram Stars)。目前,如果指定,必须始终为 2592000(30 天)。同一机器人可以同时激活任意数量的订阅,包括来自同一用户的多个并发订阅。订阅价格不得超过 2500 Telegram Stars。 |
max_tip_amount 最大小费金额 | Integer 整数 | Optional 可选 | The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145 . See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in Telegram Stars.接受的小费最大金额,以货币的最小单位表示(整数,不是浮点数/双精度数)。例如,对于最大小费 US$ 1.45 ,请传递 max_tip_amount = 145 。请参阅 currencies.json 中的 exp 参数,它显示了每种货币小数点后的位数(大多数货币为 2)。默认为 0。不支持在 Telegram Stars 中支付。 |
suggested_tip_amounts 建议的小费金额 | Array of Integer 整数数组 | Optional 可选 | A JSON-serialized array of suggested amounts of tips in the smallest units of the currency (integer, not 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 max_tip_amount. 以 JSON 序列化的建议小费金额数组,以货币的最小单位表示(整数,不是浮点数/双精度数)。最多可以指定 4 个建议的小费金额。建议的小费金额必须为正数,按严格递增的顺序传递,并且不得超过最大小费金额。 |
provider_data 提供商数据 | String 字符串 | Optional 可选 | 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. 关于发票的 JSON 序列化数据,将与支付提供商共享。支付提供商应提供所需字段的详细描述。 |
photo_url | String 字符串 | Optional 可选 | URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service. 发票中产品照片的 URL。可以是商品的照片或服务的营销图片。 |
photo_size 照片尺寸 | Integer 整数 | Optional 可选 | Photo size in bytes 照片大小(字节) |
photo_width 照片宽度 | Integer 整数 | Optional 可选 | Photo width 照片宽度 |
photo_height 照片高度 | Integer 整数 | Optional 可选 | Photo height 照片高度 |
need_name 需要姓名 | Boolean 布尔值 | Optional 可选 | Pass True if you require the user's full name to complete the order. Ignored for payments in Telegram Stars. 如果您需要用户的全名来完成订单,请传递 True。对于 Telegram Stars 支付将被忽略。 |
need_phone_number 需要电话号码 | Boolean 布尔值 | Optional 可选 | Pass True if you require the user's phone number to complete the order. Ignored for payments in Telegram Stars. 如果您需要用户的电话号码来完成订单,请传递 True。对于 Telegram Stars 支付将被忽略。 |
need_email 需要电子邮件 | Boolean 布尔值 | Optional 可选 | Pass True if you require the user's email address to complete the order. Ignored for payments in Telegram Stars. 如果需要用户的电子邮件地址来完成订单,请传递 True。对于 Telegram Stars 支付将被忽略。 |
need_shipping_address | Boolean 布尔值 | Optional 可选 | Pass True if you require the user's shipping address to complete the order. Ignored for payments in Telegram Stars. 如果需要用户的送货地址来完成订单,请传递 True。对于 Telegram Stars 支付将被忽略。 |
send_phone_number_to_provider | Boolean 布尔值 | Optional 可选 | Pass True if the user's phone number should be sent to the provider. Ignored for payments in Telegram Stars. 如果用户的电话号码应发送给提供者,请传递 True。对于 Telegram Stars 支付将被忽略。 |
send_email_to_provider 向提供商发送电子邮件 | Boolean 布尔值 | Optional 可选 | Pass True if the user's email address should be sent to the provider. Ignored for payments in Telegram Stars. 如果用户的电子邮件地址应发送给提供商,则传入 True。对于 Telegram Stars 支付,此参数将被忽略。 |
is_flexible | Boolean 布尔值 | Optional 可选 | Pass True if the final price depends on the shipping method. Ignored for payments in Telegram Stars. 如果最终价格取决于配送方式,则传入 True。对于使用 Telegram Stars 支付的订单,此参数将被忽略。 |
If you sent an invoice requesting a shipping address and the parameter is_flexible was specified, the Bot API will send an Update with a shipping_query field to the bot. Use this method to reply to shipping queries. On success, True is returned.
如果您发送了请求运输地址的发票,并且指定了参数 is_flexible,Bot API 将向机器人发送带有 shipping_query 字段的更新。使用此方法来回复运输查询。成功时,返回 True。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
shipping_query_id 运输查询 ID | String 字符串 | Yes 是 | Unique identifier for the query to be answered 要回答的查询的唯一标识符 |
ok 确定 | Boolean 布尔值 | Yes 是 | Pass True if delivery to the specified address is possible and False if there are any problems (for example, if delivery to the specified address is not possible) 如果可以送货到指定地址则传 True,如果有任何问题(例如无法送货到指定地址)则传 False |
shipping_options 运输选项 | Array of ShippingOption ShippingOption 数组 | Optional 可选 | Required if ok is True. A JSON-serialized array of available shipping options. 如果 ok 为 True 则必需。一个可用的运输选项的 JSON 序列化数组。 |
error_message 错误消息 | String 字符串 | Optional 可选 | Required if ok is False. 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. 如果 ok 为 False 时必填。以人类可读的形式解释无法完成订单的原因的错误消息(例如“对不起,您所需的地址无法送达”)。Telegram 将向用户显示此消息。 |
Once the user has confirmed their payment and shipping details, the Bot API sends the final confirmation in the form of an Update with the field pre_checkout_query. Use this method to respond to such pre-checkout queries. On success, True is returned. Note: The Bot API must receive an answer within 10 seconds after the pre-checkout query was sent.
一旦用户确认了他们的支付和运输详情,Bot API 会以包含 pre_checkout_query 字段的 Update 形式发送最终确认。使用此方法来响应此类预结账查询。成功时,返回 True。注意:Bot API 必须在发送预结账查询后的 10 秒内收到答复。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
pre_checkout_query_id 预结账查询 ID | String 字符串 | Yes 是 | Unique identifier for the query to be answered 要回答的查询的唯一标识符 |
ok 好的 | Boolean 布尔值 | Yes 是 | Specify True if everything is alright (goods are available, etc.) and the bot is ready to proceed with the order. Use False if there are any problems. 如果一切正常(商品可用等)且机器人准备好继续处理订单,请指定为 True。如果有任何问题,请使用 False。 |
error_message 错误消息 | String 字符串 | Optional 可选 | Required if ok is False. 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. 如果 ok 为 False 时必填。以人类可读的形式解释无法继续结账的原因的错误消息(例如,“对不起,有人刚买走了我们最后一件令人惊叹的黑色 T 恤,而您正在填写付款详情。请选择不同的颜色或服装!”)。Telegram 将向用户显示此消息。 |
Returns the bot's Telegram Star transactions in chronological order. On success, returns a StarTransactions object.
按时间顺序返回机器人的 Telegram Star 交易。在成功时,返回一个 StarTransactions 对象。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
offset 偏移量 | Integer 整数 | Optional 可选 | Number of transactions to skip in the response 在响应中跳过的交易数量 |
limit 限制 | Integer 整数 | Optional 可选 | The maximum number of transactions to be retrieved. Values between 1-100 are accepted. Defaults to 100. 要检索的最大交易数量。接受 1-100 之间的值。默认值为 100。 |
Refunds a successful payment in Telegram Stars. Returns True on success.
退还成功的 Telegram Stars 支付。在成功时返回 True。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
user_id 用户 ID | Integer 整数 | Yes 是 | Identifier of the user whose payment will be refunded 将被退款的用户的标识符 |
telegram_payment_charge_id | String 字符串 | Yes 是 | Telegram payment identifier Telegram 支付标识符 |
Allows the bot to cancel or re-enable extension of a subscription paid in Telegram Stars. Returns True on success.
允许机器人取消或重新启用通过 Telegram Stars 支付的订阅扩展。在成功时返回 True。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
user_id 用户 ID | Integer 整数 | Yes 是 | Identifier of the user whose subscription will be edited 将要编辑其订阅的用户的标识符 |
telegram_payment_charge_id | String 字符串 | Yes 是 | Telegram payment identifier for the subscription 订阅的 Telegram 支付标识符 |
is_canceled | Boolean 布尔值 | Yes 是 | Pass True to cancel extension of the user subscription; the subscription must be active up to the end of the current subscription period. Pass False to allow the user to re-enable a subscription that was previously canceled by the bot. 传递 True 以取消用户订阅的延期;订阅必须在当前订阅期结束前保持有效。传递 False 以允许用户重新启用之前被机器人取消的订阅。 |
This object represents a portion of the price for goods or services.
此对象代表商品或服务价格的一部分。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
label 标签 | String 字符串 | Portion label 部分标签 |
amount 金额 | Integer 整数 | Price of the product in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145 . See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).产品价格以货币的最小单位表示(整数,不是浮点数/双精度数)。例如,对于价格 US$ 1.45 ,传递 amount = 145 。参见 currencies.json 中的 exp 参数,它显示每种货币小数点后的位数(大多数货币为 2 位)。 |
This object contains basic information about an invoice.
此对象包含发票的基本信息。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
title 标题 | String 字符串 | Product name 产品名称 |
description 描述 | String 字符串 | Product description 产品描述 |
start_parameter | String 字符串 | Unique bot deep-linking parameter that can be used to generate this invoice 可用于生成此发票的唯一机器人深度链接参数 |
currency 货币 | String 字符串 | Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars 三字母 ISO 4217 货币代码,或“XTR”表示使用 Telegram Stars 支付 |
total_amount 总金额 | Integer 整数 | Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145 . See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).以货币的最小单位表示的总价格(整数,不是浮点数/双精度数)。例如,对于 US$ 1.45 的价格,传递 amount = 145 。参见 currencies.json 中的 exp 参数,它显示了每种货币小数点后面的数字位数(大多数货币为 2)。 |
This object represents a shipping address.
此对象代表一个送货地址。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
country_code 国家代码 | String 字符串 | Two-letter ISO 3166-1 alpha-2 country code 两字母 ISO 3166-1 alpha-2 国家代码 |
state 州 | String 字符串 | State, if applicable 州(如适用) |
city 城市 | String 字符串 | City 城市 |
street_line1 街道线 1 | String 字符串 | First line for the address 地址的第一行 |
street_line2 街道线 2 | String 字符串 | Second line for the address 地址的第二行 |
post_code 邮政编码 | String 字符串 | Address post code 地址邮政编码 |
This object represents information about an order.
此对象代表订单的信息。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
name 名称 | String 字符串 | Optional. User name 可选。用户名 |
phone_number 电话号码 | String 字符串 | Optional. User's phone number 可选。用户的电话号码 |
email 电子邮件 | String 字符串 | Optional. User email 可选。用户电子邮件 |
shipping_address 送货地址 | ShippingAddress 送货地址 | Optional. User shipping address 可选。用户送货地址 |
This object represents one shipping option.
此对象代表一个运输选项。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
id | String 字符串 | Shipping option identifier 运输选项标识符 |
title 标题 | String 字符串 | Option title 选项标题 |
prices 价格 | Array of LabeledPrice LabeledPrice 数组 | List of price portions 价格部分列表 |
This object contains basic information about a successful payment. Note that if the buyer initiates a chargeback with the relevant payment provider following this transaction, the funds may be debited from your balance. This is outside of Telegram's control.
此对象包含有关成功支付的基本信息。请注意,如果买家在交易后向相关支付提供商发起退款请求,您的余额可能会被扣除资金。这不在 Telegram 的控制范围内。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
currency 货币 | String 字符串 | Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars 三字母 ISO 4217 货币代码,或“XTR”表示使用 Telegram Stars 支付 |
total_amount 总金额 | Integer 整数 | Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145 . See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).以货币的最小单位表示的总价格(整数,不是浮点数/双精度数)。例如,对于价格 US$ 1.45 ,传递 amount = 145 。请参阅 currencies.json 中的 exp 参数,它显示了每种货币小数点后位数(大多数货币为 2)。 |
invoice_payload 发票负载 | String 字符串 | Bot-specified invoice payload 机器人指定的发票负载 |
subscription_expiration_date 订阅到期日期 |
Integer 整数 | Optional. Expiration date of the subscription, in Unix time; for recurring payments only 可选。订阅的到期日期,以 Unix 时间表示;仅适用于定期支付 |
is_recurring 是否定期 | True 真 | Optional. True, if the payment is a recurring payment for a subscription 可选。如果支付是订阅的定期支付,则为 True |
is_first_recurring | True 真 | Optional. True, if the payment is the first payment for a subscription 可选。如果支付是订阅的首次支付,则为 True |
shipping_option_id | String 字符串 | Optional. Identifier of the shipping option chosen by the user 可选。用户选择的配送选项的标识符 |
order_info 订单信息 | OrderInfo 订单信息 | Optional. Order information provided by the user 可选。用户提供的订单信息 |
telegram_payment_charge_id | String 字符串 | Telegram payment identifier 电报支付标识符 |
provider_payment_charge_id 提供商支付费用 ID |
String 字符串 | Provider payment identifier 提供商支付标识符 |
This object contains basic information about a refunded payment.
此对象包含有关已退款支付的基本信息。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
currency 货币 | String 字符串 | Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars. Currently, always “XTR” 三字母 ISO 4217 货币代码,或“XTR”用于 Telegram Stars 支付。目前,始终为“XTR” |
total_amount 总金额 | Integer 整数 | Total refunded price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 , total_amount = 145 . See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).以货币的最小单位表示的总退款价格(整数,不是浮点数/双精度数)。例如,对于价格 US$ 1.45 , total_amount = 145 。参见 currencies.json 中的 exp 参数,它显示每种货币小数点后的数字位数(大多数货币为 2)。 |
invoice_payload 发票负载 | String 字符串 | Bot-specified invoice payload 机器人指定的发票负载 |
telegram_payment_charge_id 电报支付费用 ID |
String 字符串 | Telegram payment identifier 电报支付标识符 |
provider_payment_charge_id 提供商支付费用 ID |
String 字符串 | Optional. Provider payment identifier 可选。提供商支付标识符 |
This object contains information about an incoming shipping query.
此对象包含有关传入运输查询的信息。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
id | String 字符串 | Unique query identifier 唯一查询标识符 |
from 来自 | User 用户 | User who sent the query 发送查询的用户 |
invoice_payload | String 字符串 | Bot-specified invoice payload 机器人指定的发票负载 |
shipping_address 送货地址 | ShippingAddress 送货地址 | User specified shipping address 用户指定的送货地址 |
This object contains information about an incoming pre-checkout query.
此对象包含有关传入预结账查询的信息。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
id | String 字符串 | Unique query identifier 唯一查询标识符 |
from 来自 | User 用户 | User who sent the query 发送查询的用户 |
currency 货币 | String 字符串 | Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars 三字母 ISO 4217 货币代码,或“XTR”用于 Telegram Stars 支付 |
total_amount 总金额 | Integer 整数 | Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145 . See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).以货币的最小单位表示的总价格(整数,不是浮点数/双精度数)。例如,对于价格 US$ 1.45 ,传递 amount = 145 。参见 currencies.json 中的 exp 参数,它显示每种货币小数点后数字的数量(大多数货币为 2)。 |
invoice_payload 发票负载 | String 字符串 | Bot-specified invoice payload 机器人指定的发票负载 |
shipping_option_id 运输选项 ID | String 字符串 | Optional. Identifier of the shipping option chosen by the user 可选。用户选择的运输选项的标识符 |
order_info 订单信息 | OrderInfo 订单信息 | Optional. Order information provided by the user 可选。用户提供的订单信息 |
This object contains information about a paid media purchase.
此对象包含有关付费媒体购买的信息。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
from 来自 | User 用户 | User who purchased the media 购买媒体的用户 |
paid_media_payload | String 字符串 | Bot-specified paid media payload 机器人指定的付费媒体负载 |
This object describes the state of a revenue withdrawal operation. Currently, it can be one of
此对象描述了收入提现操作的状态。目前,它可以是以下之一
The withdrawal is in progress.
提现正在进行中。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | String 字符串 | Type of the state, always “pending” 状态类型,始终为“pending” |
The withdrawal succeeded.
提款成功。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | String 字符串 | Type of the state, always “succeeded” 状态类型,始终为“succeeded” |
date 日期 | Integer 整数 | Date the withdrawal was completed in Unix time 提款完成的日期,Unix 时间格式 |
url | String 字符串 | An HTTPS URL that can be used to see transaction details 一个可用于查看交易详情的 HTTPS URL |
The withdrawal failed and the transaction was refunded.
提款失败,交易已退款。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | String 字符串 | Type of the state, always “failed” 状态类型,始终为“failed” |
Contains information about the affiliate that received a commission via this transaction.
包含通过此交易获得佣金的附属机构的信息。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
affiliate_user 附属用户 | User 用户 | Optional. The bot or the user that received an affiliate commission if it was received by a bot or a user 可选。如果是机器人或用户获得了附属佣金,则为获得附属佣金的机器人或用户。 |
affiliate_chat 附属聊天 | Chat 聊天 | Optional. The chat that received an affiliate commission if it was received by a chat 可选。如果是聊天获得了附属佣金,则为获得附属佣金的聊天。 |
commission_per_mille 每千分佣金 | Integer 整数 | The number of Telegram Stars received by the affiliate for each 1000 Telegram Stars received by the bot from referred users 附属机构为每个被推荐用户给机器人带来的 1000 个 Telegram Stars 所获得的 Telegram Stars 数量 |
amount 金额 | Integer 整数 | Integer amount of Telegram Stars received by the affiliate from the transaction, rounded to 0; can be negative for refunds 附属机构从交易中获得的整数数量的 Telegram Stars,四舍五入到 0;退款时可能为负数 |
nanostar_amount 纳米星数量 | Integer 整数 | Optional. The number of 1/1000000000 shares of Telegram Stars received by the affiliate; from -999999999 to 999999999; can be negative for refunds 可选。从-999999999 到 999999999 的附属机构获得的 1/1000000000 份 Telegram Stars 数量;退款时可能为负数 |
This object describes the source of a transaction, or its recipient for outgoing transactions. Currently, it can be one of
此对象描述交易的来源,或是对于外向交易的接收者。目前,它可以是以下之一
Describes a transaction with a user.
描述与用户的交易。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | String 字符串 | Type of the transaction partner, always “user” 交易伙伴类型,始终为“用户” |
user 用户 | User 用户 | Information about the user 用户信息 |
affiliate 附属机构 | AffiliateInfo | Optional. Information about the affiliate that received a commission via this transaction 可选。通过此交易获得佣金的附属机构信息 |
invoice_payload | String 字符串 | Optional. Bot-specified invoice payload 可选。机器人指定的发票负载 |
subscription_period 订阅周期 | Integer 整数 | Optional. The duration of the paid subscription 可选。已支付订阅的持续时间 |
paid_media 付费媒体 | Array of PaidMedia PaidMedia 数组 | Optional. Information about the paid media bought by the user 可选。用户购买的已支付媒体的信息 |
paid_media_payload | String 字符串 | Optional. Bot-specified paid media payload 可选。机器人指定的已支付媒体负载 |
gift 礼物 | Gift 礼物 | Optional. The gift sent to the user by the bot 可选。机器人发送给用户的礼物 |
Describes a transaction with a chat.
描述与聊天的交易。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | String 字符串 | Type of the transaction partner, always “chat” 交易伙伴的类型,始终为“聊天” |
chat 聊天 | Chat 聊天 | Information about the chat 关于聊天的信息 |
gift 礼物 | Gift 礼物 | Optional. The gift sent to the chat by the bot 可选。机器人发送给聊天的礼物 |
Describes the affiliate program that issued the affiliate commission received via this transaction.
描述通过此交易收到的加盟佣金的加盟计划。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | String 字符串 | Type of the transaction partner, always “affiliate_program” 交易伙伴的类型,始终为“affiliate_program” |
sponsor_user | User 用户 | Optional. Information about the bot that sponsored the affiliate program 可选。关于赞助附属计划的机器人的信息 |
commission_per_mille | Integer 整数 | The number of Telegram Stars received by the bot for each 1000 Telegram Stars received by the affiliate program sponsor from referred users 附属计划赞助者从推荐用户处获得的每 1000 个 Telegram Stars,机器人获得的 Telegram Stars 数量 |
Describes a withdrawal transaction with Fragment.
描述与片段的提款交易。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | String 字符串 | Type of the transaction partner, always “fragment” 交易伙伴类型,始终为“片段” |
withdrawal_state 提款状态 | RevenueWithdrawalState 收入提款状态 | Optional. State of the transaction if the transaction is outgoing 可选。如果交易是出站交易,则表示交易状态 |
Describes a withdrawal transaction to the Telegram Ads platform.
描述向 Telegram Ads 平台的提款交易。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | String 字符串 | Type of the transaction partner, always “telegram_ads” 交易伙伴类型,始终为“telegram_ads” |
Describes a transaction with payment for paid broadcasting.
描述一笔用于付费广播的交易。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | String 字符串 | Type of the transaction partner, always “telegram_api” 交易伙伴类型,始终为“telegram_api” |
request_count 请求次数 | Integer 整数 | The number of successful requests that exceeded regular limits and were therefore billed 超出常规限制并因此被计费的成功请求数量 |
Describes a transaction with an unknown source or recipient.
描述一个来源或接收者未知的交易。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | String 字符串 | Type of the transaction partner, always “other” 交易伙伴的类型,始终为“其他” |
Describes a Telegram Star transaction. Note that if the buyer initiates a chargeback with the payment provider from whom they acquired Stars (e.g., Apple, Google) following this transaction, the refunded Stars will be deducted from the bot's balance. This is outside of Telegram's control.
描述一笔 Telegram Star 交易。请注意,如果买方在该交易后向其购买 Stars 的支付提供商(例如,Apple, Google)发起退款请求,退还的 Stars 将从机器人的余额中扣除。这不在 Telegram 的控制范围内。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
id | String 字符串 | Unique identifier of the transaction. Coincides with the identifier of the original transaction for refund transactions. Coincides with SuccessfulPayment.telegram_payment_charge_id for successful incoming payments from users. 交易的唯一标识符。对于退款交易,与原始交易的标识符一致。对于用户成功的传入支付,与 SuccessfulPayment.telegram_payment_charge_id 一致。 |
amount 金额 | Integer 整数 | Integer amount of Telegram Stars transferred by the transaction 交易中转移的 Telegram Stars 的整数金额 |
nanostar_amount | Integer 整数 | Optional. The number of 1/1000000000 shares of Telegram Stars transferred by the transaction; from 0 to 999999999 可选。交易中转移的 Telegram Stars 的 1/1000000000 份数;从 0 到 999999999 |
date 日期 | Integer 整数 | Date the transaction was created in Unix time 交易创建的日期,以 Unix 时间表示 |
source 来源 | TransactionPartner 交易伙伴 | Optional. Source of an incoming transaction (e.g., a user purchasing goods or services, Fragment refunding a failed withdrawal). Only for incoming transactions 可选。传入交易的来源(例如,用户购买商品或服务,Fragment 退款失败的提现)。仅用于传入交易 |
receiver 接收者 | TransactionPartner 交易伙伴 | Optional. Receiver of an outgoing transaction (e.g., a user for a purchase refund, Fragment for a withdrawal). Only for outgoing transactions 可选。传出交易的接收者(例如,用户的购买退款,Fragment 的提现)。仅用于传出交易 |
Contains a list of Telegram Star transactions.
包含一系列电报星星交易。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
transactions 交易 | Array of StarTransaction 星星交易数组 | The list of transactions 交易列表 |
Telegram Passport 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 manual for details.
电报护照是一种统一的授权方法,用于需要个人身份识别的服务。用户可以上传他们的文件一次,然后立即与需要真实世界身份的服务(金融、ICO 等)共享他们的数据。请参阅手册以获取详细信息。
Describes Telegram Passport data shared with the bot by the user.
描述用户与机器人共享的电报护照数据。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
data 数据 | Array of EncryptedPassportElement EncryptedPassportElement 数组 |
Array with information about documents and other Telegram Passport elements that was shared with the bot 包含与机器人共享的文档和其他 Telegram Passport 元素信息的数组 |
credentials 凭证 | EncryptedCredentials 加密凭证 | Encrypted credentials required to decrypt the data 解密数据所需的加密凭证 |
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.
此对象表示上传到 Telegram Passport 的文件。目前所有 Telegram Passport 文件在解密后均为 JPEG 格式,且大小不超过 10MB。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
file_id | String 字符串 | Identifier for this file, which can be used to download or reuse the file 此文件的标识符,可用于下载或重用该文件 |
file_unique_id | String 字符串 | 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. 此文件的唯一标识符,应随时间和不同机器人保持相同。不能用于下载或重新使用文件。 |
file_size | Integer 整数 | File size in bytes 文件大小(字节) |
file_date 文件日期 | Integer 整数 | Unix time when the file was uploaded 文件上传时的 Unix 时间 |
Describes documents or other Telegram Passport elements shared with the bot by the user.
描述用户与机器人共享的文档或其他 Telegram 护照元素。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
type 类型 | String 字符串 | 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”. 元素类型。其中之一:“personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport”, “address”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”, “phone_number”, “email”。 |
data 数据 | String 字符串 | Optional. Base64-encoded encrypted Telegram Passport element data provided by the user; available only for “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport” and “address” types. Can be decrypted and verified using the accompanying EncryptedCredentials. 可选。用户提供的 Base64 编码的加密 Telegram 护照元素数据;仅适用于“personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport”和“address”类型。可以使用附带的 EncryptedCredentials 解密和验证。 |
phone_number 电话号码 | String 字符串 | Optional. User's verified phone number; available only for “phone_number” type 可选。用户验证的电话号码;仅适用于“phone_number”类型。 |
email 电子邮件 | String 字符串 | Optional. User's verified email address; available only for “email” type 可选。用户的已验证电子邮件地址;仅适用于“email”类型 |
files 文件 | Array of PassportFile PassportFile 数组 | Optional. Array of encrypted files with documents provided by the user; available only for “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration” and “temporary_registration” types. Files can be decrypted and verified using the accompanying EncryptedCredentials. 可选。用户提供的文档的加密文件数组;仅适用于“utility_bill”、“bank_statement”、“rental_agreement”、“passport_registration”和“temporary_registration”类型。文件可以使用附带的 EncryptedCredentials 解密和验证。 |
front_side 正面 | PassportFile 护照文件 | Optional. Encrypted file with the front side of the document, provided by the user; available only for “passport”, “driver_license”, “identity_card” and “internal_passport”. The file can be decrypted and verified using the accompanying EncryptedCredentials. 可选。用户提供的文档正面加密文件;仅适用于“护照”、“驾驶证”、“身份证”和“内部护照”。该文件可以使用附带的 EncryptedCredentials 解密和验证。 |
reverse_side 背面 | PassportFile 护照文件 | Optional. Encrypted file with the reverse side of the document, provided by the user; available only for “driver_license” and “identity_card”. The file can be decrypted and verified using the accompanying EncryptedCredentials. 可选。用户提供的文档背面加密文件;仅适用于“驾驶证”和“身份证”。该文件可以使用附带的 EncryptedCredentials 解密和验证。 |
selfie 自拍 | PassportFile 护照文件 | Optional. Encrypted file with the selfie of the user holding a document, provided by the user; available if requested for “passport”, “driver_license”, “identity_card” and “internal_passport”. The file can be decrypted and verified using the accompanying EncryptedCredentials. 可选。用户提供的包含用户手持文件自拍的加密文件;如果请求了“护照”、“驾驶证”、“身份证”和“内部护照”,则可用。该文件可以使用附带的 EncryptedCredentials 解密和验证。 |
translation 翻译 | Array of PassportFile PassportFile 数组 | Optional. 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 EncryptedCredentials. 可选。包含用户提供的文档翻译版本的加密文件数组;如果请求了“护照”、“驾驶证”、“身份证”、“国内护照”、“公用事业账单”、“银行对账单”、“租赁协议”、“护照登记”和“临时登记”类型,则可用。文件可以使用附带的 EncryptedCredentials 解密和验证。 |
hash 哈希 | String 字符串 | Base64-encoded element hash for using in PassportElementErrorUnspecified 用于 PassportElementErrorUnspecified 的 Base64 编码元素哈希 |
Describes data required for decrypting and authenticating EncryptedPassportElement. See the Telegram Passport Documentation for a complete description of the data decryption and authentication processes.
描述解密和验证 EncryptedPassportElement 所需的数据。请参阅 Telegram 护照文档以获取数据解密和验证过程的完整描述。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
data 数据 | String 字符串 | Base64-encoded encrypted JSON-serialized data with unique user's payload, data hashes and secrets required for EncryptedPassportElement decryption and authentication Base64 编码的加密 JSON 序列化数据,包含用户的唯一负载、数据哈希和用于 EncryptedPassportElement 解密和认证的秘密 |
hash 哈希 | String 字符串 | Base64-encoded data hash for data authentication 用于数据认证的 Base64 编码的数据哈希 |
secret 秘密 | String 字符串 | Base64-encoded secret, encrypted with the bot's public RSA key, required for data decryption 使用机器人公钥 RSA 加密的 Base64 编码的秘密,用于数据解密 |
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 True on success.
通知用户他们提供的某些 Telegram Passport 元素包含错误。在错误修复之前,用户将无法重新提交他们的 Passport 给您(您返回错误的字段内容必须更改)。成功时返回 True。
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.
如果用户提交的数据因任何原因不符合您的服务所要求的标准,请使用此功能。例如,如果生日日期看起来无效,提交的文档模糊不清,扫描显示有篡改的证据等。在错误消息中提供一些细节,以确保用户知道如何纠正这些问题。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
user_id 用户 ID | Integer 整数 | Yes 是 | User identifier 用户标识符 |
errors 错误 | Array of PassportElementError PassportElementError 数组 |
Yes 是 | A JSON-serialized array describing the errors 描述错误的 JSON 序列化数组 |
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:
此对象代表用户提交的 Telegram 护照元素中的错误,用户应解决此错误。它应为以下之一:
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.
代表用户提供的数据字段之一出现的问题。当字段值发生变化时,错误被视为已解决。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
source 来源 | String 字符串 | Error source, must be data 错误来源,必须是数据 |
type 类型 | String 字符串 | The section of the user's Telegram Passport which has the error, one of “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport”, “address” 用户 Telegram 护照中出现错误的部分之一,包括“个人详情”、“护照”、“驾驶执照”、“身份证”、“国内护照”、“地址” |
field_name 字段名称 | String 字符串 | Name of the data field which has the error 包含错误的数据字段名称 |
data_hash 数据哈希 | String 字符串 | Base64-encoded data hash Base64 编码的数据哈希 |
message 消息 | String 字符串 | Error message 错误消息 |
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.
表示文档正面存在问题。当文档正面的文件发生变化时,错误被视为已解决。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
source 来源 | String 字符串 | Error source, must be front_side 错误来源,必须是 front_side |
type 类型 | String 字符串 | The section of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport” 用户 Telegram 护照中存在问题的部分,可为“passport”, “driver_license”, “identity_card”, “internal_passport”之一 |
file_hash | String 字符串 | Base64-encoded hash of the file with the front side of the document 文档正面的文件的 Base64 编码哈希 |
message 消息 | String 字符串 | Error message 错误消息 |
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.
表示文档背面存在问题。当文档背面的文件更改时,错误被视为已解决。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
source 来源 | String 字符串 | Error source, must be reverse_side 错误来源,必须是 reverse_side |
type 类型 | String 字符串 | The section of the user's Telegram Passport which has the issue, one of “driver_license”, “identity_card” 用户的 Telegram 护照中出现问题的部分,可能是“驾驶证”或“身份证”之一 |
file_hash 文件哈希 | String 字符串 | Base64-encoded hash of the file with the reverse side of the document 文档背面的文件的 Base64 编码哈希 |
message 消息 | String 字符串 | Error message 错误消息 |
Represents an issue with the selfie with a document. The error is considered resolved when the file with the selfie changes.
表示与自拍照和文件有关的问题。当自拍照文件发生变化时,错误被认为已解决。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
source 来源 | String 字符串 | Error source, must be selfie 错误来源,必须是自拍照 |
type 类型 | String 字符串 | The section of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport” 用户 Telegram 护照中出现问题的部分之一,包括“护照”、“驾驶证”、“身份证”、“国内护照” |
file_hash 文件哈希 | String 字符串 | Base64-encoded hash of the file with the selfie 自拍照文件的 Base64 编码哈希值 |
message 消息 | String 字符串 | Error message 错误消息 |
Represents an issue with a document scan. The error is considered resolved when the file with the document scan changes.
表示文档扫描存在问题。当包含文档扫描的文件发生变化时,错误被认为已解决。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
source 来源 | String 字符串 | Error source, must be file 错误来源,必须是文件 |
type 类型 | String 字符串 | The section of the user's Telegram Passport which has the issue, one of “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration” 用户 Telegram 护照中出现问题的部分之一,包括“水电费账单”、“银行对账单”、“租赁协议”、“护照登记”、“临时登记” |
file_hash 文件哈希 | String 字符串 | Base64-encoded file hash Base64 编码的文件哈希 |
message 消息 | String 字符串 | Error message 错误消息 |
Represents an issue with a list of scans. The error is considered resolved when the list of files containing the scans changes.
表示带有一系列扫描的-issue。 当包含扫描的文件列表发生变化时,错误被认为已解决。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
source 来源 | String 字符串 | Error source, must be files 错误来源,必须是文件 |
type 类型 | String 字符串 | The section of the user's Telegram Passport which has the issue, one of “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration” 用户的 Telegram Passport 中出现问题的部分之一,包括“utility_bill”,“bank_statement”,“rental_agreement”,“passport_registration”,“temporary_registration” |
file_hashes 文件哈希 | Array of String 字符串数组 | List of base64-encoded file hashes base64 编码的文件哈希列表 |
message 消息 | String 字符串 | Error message 错误消息 |
Represents an issue with one of the files that constitute the translation of a document. The error is considered resolved when the file changes.
表示构成文件翻译的一个文件存在问题。当文件更改时,错误被认为已解决。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
source 来源 | String 字符串 | Error source, must be translation_file 错误来源,必须是 translation_file |
type 类型 | String 字符串 | 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” 用户 Telegram 护照中存在问题的元素类型之一,包括“passport”, “driver_license”, “identity_card”, “internal_passport”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration” |
file_hash 文件哈希 | String 字符串 | Base64-encoded file hash Base64 编码的文件哈希 |
message 消息 | String 字符串 | Error message 错误消息 |
Represents an issue with the translated version of a document. The error is considered resolved when a file with the document translation change.
表示文档翻译版本的问题。当文件中包含文档翻译更改时,错误被视为已解决。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
source 来源 | String 字符串 | Error source, must be translation_files 错误来源,必须是 translation_files |
type 类型 | String 字符串 | 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” 用户 Telegram 护照中出现问题的元素类型之一,包括“passport”, “driver_license”, “identity_card”, “internal_passport”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration” |
file_hashes | Array of String 字符串数组 | List of base64-encoded file hashes base64 编码文件哈希列表 |
message 消息 | String 字符串 | Error message 错误消息 |
Represents an issue in an unspecified place. The error is considered resolved when new data is added.
表示某个未指定位置的问题。当添加新数据时,错误被认为已解决。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
source 来源 | String 字符串 | Error source, must be unspecified 错误来源,必须未指定 |
type 类型 | String 字符串 | Type of element of the user's Telegram Passport which has the issue 用户 Telegram Passport 中出现问题的元素类型 |
element_hash 元素哈希 | String 字符串 | Base64-encoded element hash Base64 编码的元素哈希 |
message 消息 | String 字符串 | Error message 错误消息 |
Your bot can offer users HTML5 games to play solo or to compete against each other in groups and one-on-one chats. Create games via @BotFather using the /newgame 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.
您的机器人可以为用户提供 HTML5 游戏,供他们独自玩或在群组和一对一聊天中相互竞争。通过@BotFather 使用/newgame 命令创建游戏。请注意,这种能力需要责任:您需要接受您机器人将提供的每个游戏的条款。
Use this method to send a game. On success, the sent Message is returned.
使用此方法发送游戏。成功时,返回发送的消息。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
business_connection_id 业务连接 ID | String 字符串 | Optional 可选 | Unique identifier of the business connection on behalf of which the message will be sent 代表将要发送消息的业务连接的唯一标识符 |
chat_id | Integer 整数 | Yes 是 | Unique identifier for the target chat 目标聊天的唯一标识符 |
message_thread_id | Integer 整数 | Optional 可选 | Unique identifier for the target message thread (topic) of the forum; for forum supergroups only 论坛中目标消息线程(主题)的唯一标识符;仅适用于论坛超级群组 |
game_short_name | String 字符串 | Yes 是 | Short name of the game, serves as the unique identifier for the game. Set up your games via @BotFather. 游戏的简称,作为游戏的唯一标识符。通过@BotFather 设置你的游戏。 |
disable_notification 禁用通知 | Boolean 布尔值 | Optional 可选 | Sends the message silently. Users will receive a notification with no sound. 静默发送消息。用户将收到无声通知。 |
protect_content 保护内容 | Boolean 布尔值 | Optional 可选 | Protects the contents of the sent message from forwarding and saving 保护发送的消息内容不被转发和保存 |
allow_paid_broadcast | Boolean 布尔值 | Optional 可选 | Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance 传递 True 以允许每秒发送高达 1000 条消息,忽略广播限制,每条消息收取 0.1 个 Telegram Stars 的费用。相关 Stars 将从机器人的余额中扣除 |
message_effect_id 消息效果 ID | String 字符串 | Optional 可选 | Unique identifier of the message effect to be added to the message; for private chats only 要添加到消息中的消息效果的唯一标识符;仅限私人聊天 |
reply_parameters 回复参数 | ReplyParameters 回复参数 | Optional 可选 | Description of the message to reply to 回复消息的描述 |
reply_markup | InlineKeyboardMarkup 内联键盘标记 | Optional 可选 | A JSON-serialized object for an inline keyboard. If empty, one 'Play game_title' button will be shown. If not empty, the first button must launch the game. 一个内联键盘的 JSON 序列化对象。如果为空,将显示一个“玩游戏标题”的按钮。如果不为空,第一个按钮必须启动游戏。 |
This object represents a game. Use BotFather to create and edit games, their short names will act as unique identifiers.
此对象代表一个游戏。使用 BotFather 创建和编辑游戏,它们的短名称将作为唯一标识符。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
title 标题 | String 字符串 | Title of the game 游戏标题 |
description 描述 | String 字符串 | Description of the game 游戏描述 |
photo 照片 | Array of PhotoSize PhotoSize 数组 | Photo that will be displayed in the game message in chats. 将在聊天中的游戏消息中显示的照片。 |
text 文本 | String 字符串 | Optional. 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 setGameScore, or manually edited using editMessageText. 0-4096 characters. 可选。游戏消息中包含的游戏或高分的简短描述。可以当机器人调用 setGameScore 时自动编辑以包含当前游戏的高分,或者使用 editMessageText 手动编辑。0-4096 个字符。 |
text_entities 文本实体 | Array of MessageEntity MessageEntity 数组 | Optional. Special entities that appear in text, such as usernames, URLs, bot commands, etc. 可选。文本中出现的特殊实体,如用户名、URL、机器人命令等。 |
animation 动画 | Animation 动画 | Optional. Animation that will be displayed in the game message in chats. Upload via BotFather 可选。在聊天游戏消息中显示的动画。通过 BotFather 上传 |
A placeholder, currently holds no information. Use BotFather to set up your game.
一个占位符,目前没有信息。使用 BotFather 来设置你的游戏。
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 Message is returned, otherwise True is returned. Returns an error, if the new score is not greater than the user's current score in the chat and force is False.
使用此方法在游戏消息中设置指定用户的分数。成功时,如果消息不是内联消息,则返回 Message,否则返回 True。如果新分数不高于用户在聊天中的当前分数且 force 为 False,则返回错误。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
user_id 用户 ID | Integer 整数 | Yes 是 | User identifier 用户标识符 |
score 得分 | Integer 整数 | Yes 是 | New score, must be non-negative 新得分,必须为非负数 |
force 强制 | Boolean 布尔值 | Optional 可选 | Pass True if the high score is allowed to decrease. This can be useful when fixing mistakes or banning cheaters 如果允许高分降低,请传递 True。这在修正错误或禁止作弊者时可能有用 |
disable_edit_message 禁用编辑消息 | Boolean 布尔值 | Optional 可选 | Pass True if the game message should not be automatically edited to include the current scoreboard 如果游戏消息不应自动编辑以包含当前计分板,请传递 True |
chat_id | Integer 整数 | Optional 可选 | Required if inline_message_id is not specified. Unique identifier for the target chat 如果未指定 inline_message_id,则为必填项。目标聊天的唯一标识符 |
message_id 消息 ID | Integer 整数 | Optional 可选 | Required if inline_message_id is not specified. Identifier of the sent message 如果未指定 inline_message_id,则为必填项。发送消息的标识符 |
inline_message_id | String 字符串 | Optional 可选 | Required if chat_id and message_id are not specified. Identifier of the inline message 如果未指定 chat_id 和 message_id,则为必填。内联消息的标识符 |
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 GameHighScore objects.
使用此方法获取高分表的数据。将返回指定用户及其在游戏中的几个邻居的分数。返回一个 GameHighScore 对象的数组。
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.
此方法当前将返回目标用户的分数,以及他们两侧的两个最近邻居的分数。如果用户及其邻居不在其中,还将返回前三名用户。请注意,此行为可能会发生变化。
Parameter 参数 | Type 类型 | Required 必需 | Description 描述 |
---|---|---|---|
user_id 用户 ID | Integer 整数 | Yes 是 | Target user id 目标用户 ID |
chat_id | Integer 整数 | Optional 可选 | Required if inline_message_id is not specified. Unique identifier for the target chat 如果未指定 inline_message_id,则为必填项。目标聊天的唯一标识符 |
message_id 消息 ID | Integer 整数 | Optional 可选 | Required if inline_message_id is not specified. Identifier of the sent message 如果未指定 inline_message_id,则为必填项。发送消息的标识符 |
inline_message_id | String 字符串 | Optional 可选 | Required if chat_id and message_id are not specified. Identifier of the inline message 如果未指定 chat_id 和 message_id,则为必填。内联消息的标识符 |
This object represents one row of the high scores table for a game.
此对象代表游戏高分表中的一行。
Field 字段 | Type 类型 | Description 描述 |
---|---|---|
position 位置 | Integer 整数 | Position in high score table for the game 在游戏高分表中的位置 |
user 用户 | User 用户 | User 用户 |
score 得分 | Integer 整数 | Score 得分 |
And that's about all we've got for now.
这就是我们目前所有的内容。
If you've got any questions, please check out our Bot FAQ »
如果您有任何问题,请查看我们的机器人常见问题解答 »