tgbot 0.1.6 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8ba7a27e6845d91681d1fb251a04e9195792d7cba8a58cceea0c345aeaab8fe3
4
- data.tar.gz: 0b8e831e0dfea4b7fe742a7d6b59c3f839ec5426137dfd6eb3b8dbdb2710a8c6
3
+ metadata.gz: cf4ab9149a9e27a41a11eacb21b9b08eaa00fb2f884b902c06ee68396294d8de
4
+ data.tar.gz: e5420104ac13c3c4b9fe1b2a039dac94e2c8d51e4ccabafd5b2559bdc8e152d3
5
5
  SHA512:
6
- metadata.gz: caeec2d1455dc24f6ef15b47d7b3d5905904f4f783d354e919659fae7801a8494639b28ef7e76707ff98f806e6c755e555051793c234a98a2c35e10c80f722fc
7
- data.tar.gz: 538187bc4886a3687bc09fca04692bef2ae0d3e3fe40f0ee15d9756be713e02213b57fd006a0d6f007b842eea425bf2ceef182a88d4d7a1f711a6ad2528fca1d
6
+ metadata.gz: 7669c75cbbb5fd28d6d119684e19293d932795d2a0dfdd4708096c84f6044643c5bb01c5162e613a41766f65661887737d1b7224776df39db3f18113a95759f1
7
+ data.tar.gz: ea4e38aec3f4af273967f019e5fc04b235d0972f5217423f252d026f36ba39ca8e4fa9b4a8bd78d545dea1b924a965a5a1464d03a705524effc40813ad31f3d6
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2017 hyrious
3
+ Copyright (c) 2019 hyrious
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Tgbot
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/tgbot.svg)](https://badge.fury.io/rb/tgbot)
4
- ![Bot API Version](https://img.shields.io/badge/Bot%20API-3.5-blue.svg?style=flat-square)
4
+ ![Bot API Version](https://img.shields.io/badge/Bot%20API-4.1-blue.svg?style=flat-square)
5
5
  ![](https://img.shields.io/badge/License-MIT-lightgrey.svg?style=flat-square)
6
6
 
7
7
  A tiny but easy-to-use wrapper of [Telegram Bot API](https://core.telegram.org/bots/api).
@@ -12,9 +12,114 @@ A tiny but easy-to-use wrapper of [Telegram Bot API](https://core.telegram.org/b
12
12
 
13
13
  ## Usage
14
14
 
15
- See [example.rb](example.rb) or [usage.md](usage.md).
15
+ ```ruby
16
+ Tgbot.run TOKEN, proxy: 'http://127.0.0.1:1080' do
17
+ on 'start' do
18
+ reply '#{name}, at your service.'
19
+ end
20
+ end
21
+ # or
22
+ bot = Tgbot.new TOKEN, proxy: 'http://127.0.0.1:1080'
23
+ bot.on('start'){ reply '#{name}, at your service.' }
24
+ bot.run # will block current thread
25
+ ```
16
26
 
17
- **Ideas wanted.**
27
+ ### `Tgbot.run token, **options do (block) end`
28
+
29
+ Start a long polling bot.
30
+
31
+ | argument | type | notes | example |
32
+ |----------|------|-------|---------|
33
+ | token | `String` | [ask BotFather for one](https://core.telegram.org/bots#generating-an-authorization-token) | `'123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11'` |
34
+
35
+ | option | type | notes | example |
36
+ |--------|------|-------|---------|
37
+ | proxy | `String` | http only | `'127.0.0.1:1080'` |
38
+
39
+ and in that `(block)`:
40
+
41
+ ### method_missing
42
+
43
+ Just call the native bot api. e.g. `getMe()` `send_message(chat_id: 123, text: 'hello')`.
44
+
45
+ Returns an OpenStruct of the replied object.
46
+
47
+ ### `self.debug = true | false (default)`
48
+
49
+ Show debug info (every message, matched command).
50
+
51
+ ### `start do (do sth when it is connected) end`
52
+
53
+ ```ruby
54
+ start do
55
+ puts "\e[33m#{get_me&.first_name}\e[32m, at your service."
56
+ end
57
+ ```
58
+
59
+ ### `finish do (do sth when Ctrl-C) end`
60
+
61
+
62
+ ```ruby
63
+ finish do
64
+ puts "おやすみなさい"
65
+ end
66
+ ```
67
+
68
+ ### `on pattern=nil, **options do |match_data, update, task| (block) end`
69
+
70
+ Match pattern and do something.
71
+
72
+ | argument | type | notes | example |
73
+ |----------|------|-------|---------|
74
+ | pattern | `nil` | match all (including inline query etc.) | `on do ... end` |
75
+ | - | `String` \| `Regexp` | match all text<sup>1</sup> | `/^r(\d*)d(\d*)(?:\+(\d*))?/` |
76
+
77
+ <sup>1</sup>: for convenience, the bot's `@username` is trimmed for easilier matching.
78
+
79
+ e.g. `"hey bot, /r3d6@mybot+1 lol" => #<MatchData "/r3d6+1" 1:"3" 2:"6" 3:"1">`.
80
+
81
+ | option | type | notes | example |
82
+ |--------|------|-------|---------|
83
+ | name | `String` | just give it a name | `'roll!'` |
84
+ | before_all | `true` | set to run before other `on`s matching the same message | `true` |
85
+ | after_all | `true` | set to run after other `on`s matching the same message<sup>3</sup><br>you can't set both `before_all` and `after_all` on one command | `true` |
86
+
87
+ <sup>3</sup>: order is `* -> before2 -> before1 -> other -> after1 -> after2 -> *`.
88
+
89
+ and in that `(block)`:
90
+
91
+ ### `debug message`
92
+
93
+ Puts that message to STDERR when it is in debug mode.
94
+
95
+ ### `reply *things, **options`
96
+
97
+ Reply to the matched message.
98
+
99
+ | argument | type | notes | example |
100
+ |----------|------|-------|---------|
101
+ | thing | `String` \| can `.to_s` | will use `parse_mode: Markdown` | `'hello world'` |
102
+ | - | `IO` | will use `sendPhoto` if it is a photo, etc. | `File.new("a.png")` |
103
+
104
+ | option | type | notes | example |
105
+ |--------|------|-------|---------|
106
+ | media | `false` | set to `false` to force `sendDocument` | `'127.0.0.1:1080'` |
107
+ | style | `:none` \| `:at` \| `nil` (default) | reply style<sup>2</sup> | `:at` |
108
+ | parse_mode, etc. | depends | see [sendMessage](https://core.telegram.org/bots/api#sendmessage) | - |
109
+
110
+ reply style<sup>2</sup>:
111
+
112
+ - `:none` : don't add reply info, so the sender won't receive a prompting.
113
+ - `:at`: use `[inline mention of a user](tg://user?id=123456789)` in replied message.
114
+ - `nil` (default): include `reply_to_message_id` in replied message object.
115
+
116
+ ### `interrupt!` `done!`
117
+
118
+ Stop processing this message (if there be further blocks matching it). see `before_all` `after_all`.
119
+
120
+ ### `retry! n=1`
121
+
122
+ Enqueue this message again for at most `n` times.
18
123
 
19
124
  ## Contribute
20
125
 
data/Rakefile CHANGED
@@ -1,10 +1 @@
1
1
  require "bundler/gem_tasks"
2
-
3
- desc 'Make lib/*.json'
4
- task :json do
5
- cd 'tools'
6
- ruby 'gen_types_json.rb'
7
- cp 'types.json', '../lib'
8
- ruby 'gen_methods_json.rb'
9
- cp 'methods.json', '../lib'
10
- end
@@ -0,0 +1,4052 @@
1
+ ---
2
+ name: Telegram Bot API
3
+ children:
4
+ - name: Recent changes
5
+ children:
6
+ - name: August 27, 2018
7
+ children: []
8
+ desc:
9
+ - name: p
10
+ content: Bot API 4.1
11
+ - name: ul
12
+ content:
13
+ - Added support for translated versions of documents in Telegram Passport. New field translation in EncryptedPassportElement.
14
+ - 'New errors: PassportElementErrorTranslationFile and PassportElementErrorTranslationFiles, PassportElementErrorUnspecified.'
15
+ - name: July 26, 2018
16
+ children: []
17
+ desc:
18
+ - name: p
19
+ content: Bot API 4.0.
20
+ - name: ul
21
+ content:
22
+ - Added support for Telegram Passport. See the official announcement on the blog and the manual for details.
23
+ - 'Added support for editing the media content of messages: added the method editMessageMedia and new types InputMediaAnimation, InputMediaAudio, and InputMediaDocument.'
24
+ - Added the field thumb to the Audio object to contain the thumbnail of the album cover to which the music file belongs.
25
+ - Added support for attaching custom thumbnails to uploaded files. For animations, audios, videos and video notes, which are less than 10 MB in size, thumbnails are generated automatically.
26
+ - tg:// URLs now can be used in inline keyboard url buttons and text_link message entities.
27
+ - Added the method sendAnimation, which can be used instead of sendDocument to send animations, specifying their duration, width and height.
28
+ - Added the field animation to the Message object. For backward compatibility, when this field is set, the document field will be also set.
29
+ - 'Added two new MessageEntity types: cashtag and phone_number.'
30
+ - 'Added support for Foursquare venues: added the new field foursquare_type to the objects Venue, InlineQueryResultVenue and InputVenueMessageContent, and the parameter foursquare_type to the sendVenue method.'
31
+ - You can now create inline mentions of users, who have pressed your bot's callback buttons.
32
+ - You can now use the Retry-After response header to configure the delay after which the Bot API will retry the request after an unsuccessful response from a webhook.
33
+ - If a webhook returns the HTTP error 410 Gone for all requests for more than 23 hours successively, it can be automatically removed.
34
+ - 'Added vCard support when sharing contacts: added the field vcard to the objects Contact, InlineQueryResultContact, InputContactMessageContent and the method sendContact.'
35
+ - name: p
36
+ content: See earlier changes »
37
+ - name: Authorizing your bot
38
+ children: []
39
+ desc:
40
+ - name: p
41
+ content: 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.
42
+ - name: Making requests
43
+ children:
44
+ - name: Making requests when getting updates
45
+ children: []
46
+ desc:
47
+ - name: p
48
+ content: 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.
49
+ - name: blockquote
50
+ content: Please see our FAQ for examples.
51
+ desc:
52
+ - name: p
53
+ content: '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:'
54
+ - name: pre
55
+ content: https://api.telegram.org/bot123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11/getMe
56
+ - name: p
57
+ content: 'We support GET and POST HTTP methods. We support four ways of passing parameters in Bot API requests:'
58
+ - name: ul
59
+ content:
60
+ - URL query string
61
+ - application/x-www-form-urlencoded
62
+ - application/json (except for uploading files)
63
+ - multipart/form-data (use to upload files)
64
+ - name: p
65
+ content: 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.
66
+ - name: ul
67
+ content:
68
+ - All methods in the Bot API are case-insensitive.
69
+ - All queries must be made using UTF-8.
70
+ - name: Getting updates
71
+ children:
72
+ - name: Update
73
+ children: []
74
+ desc:
75
+ - name: p
76
+ content: This object represents an incoming update.At most one of the optional parameters can be present in any given update.
77
+ table:
78
+ - Field: update_id
79
+ Type: Integer
80
+ Description: The update‘s unique identifier. Update identifiers start from a certain positive number and increase sequentially. This ID becomes especially handy if you’re using 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.
81
+ - Field: message
82
+ Type: Message
83
+ Description: Optional. New incoming message of any kind — text, photo, sticker, etc.
84
+ - Field: edited_message
85
+ Type: Message
86
+ Description: Optional. New version of a message that is known to the bot and was edited
87
+ - Field: channel_post
88
+ Type: Message
89
+ Description: Optional. New incoming channel post of any kind — text, photo, sticker, etc.
90
+ - Field: edited_channel_post
91
+ Type: Message
92
+ Description: Optional. New version of a channel post that is known to the bot and was edited
93
+ - Field: inline_query
94
+ Type: InlineQuery
95
+ Description: Optional. New incoming inline query
96
+ - Field: chosen_inline_result
97
+ Type: ChosenInlineResult
98
+ Description: 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.
99
+ - Field: callback_query
100
+ Type: CallbackQuery
101
+ Description: Optional. New incoming callback query
102
+ - Field: shipping_query
103
+ Type: ShippingQuery
104
+ Description: Optional. New incoming shipping query. Only for invoices with flexible price
105
+ - Field: pre_checkout_query
106
+ Type: PreCheckoutQuery
107
+ Description: Optional. New incoming pre-checkout query. Contains full information about checkout
108
+ - name: getUpdates
109
+ children: []
110
+ desc:
111
+ - name: p
112
+ content: Use this method to receive incoming updates using long polling (wiki). An Array of Update objects is returned.
113
+ - name: blockquote
114
+ content: Notes1. This method will not work if an outgoing webhook is set up.2. In order to avoid getting duplicate updates, recalculate offset after each server response.
115
+ table:
116
+ - Parameter: offset
117
+ Type: Integer
118
+ Required: Optional
119
+ Description: 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 forgotten.
120
+ - Parameter: limit
121
+ Type: Integer
122
+ Required: Optional
123
+ Description: Limits the number of updates to be retrieved. Values between 1—100 are accepted. Defaults to 100.
124
+ - Parameter: timeout
125
+ Type: Integer
126
+ Required: Optional
127
+ Description: 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.
128
+ - Parameter: allowed_updates
129
+ Type: Array of String
130
+ Required: Optional
131
+ Description: List the types of updates 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 updates regardless of type (default). If not specified, the previous setting will be used.Please note that this parameter doesn't affect updates created before the call to the getUpdates, so unwanted updates may be received for a short period of time.
132
+ - name: setWebhook
133
+ children: []
134
+ desc:
135
+ - name: p
136
+ content: 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, we will give up after a reasonable amount of attempts. Returns True on success.
137
+ - name: p
138
+ content: If you'd like to make sure that the Webhook request comes from Telegram, we recommend using a secret path in the URL, e.g. https://www.example.com/<token>. Since nobody else knows your bot‘s token, you can be pretty sure it’s us.
139
+ - name: blockquote
140
+ content: |-
141
+ Notes1. You will not be able to receive updates using getUpdates for as long as an outgoing webhook is set up.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.3. Ports currently supported for Webhooks: 443, 80, 88, 8443.
142
+ NEW! If you're having any trouble setting up webhooks, please check out this amazing guide to Webhooks.
143
+ table:
144
+ - Parameter: url
145
+ Type: String
146
+ Required: 'Yes'
147
+ Description: HTTPS url to send updates to. Use an empty string to remove webhook integration
148
+ - Parameter: certificate
149
+ Type: InputFile
150
+ Required: Optional
151
+ Description: Upload your public key certificate so that the root certificate in use can be checked. See our self-signed guide for details.
152
+ - Parameter: max_connections
153
+ Type: Integer
154
+ Required: Optional
155
+ Description: 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.
156
+ - Parameter: allowed_updates
157
+ Type: Array of String
158
+ Required: Optional
159
+ Description: List the types of updates 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 updates regardless of type (default). If not specified, the previous setting will be used.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.
160
+ - name: deleteWebhook
161
+ children: []
162
+ desc:
163
+ - name: p
164
+ content: Use this method to remove webhook integration if you decide to switch back to getUpdates. Returns True on success. Requires no parameters.
165
+ - name: getWebhookInfo
166
+ children: []
167
+ desc:
168
+ - name: p
169
+ content: 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.
170
+ - name: WebhookInfo
171
+ children: []
172
+ desc:
173
+ - name: p
174
+ content: Contains information about the current status of a webhook.
175
+ table:
176
+ - Field: url
177
+ Type: String
178
+ Description: Webhook URL, may be empty if webhook is not set up
179
+ - Field: has_custom_certificate
180
+ Type: Boolean
181
+ Description: True, if a custom certificate was provided for webhook certificate checks
182
+ - Field: pending_update_count
183
+ Type: Integer
184
+ Description: Number of updates awaiting delivery
185
+ - Field: last_error_date
186
+ Type: Integer
187
+ Description: Optional. Unix time for the most recent error that happened when trying to deliver an update via webhook
188
+ - Field: last_error_message
189
+ Type: String
190
+ Description: Optional. Error message in human-readable format for the most recent error that happened when trying to deliver an update via webhook
191
+ - Field: max_connections
192
+ Type: Integer
193
+ Description: Optional. Maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery
194
+ - Field: allowed_updates
195
+ Type: Array of String
196
+ Description: Optional. A list of update types the bot is subscribed to. Defaults to all update types
197
+ desc:
198
+ - name: p
199
+ content: 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.
200
+ - name: p
201
+ content: Regardless of which option you choose, you will receive JSON-serialized Update objects as a result.
202
+ - name: Available types
203
+ children:
204
+ - name: User
205
+ children: []
206
+ desc:
207
+ - name: p
208
+ content: This object represents a Telegram user or bot.
209
+ table:
210
+ - Field: id
211
+ Type: Integer
212
+ Description: Unique identifier for this user or bot
213
+ - Field: is_bot
214
+ Type: Boolean
215
+ Description: True, if this user is a bot
216
+ - Field: first_name
217
+ Type: String
218
+ Description: User‘s or bot’s first name
219
+ - Field: last_name
220
+ Type: String
221
+ Description: Optional. User‘s or bot’s last name
222
+ - Field: username
223
+ Type: String
224
+ Description: Optional. User‘s or bot’s username
225
+ - Field: language_code
226
+ Type: String
227
+ Description: Optional. IETF language tag of the user's language
228
+ - name: Chat
229
+ children: []
230
+ desc:
231
+ - name: p
232
+ content: This object represents a chat.
233
+ table:
234
+ - Field: id
235
+ Type: Integer
236
+ Description: Unique identifier for this chat. This number 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.
237
+ - Field: type
238
+ Type: String
239
+ Description: Type of chat, can be either “private”, “group”, “supergroup” or “channel”
240
+ - Field: title
241
+ Type: String
242
+ Description: Optional. Title, for supergroups, channels and group chats
243
+ - Field: username
244
+ Type: String
245
+ Description: Optional. Username, for private chats, supergroups and channels if available
246
+ - Field: first_name
247
+ Type: String
248
+ Description: Optional. First name of the other party in a private chat
249
+ - Field: last_name
250
+ Type: String
251
+ Description: Optional. Last name of the other party in a private chat
252
+ - Field: all_members_are_administrators
253
+ Type: Boolean
254
+ Description: Optional. True if a group has ‘All Members Are Admins’ enabled.
255
+ - Field: photo
256
+ Type: ChatPhoto
257
+ Description: Optional. Chat photo. Returned only in getChat.
258
+ - Field: description
259
+ Type: String
260
+ Description: Optional. Description, for supergroups and channel chats. Returned only in getChat.
261
+ - Field: invite_link
262
+ Type: String
263
+ Description: Optional. Chat invite link, for supergroups and channel chats. Each administrator in a chat generates their own invite links, so the bot must first generate the link using exportChatInviteLink. Returned only in getChat.
264
+ - Field: pinned_message
265
+ Type: Message
266
+ Description: Optional. Pinned message, for supergroups and channel chats. Returned only in getChat.
267
+ - Field: sticker_set_name
268
+ Type: String
269
+ Description: Optional. For supergroups, name of group sticker set. Returned only in getChat.
270
+ - Field: can_set_sticker_set
271
+ Type: Boolean
272
+ Description: Optional. True, if the bot can change the group sticker set. Returned only in getChat.
273
+ - name: Message
274
+ children: []
275
+ desc:
276
+ - name: p
277
+ content: This object represents a message.
278
+ table:
279
+ - Field: message_id
280
+ Type: Integer
281
+ Description: Unique message identifier inside this chat
282
+ - Field: from
283
+ Type: User
284
+ Description: Optional. Sender, empty for messages sent to channels
285
+ - Field: date
286
+ Type: Integer
287
+ Description: Date the message was sent in Unix time
288
+ - Field: chat
289
+ Type: Chat
290
+ Description: Conversation the message belongs to
291
+ - Field: forward_from
292
+ Type: User
293
+ Description: Optional. For forwarded messages, sender of the original message
294
+ - Field: forward_from_chat
295
+ Type: Chat
296
+ Description: Optional. For messages forwarded from channels, information about the original channel
297
+ - Field: forward_from_message_id
298
+ Type: Integer
299
+ Description: Optional. For messages forwarded from channels, identifier of the original message in the channel
300
+ - Field: forward_signature
301
+ Type: String
302
+ Description: Optional. For messages forwarded from channels, signature of the post author if present
303
+ - Field: forward_date
304
+ Type: Integer
305
+ Description: Optional. For forwarded messages, date the original message was sent in Unix time
306
+ - Field: reply_to_message
307
+ Type: Message
308
+ Description: Optional. For replies, 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.
309
+ - Field: edit_date
310
+ Type: Integer
311
+ Description: Optional. Date the message was last edited in Unix time
312
+ - Field: media_group_id
313
+ Type: String
314
+ Description: Optional. The unique identifier of a media message group this message belongs to
315
+ - Field: author_signature
316
+ Type: String
317
+ Description: Optional. Signature of the post author for messages in channels
318
+ - Field: text
319
+ Type: String
320
+ Description: Optional. For text messages, the actual UTF-8 text of the message, 0-4096 characters.
321
+ - Field: entities
322
+ Type: Array of MessageEntity
323
+ Description: Optional. For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text
324
+ - Field: caption_entities
325
+ Type: Array of MessageEntity
326
+ Description: Optional. For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption
327
+ - Field: audio
328
+ Type: Audio
329
+ Description: Optional. Message is an audio file, information about the file
330
+ - Field: document
331
+ Type: Document
332
+ Description: Optional. Message is a general file, information about the file
333
+ - Field: animation
334
+ Type: Animation
335
+ Description: Optional. Message is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set
336
+ - Field: game
337
+ Type: Game
338
+ Description: Optional. Message is a game, information about the game. More about games »
339
+ - Field: photo
340
+ Type: Array of PhotoSize
341
+ Description: Optional. Message is a photo, available sizes of the photo
342
+ - Field: sticker
343
+ Type: Sticker
344
+ Description: Optional. Message is a sticker, information about the sticker
345
+ - Field: video
346
+ Type: Video
347
+ Description: Optional. Message is a video, information about the video
348
+ - Field: voice
349
+ Type: Voice
350
+ Description: Optional. Message is a voice message, information about the file
351
+ - Field: video_note
352
+ Type: VideoNote
353
+ Description: Optional. Message is a video note, information about the video message
354
+ - Field: caption
355
+ Type: String
356
+ Description: Optional. Caption for the animation, audio, document, photo, video or voice, 0-1024 characters
357
+ - Field: contact
358
+ Type: Contact
359
+ Description: Optional. Message is a shared contact, information about the contact
360
+ - Field: location
361
+ Type: Location
362
+ Description: Optional. Message is a shared location, information about the location
363
+ - Field: venue
364
+ Type: Venue
365
+ Description: Optional. Message is a venue, information about the venue
366
+ - Field: new_chat_members
367
+ Type: Array of User
368
+ Description: Optional. New members that were added to the group or supergroup and information about them (the bot itself may be one of these members)
369
+ - Field: left_chat_member
370
+ Type: User
371
+ Description: Optional. A member was removed from the group, information about them (this member may be the bot itself)
372
+ - Field: new_chat_title
373
+ Type: String
374
+ Description: Optional. A chat title was changed to this value
375
+ - Field: new_chat_photo
376
+ Type: Array of PhotoSize
377
+ Description: Optional. A chat photo was change to this value
378
+ - Field: delete_chat_photo
379
+ Type: 'True'
380
+ Description: 'Optional. Service message: the chat photo was deleted'
381
+ - Field: group_chat_created
382
+ Type: 'True'
383
+ Description: 'Optional. Service message: the group has been created'
384
+ - Field: supergroup_chat_created
385
+ Type: 'True'
386
+ Description: '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.'
387
+ - Field: channel_chat_created
388
+ Type: 'True'
389
+ Description: '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.'
390
+ - Field: migrate_to_chat_id
391
+ Type: Integer
392
+ Description: Optional. The group has been migrated to a supergroup with the specified identifier. This number 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.
393
+ - Field: migrate_from_chat_id
394
+ Type: Integer
395
+ Description: Optional. The supergroup has been migrated from a group with the specified identifier. This number 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.
396
+ - Field: pinned_message
397
+ Type: Message
398
+ Description: Optional. Specified message was pinned. Note that the Message object in this field will not contain further reply_to_message fields even if it is itself a reply.
399
+ - Field: invoice
400
+ Type: Invoice
401
+ Description: Optional. Message is an invoice for a payment, information about the invoice. More about payments »
402
+ - Field: successful_payment
403
+ Type: SuccessfulPayment
404
+ Description: Optional. Message is a service message about a successful payment, information about the payment. More about payments »
405
+ - Field: connected_website
406
+ Type: String
407
+ Description: Optional. The domain name of the website on which the user has logged in. More about Telegram Login »
408
+ - Field: passport_data
409
+ Type: PassportData
410
+ Description: Optional. Telegram Passport data
411
+ - name: MessageEntity
412
+ children: []
413
+ desc:
414
+ - name: p
415
+ content: This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc.
416
+ table:
417
+ - Field: type
418
+ Type: String
419
+ Description: Type of the entity. Can be mention (@username), hashtag, cashtag, bot_command, url, email, phone_number, bold (bold text), italic (italic text), code (monowidth string), pre (monowidth block), text_link (for clickable text URLs), text_mention (for users without usernames)
420
+ - Field: offset
421
+ Type: Integer
422
+ Description: Offset in UTF-16 code units to the start of the entity
423
+ - Field: length
424
+ Type: Integer
425
+ Description: Length of the entity in UTF-16 code units
426
+ - Field: url
427
+ Type: String
428
+ Description: Optional. For “text_link” only, url that will be opened after user taps on the text
429
+ - Field: user
430
+ Type: User
431
+ Description: Optional. For “text_mention” only, the mentioned user
432
+ - name: PhotoSize
433
+ children: []
434
+ desc:
435
+ - name: p
436
+ content: This object represents one size of a photo or a file / sticker thumbnail.
437
+ table:
438
+ - Field: file_id
439
+ Type: String
440
+ Description: Unique identifier for this file
441
+ - Field: width
442
+ Type: Integer
443
+ Description: Photo width
444
+ - Field: height
445
+ Type: Integer
446
+ Description: Photo height
447
+ - Field: file_size
448
+ Type: Integer
449
+ Description: Optional. File size
450
+ - name: Audio
451
+ children: []
452
+ desc:
453
+ - name: p
454
+ content: This object represents an audio file to be treated as music by the Telegram clients.
455
+ table:
456
+ - Field: file_id
457
+ Type: String
458
+ Description: Unique identifier for this file
459
+ - Field: duration
460
+ Type: Integer
461
+ Description: Duration of the audio in seconds as defined by sender
462
+ - Field: performer
463
+ Type: String
464
+ Description: Optional. Performer of the audio as defined by sender or by audio tags
465
+ - Field: title
466
+ Type: String
467
+ Description: Optional. Title of the audio as defined by sender or by audio tags
468
+ - Field: mime_type
469
+ Type: String
470
+ Description: Optional. MIME type of the file as defined by sender
471
+ - Field: file_size
472
+ Type: Integer
473
+ Description: Optional. File size
474
+ - Field: thumb
475
+ Type: PhotoSize
476
+ Description: Optional. Thumbnail of the album cover to which the music file belongs
477
+ - name: Document
478
+ children: []
479
+ desc:
480
+ - name: p
481
+ content: This object represents a general file (as opposed to photos, voice messages and audio files).
482
+ table:
483
+ - Field: file_id
484
+ Type: String
485
+ Description: Unique file identifier
486
+ - Field: thumb
487
+ Type: PhotoSize
488
+ Description: Optional. Document thumbnail as defined by sender
489
+ - Field: file_name
490
+ Type: String
491
+ Description: Optional. Original filename as defined by sender
492
+ - Field: mime_type
493
+ Type: String
494
+ Description: Optional. MIME type of the file as defined by sender
495
+ - Field: file_size
496
+ Type: Integer
497
+ Description: Optional. File size
498
+ - name: Video
499
+ children: []
500
+ desc:
501
+ - name: p
502
+ content: This object represents a video file.
503
+ table:
504
+ - Field: file_id
505
+ Type: String
506
+ Description: Unique identifier for this file
507
+ - Field: width
508
+ Type: Integer
509
+ Description: Video width as defined by sender
510
+ - Field: height
511
+ Type: Integer
512
+ Description: Video height as defined by sender
513
+ - Field: duration
514
+ Type: Integer
515
+ Description: Duration of the video in seconds as defined by sender
516
+ - Field: thumb
517
+ Type: PhotoSize
518
+ Description: Optional. Video thumbnail
519
+ - Field: mime_type
520
+ Type: String
521
+ Description: Optional. Mime type of a file as defined by sender
522
+ - Field: file_size
523
+ Type: Integer
524
+ Description: Optional. File size
525
+ - name: Animation
526
+ children: []
527
+ desc:
528
+ - name: p
529
+ content: This object represents an animation file (GIF or H.264/MPEG-4 AVC video without sound).
530
+ table:
531
+ - Field: file_id
532
+ Type: String
533
+ Description: Unique file identifier
534
+ - Field: width
535
+ Type: Integer
536
+ Description: Video width as defined by sender
537
+ - Field: height
538
+ Type: Integer
539
+ Description: Video height as defined by sender
540
+ - Field: duration
541
+ Type: Integer
542
+ Description: Duration of the video in seconds as defined by sender
543
+ - Field: thumb
544
+ Type: PhotoSize
545
+ Description: Optional. Animation thumbnail as defined by sender
546
+ - Field: file_name
547
+ Type: String
548
+ Description: Optional. Original animation filename as defined by sender
549
+ - Field: mime_type
550
+ Type: String
551
+ Description: Optional. MIME type of the file as defined by sender
552
+ - Field: file_size
553
+ Type: Integer
554
+ Description: Optional. File size
555
+ - name: Voice
556
+ children: []
557
+ desc:
558
+ - name: p
559
+ content: This object represents a voice note.
560
+ table:
561
+ - Field: file_id
562
+ Type: String
563
+ Description: Unique identifier for this file
564
+ - Field: duration
565
+ Type: Integer
566
+ Description: Duration of the audio in seconds as defined by sender
567
+ - Field: mime_type
568
+ Type: String
569
+ Description: Optional. MIME type of the file as defined by sender
570
+ - Field: file_size
571
+ Type: Integer
572
+ Description: Optional. File size
573
+ - name: VideoNote
574
+ children: []
575
+ desc:
576
+ - name: p
577
+ content: This object represents a video message (available in Telegram apps as of v.4.0).
578
+ table:
579
+ - Field: file_id
580
+ Type: String
581
+ Description: Unique identifier for this file
582
+ - Field: length
583
+ Type: Integer
584
+ Description: Video width and height (diameter of the video message) as defined by sender
585
+ - Field: duration
586
+ Type: Integer
587
+ Description: Duration of the video in seconds as defined by sender
588
+ - Field: thumb
589
+ Type: PhotoSize
590
+ Description: Optional. Video thumbnail
591
+ - Field: file_size
592
+ Type: Integer
593
+ Description: Optional. File size
594
+ - name: Contact
595
+ children: []
596
+ desc:
597
+ - name: p
598
+ content: This object represents a phone contact.
599
+ table:
600
+ - Field: phone_number
601
+ Type: String
602
+ Description: Contact's phone number
603
+ - Field: first_name
604
+ Type: String
605
+ Description: Contact's first name
606
+ - Field: last_name
607
+ Type: String
608
+ Description: Optional. Contact's last name
609
+ - Field: user_id
610
+ Type: Integer
611
+ Description: Optional. Contact's user identifier in Telegram
612
+ - Field: vcard
613
+ Type: String
614
+ Description: Optional. Additional data about the contact in the form of a vCard
615
+ - name: Location
616
+ children: []
617
+ desc:
618
+ - name: p
619
+ content: This object represents a point on the map.
620
+ table:
621
+ - Field: longitude
622
+ Type: Float
623
+ Description: Longitude as defined by sender
624
+ - Field: latitude
625
+ Type: Float
626
+ Description: Latitude as defined by sender
627
+ - name: Venue
628
+ children: []
629
+ desc:
630
+ - name: p
631
+ content: This object represents a venue.
632
+ table:
633
+ - Field: location
634
+ Type: Location
635
+ Description: Venue location
636
+ - Field: title
637
+ Type: String
638
+ Description: Name of the venue
639
+ - Field: address
640
+ Type: String
641
+ Description: Address of the venue
642
+ - Field: foursquare_id
643
+ Type: String
644
+ Description: Optional. Foursquare identifier of the venue
645
+ - Field: foursquare_type
646
+ Type: String
647
+ Description: Optional. Foursquare type of the venue. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.)
648
+ - name: UserProfilePhotos
649
+ children: []
650
+ desc:
651
+ - name: p
652
+ content: This object represent a user's profile pictures.
653
+ table:
654
+ - Field: total_count
655
+ Type: Integer
656
+ Description: Total number of profile pictures the target user has
657
+ - Field: photos
658
+ Type: Array of Array of PhotoSize
659
+ Description: Requested profile pictures (in up to 4 sizes each)
660
+ - name: File
661
+ children: []
662
+ desc:
663
+ - name: p
664
+ content: 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.
665
+ - name: blockquote
666
+ content: Maximum file size to download is 20 MB
667
+ table:
668
+ - Field: file_id
669
+ Type: String
670
+ Description: Unique identifier for this file
671
+ - Field: file_size
672
+ Type: Integer
673
+ Description: Optional. File size, if known
674
+ - Field: file_path
675
+ Type: String
676
+ Description: Optional. File path. Use https://api.telegram.org/file/bot<token>/<file_path> to get the file.
677
+ - name: ReplyKeyboardMarkup
678
+ children: []
679
+ desc:
680
+ - name: p
681
+ content: This object represents a custom keyboard with reply options (see Introduction to bots for details and examples).
682
+ table:
683
+ - Field: keyboard
684
+ Type: Array of Array of KeyboardButton
685
+ Description: Array of button rows, each represented by an Array of KeyboardButton objects
686
+ - Field: resize_keyboard
687
+ Type: Boolean
688
+ Description: 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.
689
+ - Field: one_time_keyboard
690
+ Type: Boolean
691
+ Description: 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.
692
+ - Field: selective
693
+ Type: Boolean
694
+ Description: '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 (has reply_to_message_id), sender of the original message.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.'
695
+ - name: KeyboardButton
696
+ children: []
697
+ desc:
698
+ - name: p
699
+ content: This object represents one button of the reply keyboard. For simple text buttons String can be used instead of this object to specify text of the button. Optional fields are mutually exclusive.
700
+ - name: p
701
+ content: 'Note: request_contact and request_location options will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.'
702
+ table:
703
+ - Field: text
704
+ Type: String
705
+ Description: Text of the button. If none of the optional fields are used, it will be sent as a message when the button is pressed
706
+ - Field: request_contact
707
+ Type: Boolean
708
+ Description: Optional. If True, the user's phone number will be sent as a contact when the button is pressed. Available in private chats only
709
+ - Field: request_location
710
+ Type: Boolean
711
+ Description: Optional. If True, the user's current location will be sent when the button is pressed. Available in private chats only
712
+ - name: ReplyKeyboardRemove
713
+ children: []
714
+ desc:
715
+ - name: p
716
+ content: 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).
717
+ table:
718
+ - Field: remove_keyboard
719
+ Type: 'True'
720
+ Description: 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)
721
+ - Field: selective
722
+ Type: Boolean
723
+ Description: '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 (has reply_to_message_id), sender of the original message.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.'
724
+ - name: InlineKeyboardMarkup
725
+ children: []
726
+ desc:
727
+ - name: p
728
+ content: This object represents an inline keyboard that appears right next to the message it belongs to.
729
+ - name: p
730
+ content: 'Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will display unsupported message.'
731
+ table:
732
+ - Field: inline_keyboard
733
+ Type: Array of Array of InlineKeyboardButton
734
+ Description: Array of button rows, each represented by an Array of InlineKeyboardButton objects
735
+ - name: InlineKeyboardButton
736
+ children: []
737
+ desc:
738
+ - name: p
739
+ content: This object represents one button of an inline keyboard. You must use exactly one of the optional fields.
740
+ table:
741
+ - Field: text
742
+ Type: String
743
+ Description: Label text on the button
744
+ - Field: url
745
+ Type: String
746
+ Description: Optional. HTTP or tg:// url to be opened when button is pressed
747
+ - Field: callback_data
748
+ Type: String
749
+ Description: Optional. Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes
750
+ - Field: switch_inline_query
751
+ Type: String
752
+ Description: '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. Can be empty, in which case just the bot’s username will be inserted.Note: This offers an easy way for users to start using your bot in inline mode when they are currently in a private chat with it. Especially useful when combined with switch_pm… actions – in this case the user will be automatically returned to the chat they switched from, skipping the chat selection screen.'
753
+ - Field: switch_inline_query_current_chat
754
+ Type: String
755
+ Description: Optional. If set, pressing the button will insert the bot‘s username and the specified inline query in the current chat's input field. Can 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.
756
+ - Field: callback_game
757
+ Type: CallbackGame
758
+ Description: '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.'
759
+ - Field: pay
760
+ Type: Boolean
761
+ Description: 'Optional. Specify True, to send a Pay button.NOTE: This type of button must always be the first button in the first row.'
762
+ - name: CallbackQuery
763
+ children: []
764
+ desc:
765
+ - name: p
766
+ content: 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.
767
+ - name: blockquote
768
+ content: '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).'
769
+ table:
770
+ - Field: id
771
+ Type: String
772
+ Description: Unique identifier for this query
773
+ - Field: from
774
+ Type: User
775
+ Description: Sender
776
+ - Field: message
777
+ Type: Message
778
+ Description: Optional. Message with the callback button that originated the query. Note that message content and message date will not be available if the message is too old
779
+ - Field: inline_message_id
780
+ Type: String
781
+ Description: Optional. Identifier of the message sent via the bot in inline mode, that originated the query.
782
+ - Field: chat_instance
783
+ Type: String
784
+ Description: Global identifier, uniquely corresponding to the chat to which the message with the callback button was sent. Useful for high scores in games.
785
+ - Field: data
786
+ Type: String
787
+ Description: Optional. Data associated with the callback button. Be aware that a bad client can send arbitrary data in this field.
788
+ - Field: game_short_name
789
+ Type: String
790
+ Description: Optional. Short name of a Game to be returned, serves as the unique identifier for the game
791
+ - name: ForceReply
792
+ children: []
793
+ desc:
794
+ - name: p
795
+ content: 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.
796
+ - name: blockquote
797
+ content: '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:'
798
+ - name: ul
799
+ content:
800
+ - 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.
801
+ - 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’.
802
+ - name: p
803
+ content: 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.
804
+ table:
805
+ - Field: force_reply
806
+ Type: 'True'
807
+ Description: Shows reply interface to the user, as if they manually selected the bot‘s message and tapped ’Reply'
808
+ - Field: selective
809
+ Type: Boolean
810
+ Description: '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 (has reply_to_message_id), sender of the original message.'
811
+ - name: ChatPhoto
812
+ children: []
813
+ desc:
814
+ - name: p
815
+ content: This object represents a chat photo.
816
+ table:
817
+ - Field: small_file_id
818
+ Type: String
819
+ Description: Unique file identifier of small (160x160) chat photo. This file_id can be used only for photo download.
820
+ - Field: big_file_id
821
+ Type: String
822
+ Description: Unique file identifier of big (640x640) chat photo. This file_id can be used only for photo download.
823
+ - name: ChatMember
824
+ children: []
825
+ desc:
826
+ - name: p
827
+ content: This object contains information about one member of a chat.
828
+ table:
829
+ - Field: user
830
+ Type: User
831
+ Description: Information about the user
832
+ - Field: status
833
+ Type: String
834
+ Description: The member's status in the chat. Can be “creator”, “administrator”, “member”, “restricted”, “left” or “kicked”
835
+ - Field: until_date
836
+ Type: Integer
837
+ Description: Optional. Restricted and kicked only. Date when restrictions will be lifted for this user, unix time
838
+ - Field: can_be_edited
839
+ Type: Boolean
840
+ Description: Optional. Administrators only. True, if the bot is allowed to edit administrator privileges of that user
841
+ - Field: can_change_info
842
+ Type: Boolean
843
+ Description: Optional. Administrators only. True, if the administrator can change the chat title, photo and other settings
844
+ - Field: can_post_messages
845
+ Type: Boolean
846
+ Description: Optional. Administrators only. True, if the administrator can post in the channel, channels only
847
+ - Field: can_edit_messages
848
+ Type: Boolean
849
+ Description: Optional. Administrators only. True, if the administrator can edit messages of other users and can pin messages, channels only
850
+ - Field: can_delete_messages
851
+ Type: Boolean
852
+ Description: Optional. Administrators only. True, if the administrator can delete messages of other users
853
+ - Field: can_invite_users
854
+ Type: Boolean
855
+ Description: Optional. Administrators only. True, if the administrator can invite new users to the chat
856
+ - Field: can_restrict_members
857
+ Type: Boolean
858
+ Description: Optional. Administrators only. True, if the administrator can restrict, ban or unban chat members
859
+ - Field: can_pin_messages
860
+ Type: Boolean
861
+ Description: Optional. Administrators only. True, if the administrator can pin messages, supergroups only
862
+ - Field: can_promote_members
863
+ Type: Boolean
864
+ Description: Optional. Administrators only. True, if the administrator can add new administrators with a subset of his own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by the user)
865
+ - Field: can_send_messages
866
+ Type: Boolean
867
+ Description: Optional. Restricted only. True, if the user can send text messages, contacts, locations and venues
868
+ - Field: can_send_media_messages
869
+ Type: Boolean
870
+ Description: Optional. Restricted only. True, if the user can send audios, documents, photos, videos, video notes and voice notes, implies can_send_messages
871
+ - Field: can_send_other_messages
872
+ Type: Boolean
873
+ Description: Optional. Restricted only. True, if the user can send animations, games, stickers and use inline bots, implies can_send_media_messages
874
+ - Field: can_add_web_page_previews
875
+ Type: Boolean
876
+ Description: Optional. Restricted only. True, if user may add web page previews to his messages, implies can_send_media_messages
877
+ - name: ResponseParameters
878
+ children: []
879
+ desc:
880
+ - name: p
881
+ content: Contains information about why a request was unsuccessful.
882
+ table:
883
+ - Field: migrate_to_chat_id
884
+ Type: Integer
885
+ Description: Optional. The group has been migrated to a supergroup with the specified identifier. This number 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.
886
+ - Field: retry_after
887
+ Type: Integer
888
+ Description: Optional. In case of exceeding flood control, the number of seconds left to wait before the request can be repeated
889
+ - name: InputMedia
890
+ children: []
891
+ desc:
892
+ - name: p
893
+ content: This object represents the content of a media message to be sent. It should be one of
894
+ - name: ul
895
+ content:
896
+ - InputMediaAnimation
897
+ - InputMediaDocument
898
+ - InputMediaAudio
899
+ - InputMediaPhoto
900
+ - InputMediaVideo
901
+ - name: InputMediaPhoto
902
+ children: []
903
+ desc:
904
+ - name: p
905
+ content: Represents a photo to be sent.
906
+ table:
907
+ - Field: type
908
+ Type: String
909
+ Description: Type of the result, must be photo
910
+ - Field: media
911
+ Type: String
912
+ Description: 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 info on Sending Files »
913
+ - Field: caption
914
+ Type: String
915
+ Description: Optional. Caption of the photo to be sent, 0-1024 characters
916
+ - Field: parse_mode
917
+ Type: String
918
+ Description: Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
919
+ - name: InputMediaVideo
920
+ children: []
921
+ desc:
922
+ - name: p
923
+ content: Represents a video to be sent.
924
+ table:
925
+ - Field: type
926
+ Type: String
927
+ Description: Type of the result, must be video
928
+ - Field: media
929
+ Type: String
930
+ Description: 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 info on Sending Files »
931
+ - Field: thumb
932
+ Type: InputFile or String
933
+ Description: 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 90. 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 info on Sending Files »
934
+ - Field: caption
935
+ Type: String
936
+ Description: Optional. Caption of the video to be sent, 0-1024 characters
937
+ - Field: parse_mode
938
+ Type: String
939
+ Description: Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
940
+ - Field: width
941
+ Type: Integer
942
+ Description: Optional. Video width
943
+ - Field: height
944
+ Type: Integer
945
+ Description: Optional. Video height
946
+ - Field: duration
947
+ Type: Integer
948
+ Description: Optional. Video duration
949
+ - Field: supports_streaming
950
+ Type: Boolean
951
+ Description: Optional. Pass True, if the uploaded video is suitable for streaming
952
+ - name: InputMediaAnimation
953
+ children: []
954
+ desc:
955
+ - name: p
956
+ content: Represents an animation file (GIF or H.264/MPEG-4 AVC video without sound) to be sent.
957
+ table:
958
+ - Field: type
959
+ Type: String
960
+ Description: Type of the result, must be animation
961
+ - Field: media
962
+ Type: String
963
+ Description: 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 info on Sending Files »
964
+ - Field: thumb
965
+ Type: InputFile or String
966
+ Description: 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 90. 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 info on Sending Files »
967
+ - Field: caption
968
+ Type: String
969
+ Description: Optional. Caption of the animation to be sent, 0-1024 characters
970
+ - Field: parse_mode
971
+ Type: String
972
+ Description: Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
973
+ - Field: width
974
+ Type: Integer
975
+ Description: Optional. Animation width
976
+ - Field: height
977
+ Type: Integer
978
+ Description: Optional. Animation height
979
+ - Field: duration
980
+ Type: Integer
981
+ Description: Optional. Animation duration
982
+ - name: InputMediaAudio
983
+ children: []
984
+ desc:
985
+ - name: p
986
+ content: Represents an audio file to be treated as music to be sent.
987
+ table:
988
+ - Field: type
989
+ Type: String
990
+ Description: Type of the result, must be audio
991
+ - Field: media
992
+ Type: String
993
+ Description: 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 info on Sending Files »
994
+ - Field: thumb
995
+ Type: InputFile or String
996
+ Description: 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 90. 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 info on Sending Files »
997
+ - Field: caption
998
+ Type: String
999
+ Description: Optional. Caption of the audio to be sent, 0-1024 characters
1000
+ - Field: parse_mode
1001
+ Type: String
1002
+ Description: Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
1003
+ - Field: duration
1004
+ Type: Integer
1005
+ Description: Optional. Duration of the audio in seconds
1006
+ - Field: performer
1007
+ Type: String
1008
+ Description: Optional. Performer of the audio
1009
+ - Field: title
1010
+ Type: String
1011
+ Description: Optional. Title of the audio
1012
+ - name: InputMediaDocument
1013
+ children: []
1014
+ desc:
1015
+ - name: p
1016
+ content: Represents a general file to be sent.
1017
+ table:
1018
+ - Field: type
1019
+ Type: String
1020
+ Description: Type of the result, must be document
1021
+ - Field: media
1022
+ Type: String
1023
+ Description: 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 info on Sending Files »
1024
+ - Field: thumb
1025
+ Type: InputFile or String
1026
+ Description: 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 90. 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 info on Sending Files »
1027
+ - Field: caption
1028
+ Type: String
1029
+ Description: Optional. Caption of the document to be sent, 0-1024 characters
1030
+ - Field: parse_mode
1031
+ Type: String
1032
+ Description: Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
1033
+ - name: InputFile
1034
+ children: []
1035
+ desc:
1036
+ - name: p
1037
+ content: 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.
1038
+ - name: Sending files
1039
+ children: []
1040
+ desc:
1041
+ - name: p
1042
+ content: 'There are three ways to send files (photos, stickers, audio, media, etc.):'
1043
+ - name: ol
1044
+ content:
1045
+ - 'If the file is already stored somewhere on the Telegram servers, you don''t need to reupload it: each file object has a file_id field, simply pass this file_id as a parameter instead of uploading. There are no limits for files sent this way.'
1046
+ - Provide Telegram with an HTTP URL for the file to be sent. Telegram will download and send the file. 5 MB max size for photos and 20 MB max for other types of content.
1047
+ - Post the file using multipart/form-data in the usual way that files are uploaded via the browser. 10 MB max size for photos, 50 MB for other files.
1048
+ - name: p
1049
+ content: Sending by file_id
1050
+ - name: ul
1051
+ content:
1052
+ - It is not possible to change the file type when resending by file_id. I.e. a video can't be sent as a photo, a photo can't be sent as a document, etc.
1053
+ - It is not possible to resend thumbnails.
1054
+ - Resending a photo by file_id will send all of its sizes.
1055
+ - file_id is unique for each individual bot and can't be transferred from one bot to another.
1056
+ - name: p
1057
+ content: Sending by URL
1058
+ - name: ul
1059
+ content:
1060
+ - When sending by URL the target file must have the correct MIME type (e.g., audio/mpeg for sendAudio, etc.).
1061
+ - In sendDocument, sending by URL will currently only work for gif, pdf and zip files.
1062
+ - To use sendVoice, the file must have the type audio/ogg and be no more than 1MB in size. 1–20MB voice notes will be sent as files.
1063
+ - Other configurations may work but we can't guarantee that they will.
1064
+ - name: Inline mode objects
1065
+ children: []
1066
+ desc:
1067
+ - name: p
1068
+ content: Objects and methods used in the inline mode are described in the Inline mode section.
1069
+ desc:
1070
+ - name: p
1071
+ content: All types used in the Bot API responses are represented as JSON-objects.
1072
+ - name: p
1073
+ content: It is safe to use 32-bit signed integers for storing all Integer fields unless otherwise noted.
1074
+ - name: blockquote
1075
+ content: Optional fields may be not returned when irrelevant.
1076
+ - name: Available methods
1077
+ children:
1078
+ - name: getMe
1079
+ children: []
1080
+ desc:
1081
+ - name: p
1082
+ content: A simple method for testing your bot's auth token. Requires no parameters. Returns basic information about the bot in form of a User object.
1083
+ - name: sendMessage
1084
+ children: []
1085
+ desc:
1086
+ - name: p
1087
+ content: Use this method to send text messages. On success, the sent Message is returned.
1088
+ table:
1089
+ - Parameter: chat_id
1090
+ Type: Integer or String
1091
+ Required: 'Yes'
1092
+ Description: Unique identifier for the target chat or username of the target channel (in the format @channelusername)
1093
+ - Parameter: text
1094
+ Type: String
1095
+ Required: 'Yes'
1096
+ Description: Text of the message to be sent
1097
+ - Parameter: parse_mode
1098
+ Type: String
1099
+ Required: Optional
1100
+ Description: Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in your bot's message.
1101
+ - Parameter: disable_web_page_preview
1102
+ Type: Boolean
1103
+ Required: Optional
1104
+ Description: Disables link previews for links in this message
1105
+ - Parameter: disable_notification
1106
+ Type: Boolean
1107
+ Required: Optional
1108
+ Description: Sends the message silently. Users will receive a notification with no sound.
1109
+ - Parameter: reply_to_message_id
1110
+ Type: Integer
1111
+ Required: Optional
1112
+ Description: If the message is a reply, ID of the original message
1113
+ - Parameter: reply_markup
1114
+ Type: InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply
1115
+ Required: Optional
1116
+ Description: Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
1117
+ - name: Formatting options
1118
+ children: []
1119
+ desc:
1120
+ - name: p
1121
+ content: The Bot API supports basic formatting for messages. You can use bold and italic text, as well as inline links and pre-formatted code in your bots' messages. Telegram clients will render them accordingly. You can use either markdown-style or HTML-style formatting.
1122
+ - name: p
1123
+ content: Note that Telegram clients will display an alert to the user before opening an inline link (‘Open this link?’ together with the full URL).
1124
+ - name: p
1125
+ content: 'Links tg://user?id=<user_id> can be used to mention a user by their id without using a username. Please note:'
1126
+ - name: ul
1127
+ content:
1128
+ - These links will work only if they are used inside an inline link. For example, they will not work, when used in an inline keyboard button or in a message text.
1129
+ - These mentions are only guaranteed to work if the user has contacted the bot in the past, has sent a callback query to the bot via inline button or is a member in the group where he was mentioned.
1130
+ - name: h6
1131
+ content: Markdown style
1132
+ - name: p
1133
+ content: 'To use this mode, pass Markdown in the parse_mode field when using sendMessage. Use the following syntax in your message:'
1134
+ - name: pre
1135
+ content: |-
1136
+ *bold text*
1137
+ _italic text_
1138
+ [inline URL](http://www.example.com/)
1139
+ [inline mention of a user](tg://user?id=123456789)
1140
+ `inline fixed-width code`
1141
+ ```block_language
1142
+ pre-formatted fixed-width code block
1143
+ ```
1144
+ - name: h6
1145
+ content: HTML style
1146
+ - name: p
1147
+ content: 'To use this mode, pass HTML in the parse_mode field when using sendMessage. The following tags are currently supported:'
1148
+ - name: pre
1149
+ content: |-
1150
+ <b>bold</b>, <strong>bold</strong>
1151
+ <i>italic</i>, <em>italic</em>
1152
+ <a href="http://www.example.com/">inline URL</a>
1153
+ <a href="tg://user?id=123456789">inline mention of a user</a>
1154
+ <code>inline fixed-width code</code>
1155
+ <pre>pre-formatted fixed-width code block</pre>
1156
+ - name: p
1157
+ content: 'Please note:'
1158
+ - name: ul
1159
+ content:
1160
+ - Only the tags mentioned above are currently supported.
1161
+ - Tags must not be nested.
1162
+ - All <, > and & symbols that are not a part of a tag or an HTML entity must be replaced with the corresponding HTML entities (< with &lt;, > with &gt; and & with &amp;).
1163
+ - All numerical HTML entities are supported.
1164
+ - 'The API currently supports only the following named HTML entities: &lt;, &gt;, &amp; and &quot;.'
1165
+ - name: forwardMessage
1166
+ children: []
1167
+ desc:
1168
+ - name: p
1169
+ content: Use this method to forward messages of any kind. On success, the sent Message is returned.
1170
+ table:
1171
+ - Parameter: chat_id
1172
+ Type: Integer or String
1173
+ Required: 'Yes'
1174
+ Description: Unique identifier for the target chat or username of the target channel (in the format @channelusername)
1175
+ - Parameter: from_chat_id
1176
+ Type: Integer or String
1177
+ Required: 'Yes'
1178
+ Description: Unique identifier for the chat where the original message was sent (or channel username in the format @channelusername)
1179
+ - Parameter: disable_notification
1180
+ Type: Boolean
1181
+ Required: Optional
1182
+ Description: Sends the message silently. Users will receive a notification with no sound.
1183
+ - Parameter: message_id
1184
+ Type: Integer
1185
+ Required: 'Yes'
1186
+ Description: Message identifier in the chat specified in from_chat_id
1187
+ - name: sendPhoto
1188
+ children: []
1189
+ desc:
1190
+ - name: p
1191
+ content: Use this method to send photos. On success, the sent Message is returned.
1192
+ table:
1193
+ - Parameter: chat_id
1194
+ Type: Integer or String
1195
+ Required: 'Yes'
1196
+ Description: Unique identifier for the target chat or username of the target channel (in the format @channelusername)
1197
+ - Parameter: photo
1198
+ Type: InputFile or String
1199
+ Required: 'Yes'
1200
+ Description: 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. More info on Sending Files »
1201
+ - Parameter: caption
1202
+ Type: String
1203
+ Required: Optional
1204
+ Description: Photo caption (may also be used when resending photos by file_id), 0-1024 characters
1205
+ - Parameter: parse_mode
1206
+ Type: String
1207
+ Required: Optional
1208
+ Description: Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
1209
+ - Parameter: disable_notification
1210
+ Type: Boolean
1211
+ Required: Optional
1212
+ Description: Sends the message silently. Users will receive a notification with no sound.
1213
+ - Parameter: reply_to_message_id
1214
+ Type: Integer
1215
+ Required: Optional
1216
+ Description: If the message is a reply, ID of the original message
1217
+ - Parameter: reply_markup
1218
+ Type: InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply
1219
+ Required: Optional
1220
+ Description: Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
1221
+ - name: sendAudio
1222
+ children: []
1223
+ desc:
1224
+ - name: p
1225
+ content: 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 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.
1226
+ - name: p
1227
+ content: For sending voice messages, use the sendVoice method instead.
1228
+ table:
1229
+ - Parameter: chat_id
1230
+ Type: Integer or String
1231
+ Required: 'Yes'
1232
+ Description: Unique identifier for the target chat or username of the target channel (in the format @channelusername)
1233
+ - Parameter: audio
1234
+ Type: InputFile or String
1235
+ Required: 'Yes'
1236
+ Description: 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 info on Sending Files »
1237
+ - Parameter: caption
1238
+ Type: String
1239
+ Required: Optional
1240
+ Description: Audio caption, 0-1024 characters
1241
+ - Parameter: parse_mode
1242
+ Type: String
1243
+ Required: Optional
1244
+ Description: Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
1245
+ - Parameter: duration
1246
+ Type: Integer
1247
+ Required: Optional
1248
+ Description: Duration of the audio in seconds
1249
+ - Parameter: performer
1250
+ Type: String
1251
+ Required: Optional
1252
+ Description: Performer
1253
+ - Parameter: title
1254
+ Type: String
1255
+ Required: Optional
1256
+ Description: Track name
1257
+ - Parameter: thumb
1258
+ Type: InputFile or String
1259
+ Required: Optional
1260
+ Description: 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 90. 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 info on Sending Files »
1261
+ - Parameter: disable_notification
1262
+ Type: Boolean
1263
+ Required: Optional
1264
+ Description: Sends the message silently. Users will receive a notification with no sound.
1265
+ - Parameter: reply_to_message_id
1266
+ Type: Integer
1267
+ Required: Optional
1268
+ Description: If the message is a reply, ID of the original message
1269
+ - Parameter: reply_markup
1270
+ Type: InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply
1271
+ Required: Optional
1272
+ Description: Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
1273
+ - name: sendDocument
1274
+ children: []
1275
+ desc:
1276
+ - name: p
1277
+ content: 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.
1278
+ table:
1279
+ - Parameter: chat_id
1280
+ Type: Integer or String
1281
+ Required: 'Yes'
1282
+ Description: Unique identifier for the target chat or username of the target channel (in the format @channelusername)
1283
+ - Parameter: document
1284
+ Type: InputFile or String
1285
+ Required: 'Yes'
1286
+ Description: 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 info on Sending Files »
1287
+ - Parameter: thumb
1288
+ Type: InputFile or String
1289
+ Required: Optional
1290
+ Description: 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 90. 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 info on Sending Files »
1291
+ - Parameter: caption
1292
+ Type: String
1293
+ Required: Optional
1294
+ Description: Document caption (may also be used when resending documents by file_id), 0-1024 characters
1295
+ - Parameter: parse_mode
1296
+ Type: String
1297
+ Required: Optional
1298
+ Description: Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
1299
+ - Parameter: disable_notification
1300
+ Type: Boolean
1301
+ Required: Optional
1302
+ Description: Sends the message silently. Users will receive a notification with no sound.
1303
+ - Parameter: reply_to_message_id
1304
+ Type: Integer
1305
+ Required: Optional
1306
+ Description: If the message is a reply, ID of the original message
1307
+ - Parameter: reply_markup
1308
+ Type: InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply
1309
+ Required: Optional
1310
+ Description: Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
1311
+ - name: sendVideo
1312
+ children: []
1313
+ desc:
1314
+ - name: p
1315
+ content: Use this method to send video files, Telegram clients support mp4 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.
1316
+ table:
1317
+ - Parameter: chat_id
1318
+ Type: Integer or String
1319
+ Required: 'Yes'
1320
+ Description: Unique identifier for the target chat or username of the target channel (in the format @channelusername)
1321
+ - Parameter: video
1322
+ Type: InputFile or String
1323
+ Required: 'Yes'
1324
+ Description: 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 info on Sending Files »
1325
+ - Parameter: duration
1326
+ Type: Integer
1327
+ Required: Optional
1328
+ Description: Duration of sent video in seconds
1329
+ - Parameter: width
1330
+ Type: Integer
1331
+ Required: Optional
1332
+ Description: Video width
1333
+ - Parameter: height
1334
+ Type: Integer
1335
+ Required: Optional
1336
+ Description: Video height
1337
+ - Parameter: thumb
1338
+ Type: InputFile or String
1339
+ Required: Optional
1340
+ Description: 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 90. 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 info on Sending Files »
1341
+ - Parameter: caption
1342
+ Type: String
1343
+ Required: Optional
1344
+ Description: Video caption (may also be used when resending videos by file_id), 0-1024 characters
1345
+ - Parameter: parse_mode
1346
+ Type: String
1347
+ Required: Optional
1348
+ Description: Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
1349
+ - Parameter: supports_streaming
1350
+ Type: Boolean
1351
+ Required: Optional
1352
+ Description: Pass True, if the uploaded video is suitable for streaming
1353
+ - Parameter: disable_notification
1354
+ Type: Boolean
1355
+ Required: Optional
1356
+ Description: Sends the message silently. Users will receive a notification with no sound.
1357
+ - Parameter: reply_to_message_id
1358
+ Type: Integer
1359
+ Required: Optional
1360
+ Description: If the message is a reply, ID of the original message
1361
+ - Parameter: reply_markup
1362
+ Type: InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply
1363
+ Required: Optional
1364
+ Description: Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
1365
+ - name: sendAnimation
1366
+ children: []
1367
+ desc:
1368
+ - name: p
1369
+ content: 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.
1370
+ table:
1371
+ - Parameter: chat_id
1372
+ Type: Integer or String
1373
+ Required: 'Yes'
1374
+ Description: Unique identifier for the target chat or username of the target channel (in the format @channelusername)
1375
+ - Parameter: animation
1376
+ Type: InputFile or String
1377
+ Required: 'Yes'
1378
+ Description: 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 info on Sending Files »
1379
+ - Parameter: duration
1380
+ Type: Integer
1381
+ Required: Optional
1382
+ Description: Duration of sent animation in seconds
1383
+ - Parameter: width
1384
+ Type: Integer
1385
+ Required: Optional
1386
+ Description: Animation width
1387
+ - Parameter: height
1388
+ Type: Integer
1389
+ Required: Optional
1390
+ Description: Animation height
1391
+ - Parameter: thumb
1392
+ Type: InputFile or String
1393
+ Required: Optional
1394
+ Description: 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 90. 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 info on Sending Files »
1395
+ - Parameter: caption
1396
+ Type: String
1397
+ Required: Optional
1398
+ Description: Animation caption (may also be used when resending animation by file_id), 0-1024 characters
1399
+ - Parameter: parse_mode
1400
+ Type: String
1401
+ Required: Optional
1402
+ Description: Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
1403
+ - Parameter: disable_notification
1404
+ Type: Boolean
1405
+ Required: Optional
1406
+ Description: Sends the message silently. Users will receive a notification with no sound.
1407
+ - Parameter: reply_to_message_id
1408
+ Type: Integer
1409
+ Required: Optional
1410
+ Description: If the message is a reply, ID of the original message
1411
+ - Parameter: reply_markup
1412
+ Type: InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply
1413
+ Required: Optional
1414
+ Description: Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
1415
+ - name: sendVoice
1416
+ children: []
1417
+ desc:
1418
+ - name: p
1419
+ content: Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .ogg file encoded with OPUS (other formats may be sent as 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.
1420
+ table:
1421
+ - Parameter: chat_id
1422
+ Type: Integer or String
1423
+ Required: 'Yes'
1424
+ Description: Unique identifier for the target chat or username of the target channel (in the format @channelusername)
1425
+ - Parameter: voice
1426
+ Type: InputFile or String
1427
+ Required: 'Yes'
1428
+ Description: 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 info on Sending Files »
1429
+ - Parameter: caption
1430
+ Type: String
1431
+ Required: Optional
1432
+ Description: Voice message caption, 0-1024 characters
1433
+ - Parameter: parse_mode
1434
+ Type: String
1435
+ Required: Optional
1436
+ Description: Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
1437
+ - Parameter: duration
1438
+ Type: Integer
1439
+ Required: Optional
1440
+ Description: Duration of the voice message in seconds
1441
+ - Parameter: disable_notification
1442
+ Type: Boolean
1443
+ Required: Optional
1444
+ Description: Sends the message silently. Users will receive a notification with no sound.
1445
+ - Parameter: reply_to_message_id
1446
+ Type: Integer
1447
+ Required: Optional
1448
+ Description: If the message is a reply, ID of the original message
1449
+ - Parameter: reply_markup
1450
+ Type: InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply
1451
+ Required: Optional
1452
+ Description: Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
1453
+ - name: sendVideoNote
1454
+ children: []
1455
+ desc:
1456
+ - name: p
1457
+ content: As of v.4.0, Telegram clients support rounded square mp4 videos of up to 1 minute long. Use this method to send video messages. On success, the sent Message is returned.
1458
+ table:
1459
+ - Parameter: chat_id
1460
+ Type: Integer or String
1461
+ Required: 'Yes'
1462
+ Description: Unique identifier for the target chat or username of the target channel (in the format @channelusername)
1463
+ - Parameter: video_note
1464
+ Type: InputFile or String
1465
+ Required: 'Yes'
1466
+ Description: 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 info on Sending Files ». Sending video notes by a URL is currently unsupported
1467
+ - Parameter: duration
1468
+ Type: Integer
1469
+ Required: Optional
1470
+ Description: Duration of sent video in seconds
1471
+ - Parameter: length
1472
+ Type: Integer
1473
+ Required: Optional
1474
+ Description: Video width and height, i.e. diameter of the video message
1475
+ - Parameter: thumb
1476
+ Type: InputFile or String
1477
+ Required: Optional
1478
+ Description: 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 90. 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 info on Sending Files »
1479
+ - Parameter: disable_notification
1480
+ Type: Boolean
1481
+ Required: Optional
1482
+ Description: Sends the message silently. Users will receive a notification with no sound.
1483
+ - Parameter: reply_to_message_id
1484
+ Type: Integer
1485
+ Required: Optional
1486
+ Description: If the message is a reply, ID of the original message
1487
+ - Parameter: reply_markup
1488
+ Type: InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply
1489
+ Required: Optional
1490
+ Description: Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
1491
+ - name: sendMediaGroup
1492
+ children: []
1493
+ desc:
1494
+ - name: p
1495
+ content: Use this method to send a group of photos or videos as an album. On success, an array of the sent Messages is returned.
1496
+ table:
1497
+ - Parameter: chat_id
1498
+ Type: Integer or String
1499
+ Required: 'Yes'
1500
+ Description: Unique identifier for the target chat or username of the target channel (in the format @channelusername)
1501
+ - Parameter: media
1502
+ Type: Array of InputMediaPhoto and InputMediaVideo
1503
+ Required: 'Yes'
1504
+ Description: A JSON-serialized array describing photos and videos to be sent, must include 2–10 items
1505
+ - Parameter: disable_notification
1506
+ Type: Boolean
1507
+ Required: Optional
1508
+ Description: Sends the messages silently. Users will receive a notification with no sound.
1509
+ - Parameter: reply_to_message_id
1510
+ Type: Integer
1511
+ Required: Optional
1512
+ Description: If the messages are a reply, ID of the original message
1513
+ - name: sendLocation
1514
+ children: []
1515
+ desc:
1516
+ - name: p
1517
+ content: Use this method to send point on the map. On success, the sent Message is returned.
1518
+ table:
1519
+ - Parameter: chat_id
1520
+ Type: Integer or String
1521
+ Required: 'Yes'
1522
+ Description: Unique identifier for the target chat or username of the target channel (in the format @channelusername)
1523
+ - Parameter: latitude
1524
+ Type: Float number
1525
+ Required: 'Yes'
1526
+ Description: Latitude of the location
1527
+ - Parameter: longitude
1528
+ Type: Float number
1529
+ Required: 'Yes'
1530
+ Description: Longitude of the location
1531
+ - Parameter: live_period
1532
+ Type: Integer
1533
+ Required: Optional
1534
+ Description: Period in seconds for which the location will be updated (see Live Locations, should be between 60 and 86400.
1535
+ - Parameter: disable_notification
1536
+ Type: Boolean
1537
+ Required: Optional
1538
+ Description: Sends the message silently. Users will receive a notification with no sound.
1539
+ - Parameter: reply_to_message_id
1540
+ Type: Integer
1541
+ Required: Optional
1542
+ Description: If the message is a reply, ID of the original message
1543
+ - Parameter: reply_markup
1544
+ Type: InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply
1545
+ Required: Optional
1546
+ Description: Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
1547
+ - name: editMessageLiveLocation
1548
+ children: []
1549
+ desc:
1550
+ - name: p
1551
+ content: Use this method to edit live location messages sent by the bot or via the bot (for inline bots). 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 was sent by the bot, the edited Message is returned, otherwise True is returned.
1552
+ table:
1553
+ - Parameter: chat_id
1554
+ Type: Integer or String
1555
+ Required: Optional
1556
+ Description: Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)
1557
+ - Parameter: message_id
1558
+ Type: Integer
1559
+ Required: Optional
1560
+ Description: Required if inline_message_id is not specified. Identifier of the sent message
1561
+ - Parameter: inline_message_id
1562
+ Type: String
1563
+ Required: Optional
1564
+ Description: Required if chat_id and message_id are not specified. Identifier of the inline message
1565
+ - Parameter: latitude
1566
+ Type: Float number
1567
+ Required: 'Yes'
1568
+ Description: Latitude of new location
1569
+ - Parameter: longitude
1570
+ Type: Float number
1571
+ Required: 'Yes'
1572
+ Description: Longitude of new location
1573
+ - Parameter: reply_markup
1574
+ Type: InlineKeyboardMarkup
1575
+ Required: Optional
1576
+ Description: A JSON-serialized object for a new inline keyboard.
1577
+ - name: stopMessageLiveLocation
1578
+ children: []
1579
+ desc:
1580
+ - name: p
1581
+ content: Use this method to stop updating a live location message sent by the bot or via the bot (for inline bots) before live_period expires. On success, if the message was sent by the bot, the sent Message is returned, otherwise True is returned.
1582
+ table:
1583
+ - Parameter: chat_id
1584
+ Type: Integer or String
1585
+ Required: Optional
1586
+ Description: Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)
1587
+ - Parameter: message_id
1588
+ Type: Integer
1589
+ Required: Optional
1590
+ Description: Required if inline_message_id is not specified. Identifier of the sent message
1591
+ - Parameter: inline_message_id
1592
+ Type: String
1593
+ Required: Optional
1594
+ Description: Required if chat_id and message_id are not specified. Identifier of the inline message
1595
+ - Parameter: reply_markup
1596
+ Type: InlineKeyboardMarkup
1597
+ Required: Optional
1598
+ Description: A JSON-serialized object for a new inline keyboard.
1599
+ - name: sendVenue
1600
+ children: []
1601
+ desc:
1602
+ - name: p
1603
+ content: Use this method to send information about a venue. On success, the sent Message is returned.
1604
+ table:
1605
+ - Parameter: chat_id
1606
+ Type: Integer or String
1607
+ Required: 'Yes'
1608
+ Description: Unique identifier for the target chat or username of the target channel (in the format @channelusername)
1609
+ - Parameter: latitude
1610
+ Type: Float number
1611
+ Required: 'Yes'
1612
+ Description: Latitude of the venue
1613
+ - Parameter: longitude
1614
+ Type: Float number
1615
+ Required: 'Yes'
1616
+ Description: Longitude of the venue
1617
+ - Parameter: title
1618
+ Type: String
1619
+ Required: 'Yes'
1620
+ Description: Name of the venue
1621
+ - Parameter: address
1622
+ Type: String
1623
+ Required: 'Yes'
1624
+ Description: Address of the venue
1625
+ - Parameter: foursquare_id
1626
+ Type: String
1627
+ Required: Optional
1628
+ Description: Foursquare identifier of the venue
1629
+ - Parameter: foursquare_type
1630
+ Type: String
1631
+ Required: Optional
1632
+ Description: Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.)
1633
+ - Parameter: disable_notification
1634
+ Type: Boolean
1635
+ Required: Optional
1636
+ Description: Sends the message silently. Users will receive a notification with no sound.
1637
+ - Parameter: reply_to_message_id
1638
+ Type: Integer
1639
+ Required: Optional
1640
+ Description: If the message is a reply, ID of the original message
1641
+ - Parameter: reply_markup
1642
+ Type: InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply
1643
+ Required: Optional
1644
+ Description: Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
1645
+ - name: sendContact
1646
+ children: []
1647
+ desc:
1648
+ - name: p
1649
+ content: Use this method to send phone contacts. On success, the sent Message is returned.
1650
+ table:
1651
+ - Parameter: chat_id
1652
+ Type: Integer or String
1653
+ Required: 'Yes'
1654
+ Description: Unique identifier for the target chat or username of the target channel (in the format @channelusername)
1655
+ - Parameter: phone_number
1656
+ Type: String
1657
+ Required: 'Yes'
1658
+ Description: Contact's phone number
1659
+ - Parameter: first_name
1660
+ Type: String
1661
+ Required: 'Yes'
1662
+ Description: Contact's first name
1663
+ - Parameter: last_name
1664
+ Type: String
1665
+ Required: Optional
1666
+ Description: Contact's last name
1667
+ - Parameter: vcard
1668
+ Type: String
1669
+ Required: Optional
1670
+ Description: Additional data about the contact in the form of a vCard, 0-2048 bytes
1671
+ - Parameter: disable_notification
1672
+ Type: Boolean
1673
+ Required: Optional
1674
+ Description: Sends the message silently. Users will receive a notification with no sound.
1675
+ - Parameter: reply_to_message_id
1676
+ Type: Integer
1677
+ Required: Optional
1678
+ Description: If the message is a reply, ID of the original message
1679
+ - Parameter: reply_markup
1680
+ Type: InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply
1681
+ Required: Optional
1682
+ Description: Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove keyboard or to force a reply from the user.
1683
+ - name: sendChatAction
1684
+ children: []
1685
+ desc:
1686
+ - name: p
1687
+ content: 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.
1688
+ - name: blockquote
1689
+ content: '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.'
1690
+ - name: p
1691
+ content: We only recommend using this method when a response from the bot will take a noticeable amount of time to arrive.
1692
+ table:
1693
+ - Parameter: chat_id
1694
+ Type: Integer or String
1695
+ Required: 'Yes'
1696
+ Description: Unique identifier for the target chat or username of the target channel (in the format @channelusername)
1697
+ - Parameter: action
1698
+ Type: String
1699
+ Required: 'Yes'
1700
+ Description: '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_audio or upload_audio for audio files, upload_document for general files, find_location for location data, record_video_note or upload_video_note for video notes.'
1701
+ - name: getUserProfilePhotos
1702
+ children: []
1703
+ desc:
1704
+ - name: p
1705
+ content: Use this method to get a list of profile pictures for a user. Returns a UserProfilePhotos object.
1706
+ table:
1707
+ - Parameter: user_id
1708
+ Type: Integer
1709
+ Required: 'Yes'
1710
+ Description: Unique identifier of the target user
1711
+ - Parameter: offset
1712
+ Type: Integer
1713
+ Required: Optional
1714
+ Description: Sequential number of the first photo to be returned. By default, all photos are returned.
1715
+ - Parameter: limit
1716
+ Type: Integer
1717
+ Required: Optional
1718
+ Description: Limits the number of photos to be retrieved. Values between 1—100 are accepted. Defaults to 100.
1719
+ - name: getFile
1720
+ children: []
1721
+ desc:
1722
+ - name: p
1723
+ content: Use this method to get basic info 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.
1724
+ - name: p
1725
+ content: '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.'
1726
+ table:
1727
+ - Parameter: file_id
1728
+ Type: String
1729
+ Required: 'Yes'
1730
+ Description: File identifier to get info about
1731
+ - name: kickChatMember
1732
+ children: []
1733
+ desc:
1734
+ - name: p
1735
+ content: Use this method to kick a user from a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the group 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 admin rights. Returns True on success.
1736
+ - name: blockquote
1737
+ content: 'Note: In regular groups (non-supergroups), this method will only work if the ‘All Members Are Admins’ setting is off in the target group. Otherwise members may only be removed by the group''s creator or by the member that added them.'
1738
+ table:
1739
+ - Parameter: chat_id
1740
+ Type: Integer or String
1741
+ Required: 'Yes'
1742
+ Description: Unique identifier for the target group or username of the target supergroup or channel (in the format @channelusername)
1743
+ - Parameter: user_id
1744
+ Type: Integer
1745
+ Required: 'Yes'
1746
+ Description: Unique identifier of the target user
1747
+ - Parameter: until_date
1748
+ Type: Integer
1749
+ Required: Optional
1750
+ Description: 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
1751
+ - name: unbanChatMember
1752
+ children: []
1753
+ desc:
1754
+ - name: p
1755
+ content: Use this method to unban a previously kicked 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. Returns True on success.
1756
+ table:
1757
+ - Parameter: chat_id
1758
+ Type: Integer or String
1759
+ Required: 'Yes'
1760
+ Description: Unique identifier for the target group or username of the target supergroup or channel (in the format @username)
1761
+ - Parameter: user_id
1762
+ Type: Integer
1763
+ Required: 'Yes'
1764
+ Description: Unique identifier of the target user
1765
+ - name: restrictChatMember
1766
+ children: []
1767
+ desc:
1768
+ - name: p
1769
+ content: 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 admin rights. Pass True for all boolean parameters to lift restrictions from a user. Returns True on success.
1770
+ table:
1771
+ - Parameter: chat_id
1772
+ Type: Integer or String
1773
+ Required: 'Yes'
1774
+ Description: Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
1775
+ - Parameter: user_id
1776
+ Type: Integer
1777
+ Required: 'Yes'
1778
+ Description: Unique identifier of the target user
1779
+ - Parameter: until_date
1780
+ Type: Integer
1781
+ Required: Optional
1782
+ Description: 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
1783
+ - Parameter: can_send_messages
1784
+ Type: Boolean
1785
+ Required: Optional
1786
+ Description: Pass True, if the user can send text messages, contacts, locations and venues
1787
+ - Parameter: can_send_media_messages
1788
+ Type: Boolean
1789
+ Required: Optional
1790
+ Description: Pass True, if the user can send audios, documents, photos, videos, video notes and voice notes, implies can_send_messages
1791
+ - Parameter: can_send_other_messages
1792
+ Type: Boolean
1793
+ Required: Optional
1794
+ Description: Pass True, if the user can send animations, games, stickers and use inline bots, implies can_send_media_messages
1795
+ - Parameter: can_add_web_page_previews
1796
+ Type: Boolean
1797
+ Required: Optional
1798
+ Description: Pass True, if the user may add web page previews to their messages, implies can_send_media_messages
1799
+ - name: promoteChatMember
1800
+ children: []
1801
+ desc:
1802
+ - name: p
1803
+ content: 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 admin rights. Pass False for all boolean parameters to demote a user. Returns True on success.
1804
+ table:
1805
+ - Parameter: chat_id
1806
+ Type: Integer or String
1807
+ Required: 'Yes'
1808
+ Description: Unique identifier for the target chat or username of the target channel (in the format @channelusername)
1809
+ - Parameter: user_id
1810
+ Type: Integer
1811
+ Required: 'Yes'
1812
+ Description: Unique identifier of the target user
1813
+ - Parameter: can_change_info
1814
+ Type: Boolean
1815
+ Required: Optional
1816
+ Description: Pass True, if the administrator can change chat title, photo and other settings
1817
+ - Parameter: can_post_messages
1818
+ Type: Boolean
1819
+ Required: Optional
1820
+ Description: Pass True, if the administrator can create channel posts, channels only
1821
+ - Parameter: can_edit_messages
1822
+ Type: Boolean
1823
+ Required: Optional
1824
+ Description: Pass True, if the administrator can edit messages of other users and can pin messages, channels only
1825
+ - Parameter: can_delete_messages
1826
+ Type: Boolean
1827
+ Required: Optional
1828
+ Description: Pass True, if the administrator can delete messages of other users
1829
+ - Parameter: can_invite_users
1830
+ Type: Boolean
1831
+ Required: Optional
1832
+ Description: Pass True, if the administrator can invite new users to the chat
1833
+ - Parameter: can_restrict_members
1834
+ Type: Boolean
1835
+ Required: Optional
1836
+ Description: Pass True, if the administrator can restrict, ban or unban chat members
1837
+ - Parameter: can_pin_messages
1838
+ Type: Boolean
1839
+ Required: Optional
1840
+ Description: Pass True, if the administrator can pin messages, supergroups only
1841
+ - Parameter: can_promote_members
1842
+ Type: Boolean
1843
+ Required: Optional
1844
+ Description: Pass True, if the administrator can add new administrators with a subset of his own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by him)
1845
+ - name: exportChatInviteLink
1846
+ children: []
1847
+ desc:
1848
+ - name: p
1849
+ content: Use this method to generate a new invite link for a chat; any previously generated link is revoked. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns the new invite link as String on success.
1850
+ - name: blockquote
1851
+ content: '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 – after this the link will become available to the bot via the getChat method. If your bot needs to generate a new invite link replacing its previous one, use exportChatInviteLink again.'
1852
+ table:
1853
+ - Parameter: chat_id
1854
+ Type: Integer or String
1855
+ Required: 'Yes'
1856
+ Description: Unique identifier for the target chat or username of the target channel (in the format @channelusername)
1857
+ - name: setChatPhoto
1858
+ children: []
1859
+ desc:
1860
+ - name: p
1861
+ content: 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 admin rights. Returns True on success.
1862
+ - name: blockquote
1863
+ content: 'Note: In regular groups (non-supergroups), this method will only work if the ‘All Members Are Admins’ setting is off in the target group.'
1864
+ table:
1865
+ - Parameter: chat_id
1866
+ Type: Integer or String
1867
+ Required: 'Yes'
1868
+ Description: Unique identifier for the target chat or username of the target channel (in the format @channelusername)
1869
+ - Parameter: photo
1870
+ Type: InputFile
1871
+ Required: 'Yes'
1872
+ Description: New chat photo, uploaded using multipart/form-data
1873
+ - name: deleteChatPhoto
1874
+ children: []
1875
+ desc:
1876
+ - name: p
1877
+ content: 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 admin rights. Returns True on success.
1878
+ - name: blockquote
1879
+ content: 'Note: In regular groups (non-supergroups), this method will only work if the ‘All Members Are Admins’ setting is off in the target group.'
1880
+ table:
1881
+ - Parameter: chat_id
1882
+ Type: Integer or String
1883
+ Required: 'Yes'
1884
+ Description: Unique identifier for the target chat or username of the target channel (in the format @channelusername)
1885
+ - name: setChatTitle
1886
+ children: []
1887
+ desc:
1888
+ - name: p
1889
+ content: 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 admin rights. Returns True on success.
1890
+ - name: blockquote
1891
+ content: 'Note: In regular groups (non-supergroups), this method will only work if the ‘All Members Are Admins’ setting is off in the target group.'
1892
+ table:
1893
+ - Parameter: chat_id
1894
+ Type: Integer or String
1895
+ Required: 'Yes'
1896
+ Description: Unique identifier for the target chat or username of the target channel (in the format @channelusername)
1897
+ - Parameter: title
1898
+ Type: String
1899
+ Required: 'Yes'
1900
+ Description: New chat title, 1-255 characters
1901
+ - name: setChatDescription
1902
+ children: []
1903
+ desc:
1904
+ - name: p
1905
+ content: Use this method to change the description of a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns True on success.
1906
+ table:
1907
+ - Parameter: chat_id
1908
+ Type: Integer or String
1909
+ Required: 'Yes'
1910
+ Description: Unique identifier for the target chat or username of the target channel (in the format @channelusername)
1911
+ - Parameter: description
1912
+ Type: String
1913
+ Required: Optional
1914
+ Description: New chat description, 0-255 characters
1915
+ - name: pinChatMessage
1916
+ children: []
1917
+ desc:
1918
+ - name: p
1919
+ content: Use this method to pin a message in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the ‘can_pin_messages’ admin right in the supergroup or ‘can_edit_messages’ admin right in the channel. Returns True on success.
1920
+ table:
1921
+ - Parameter: chat_id
1922
+ Type: Integer or String
1923
+ Required: 'Yes'
1924
+ Description: Unique identifier for the target chat or username of the target channel (in the format @channelusername)
1925
+ - Parameter: message_id
1926
+ Type: Integer
1927
+ Required: 'Yes'
1928
+ Description: Identifier of a message to pin
1929
+ - Parameter: disable_notification
1930
+ Type: Boolean
1931
+ Required: Optional
1932
+ Description: 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.
1933
+ - name: unpinChatMessage
1934
+ children: []
1935
+ desc:
1936
+ - name: p
1937
+ content: Use this method to unpin a message in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the ‘can_pin_messages’ admin right in the supergroup or ‘can_edit_messages’ admin right in the channel. Returns True on success.
1938
+ table:
1939
+ - Parameter: chat_id
1940
+ Type: Integer or String
1941
+ Required: 'Yes'
1942
+ Description: Unique identifier for the target chat or username of the target channel (in the format @channelusername)
1943
+ - name: leaveChat
1944
+ children: []
1945
+ desc:
1946
+ - name: p
1947
+ content: Use this method for your bot to leave a group, supergroup or channel. Returns True on success.
1948
+ table:
1949
+ - Parameter: chat_id
1950
+ Type: Integer or String
1951
+ Required: 'Yes'
1952
+ Description: Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
1953
+ - name: getChat
1954
+ children: []
1955
+ desc:
1956
+ - name: p
1957
+ content: Use this method to get up to date information about the chat (current name of the user for one-on-one conversations, current username of a user, group or channel, etc.). Returns a Chat object on success.
1958
+ table:
1959
+ - Parameter: chat_id
1960
+ Type: Integer or String
1961
+ Required: 'Yes'
1962
+ Description: Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
1963
+ - name: getChatAdministrators
1964
+ children: []
1965
+ desc:
1966
+ - name: p
1967
+ content: Use this method to get a list of administrators in a chat. On success, returns an Array of ChatMember objects that contains information about all chat administrators except other bots. If the chat is a group or a supergroup and no administrators were appointed, only the creator will be returned.
1968
+ table:
1969
+ - Parameter: chat_id
1970
+ Type: Integer or String
1971
+ Required: 'Yes'
1972
+ Description: Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
1973
+ - name: getChatMembersCount
1974
+ children: []
1975
+ desc:
1976
+ - name: p
1977
+ content: Use this method to get the number of members in a chat. Returns Int on success.
1978
+ table:
1979
+ - Parameter: chat_id
1980
+ Type: Integer or String
1981
+ Required: 'Yes'
1982
+ Description: Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
1983
+ - name: getChatMember
1984
+ children: []
1985
+ desc:
1986
+ - name: p
1987
+ content: Use this method to get information about a member of a chat. Returns a ChatMember object on success.
1988
+ table:
1989
+ - Parameter: chat_id
1990
+ Type: Integer or String
1991
+ Required: 'Yes'
1992
+ Description: Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
1993
+ - Parameter: user_id
1994
+ Type: Integer
1995
+ Required: 'Yes'
1996
+ Description: Unique identifier of the target user
1997
+ - name: setChatStickerSet
1998
+ children: []
1999
+ desc:
2000
+ - name: p
2001
+ content: 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 admin 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.
2002
+ table:
2003
+ - Parameter: chat_id
2004
+ Type: Integer or String
2005
+ Required: 'Yes'
2006
+ Description: Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
2007
+ - Parameter: sticker_set_name
2008
+ Type: String
2009
+ Required: 'Yes'
2010
+ Description: Name of the sticker set to be set as the group sticker set
2011
+ - name: deleteChatStickerSet
2012
+ children: []
2013
+ desc:
2014
+ - name: p
2015
+ content: 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 admin 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.
2016
+ table:
2017
+ - Parameter: chat_id
2018
+ Type: Integer or String
2019
+ Required: 'Yes'
2020
+ Description: Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
2021
+ - name: answerCallbackQuery
2022
+ children: []
2023
+ desc:
2024
+ - name: p
2025
+ content: 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.
2026
+ - name: blockquote
2027
+ content: 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.
2028
+ table:
2029
+ - Parameter: callback_query_id
2030
+ Type: String
2031
+ Required: 'Yes'
2032
+ Description: Unique identifier for the query to be answered
2033
+ - Parameter: text
2034
+ Type: String
2035
+ Required: Optional
2036
+ Description: Text of the notification. If not specified, nothing will be shown to the user, 0-200 characters
2037
+ - Parameter: show_alert
2038
+ Type: Boolean
2039
+ Required: Optional
2040
+ Description: If true, an alert will be shown by the client instead of a notification at the top of the chat screen. Defaults to false.
2041
+ - Parameter: url
2042
+ Type: String
2043
+ Required: Optional
2044
+ Description: 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.Otherwise, you may use links like t.me/your_bot?start=XXXX that open your bot with a parameter.
2045
+ - Parameter: cache_time
2046
+ Type: Integer
2047
+ Required: Optional
2048
+ Description: 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.
2049
+ - name: Inline mode methods
2050
+ children: []
2051
+ desc:
2052
+ - name: p
2053
+ content: Methods and objects used in the inline mode are described in the Inline mode section.
2054
+ desc:
2055
+ - name: blockquote
2056
+ content: 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.On successful call, a JSON-object containing the result will be returned.
2057
+ - name: Updating messages
2058
+ children:
2059
+ - name: editMessageText
2060
+ children: []
2061
+ desc:
2062
+ - name: p
2063
+ content: Use this method to edit text and game messages sent by the bot or via the bot (for inline bots). On success, if edited message is sent by the bot, the edited Message is returned, otherwise True is returned.
2064
+ table:
2065
+ - Parameter: chat_id
2066
+ Type: Integer or String
2067
+ Required: Optional
2068
+ Description: Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)
2069
+ - Parameter: message_id
2070
+ Type: Integer
2071
+ Required: Optional
2072
+ Description: Required if inline_message_id is not specified. Identifier of the sent message
2073
+ - Parameter: inline_message_id
2074
+ Type: String
2075
+ Required: Optional
2076
+ Description: Required if chat_id and message_id are not specified. Identifier of the inline message
2077
+ - Parameter: text
2078
+ Type: String
2079
+ Required: 'Yes'
2080
+ Description: New text of the message
2081
+ - Parameter: parse_mode
2082
+ Type: String
2083
+ Required: Optional
2084
+ Description: Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in your bot's message.
2085
+ - Parameter: disable_web_page_preview
2086
+ Type: Boolean
2087
+ Required: Optional
2088
+ Description: Disables link previews for links in this message
2089
+ - Parameter: reply_markup
2090
+ Type: InlineKeyboardMarkup
2091
+ Required: Optional
2092
+ Description: A JSON-serialized object for an inline keyboard.
2093
+ - name: editMessageCaption
2094
+ children: []
2095
+ desc:
2096
+ - name: p
2097
+ content: Use this method to edit captions of messages sent by the bot or via the bot (for inline bots). On success, if edited message is sent by the bot, the edited Message is returned, otherwise True is returned.
2098
+ table:
2099
+ - Parameter: chat_id
2100
+ Type: Integer or String
2101
+ Required: Optional
2102
+ Description: Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)
2103
+ - Parameter: message_id
2104
+ Type: Integer
2105
+ Required: Optional
2106
+ Description: Required if inline_message_id is not specified. Identifier of the sent message
2107
+ - Parameter: inline_message_id
2108
+ Type: String
2109
+ Required: Optional
2110
+ Description: Required if chat_id and message_id are not specified. Identifier of the inline message
2111
+ - Parameter: caption
2112
+ Type: String
2113
+ Required: Optional
2114
+ Description: New caption of the message
2115
+ - Parameter: parse_mode
2116
+ Type: String
2117
+ Required: Optional
2118
+ Description: Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
2119
+ - Parameter: reply_markup
2120
+ Type: InlineKeyboardMarkup
2121
+ Required: Optional
2122
+ Description: A JSON-serialized object for an inline keyboard.
2123
+ - name: editMessageMedia
2124
+ children: []
2125
+ desc:
2126
+ - name: p
2127
+ content: Use this method to edit animation, audio, document, photo, or video messages. If a message is a part of a message album, then it can be edited only to a photo or a video. Otherwise, message type can be changed arbitrarily. When inline message is edited, new file can't be uploaded. Use previously uploaded file via its file_id or specify a URL. On success, if the edited message was sent by the bot, the edited Message is returned, otherwise True is returned.
2128
+ table:
2129
+ - Parameter: chat_id
2130
+ Type: Integer or String
2131
+ Required: Optional
2132
+ Description: Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)
2133
+ - Parameter: message_id
2134
+ Type: Integer
2135
+ Required: Optional
2136
+ Description: Required if inline_message_id is not specified. Identifier of the sent message
2137
+ - Parameter: inline_message_id
2138
+ Type: String
2139
+ Required: Optional
2140
+ Description: Required if chat_id and message_id are not specified. Identifier of the inline message
2141
+ - Parameter: media
2142
+ Type: InputMedia
2143
+ Required: 'Yes'
2144
+ Description: A JSON-serialized object for a new media content of the message
2145
+ - Parameter: reply_markup
2146
+ Type: InlineKeyboardMarkup
2147
+ Required: Optional
2148
+ Description: A JSON-serialized object for a new inline keyboard.
2149
+ - name: editMessageReplyMarkup
2150
+ children: []
2151
+ desc:
2152
+ - name: p
2153
+ content: Use this method to edit only the reply markup of messages sent by the bot or via the bot (for inline bots). On success, if edited message is sent by the bot, the edited Message is returned, otherwise True is returned.
2154
+ table:
2155
+ - Parameter: chat_id
2156
+ Type: Integer or String
2157
+ Required: Optional
2158
+ Description: Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)
2159
+ - Parameter: message_id
2160
+ Type: Integer
2161
+ Required: Optional
2162
+ Description: Required if inline_message_id is not specified. Identifier of the sent message
2163
+ - Parameter: inline_message_id
2164
+ Type: String
2165
+ Required: Optional
2166
+ Description: Required if chat_id and message_id are not specified. Identifier of the inline message
2167
+ - Parameter: reply_markup
2168
+ Type: InlineKeyboardMarkup
2169
+ Required: Optional
2170
+ Description: A JSON-serialized object for an inline keyboard.
2171
+ - name: deleteMessage
2172
+ children: []
2173
+ desc:
2174
+ - name: p
2175
+ content: 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.- Bots can delete outgoing messages in private chats, groups, and supergroups.- Bots granted can_post_messages permissions can delete outgoing messages in channels.- 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.Returns True on success.
2176
+ table:
2177
+ - Parameter: chat_id
2178
+ Type: Integer or String
2179
+ Required: 'Yes'
2180
+ Description: Unique identifier for the target chat or username of the target channel (in the format @channelusername)
2181
+ - Parameter: message_id
2182
+ Type: Integer
2183
+ Required: 'Yes'
2184
+ Description: Identifier of the message to delete
2185
+ desc:
2186
+ - name: p
2187
+ content: 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.
2188
+ - name: p
2189
+ content: Please note, that it is currently only possible to edit messages without reply_markup or with inline keyboards.
2190
+ - name: Stickers
2191
+ children:
2192
+ - name: Sticker
2193
+ children: []
2194
+ desc:
2195
+ - name: p
2196
+ content: This object represents a sticker.
2197
+ table:
2198
+ - Field: file_id
2199
+ Type: String
2200
+ Description: Unique identifier for this file
2201
+ - Field: width
2202
+ Type: Integer
2203
+ Description: Sticker width
2204
+ - Field: height
2205
+ Type: Integer
2206
+ Description: Sticker height
2207
+ - Field: thumb
2208
+ Type: PhotoSize
2209
+ Description: Optional. Sticker thumbnail in the .webp or .jpg format
2210
+ - Field: emoji
2211
+ Type: String
2212
+ Description: Optional. Emoji associated with the sticker
2213
+ - Field: set_name
2214
+ Type: String
2215
+ Description: Optional. Name of the sticker set to which the sticker belongs
2216
+ - Field: mask_position
2217
+ Type: MaskPosition
2218
+ Description: Optional. For mask stickers, the position where the mask should be placed
2219
+ - Field: file_size
2220
+ Type: Integer
2221
+ Description: Optional. File size
2222
+ - name: StickerSet
2223
+ children: []
2224
+ desc:
2225
+ - name: p
2226
+ content: This object represents a sticker set.
2227
+ table:
2228
+ - Field: name
2229
+ Type: String
2230
+ Description: Sticker set name
2231
+ - Field: title
2232
+ Type: String
2233
+ Description: Sticker set title
2234
+ - Field: contains_masks
2235
+ Type: Boolean
2236
+ Description: True, if the sticker set contains masks
2237
+ - Field: stickers
2238
+ Type: Array of Sticker
2239
+ Description: List of all set stickers
2240
+ - name: MaskPosition
2241
+ children: []
2242
+ desc:
2243
+ - name: p
2244
+ content: This object describes the position on faces where a mask should be placed by default.
2245
+ table:
2246
+ - Field: point
2247
+ Type: String
2248
+ Description: The part of the face relative to which the mask should be placed. One of “forehead”, “eyes”, “mouth”, or “chin”.
2249
+ - Field: x_shift
2250
+ Type: Float number
2251
+ Description: 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.
2252
+ - Field: y_shift
2253
+ Type: Float number
2254
+ Description: 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.
2255
+ - Field: scale
2256
+ Type: Float number
2257
+ Description: Mask scaling coefficient. For example, 2.0 means double size.
2258
+ - name: sendSticker
2259
+ children: []
2260
+ desc:
2261
+ - name: p
2262
+ content: Use this method to send .webp stickers. On success, the sent Message is returned.
2263
+ table:
2264
+ - Parameter: chat_id
2265
+ Type: Integer or String
2266
+ Required: 'Yes'
2267
+ Description: Unique identifier for the target chat or username of the target channel (in the format @channelusername)
2268
+ - Parameter: sticker
2269
+ Type: InputFile or String
2270
+ Required: 'Yes'
2271
+ Description: 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 file from the Internet, or upload a new one using multipart/form-data. More info on Sending Files »
2272
+ - Parameter: disable_notification
2273
+ Type: Boolean
2274
+ Required: Optional
2275
+ Description: Sends the message silently. Users will receive a notification with no sound.
2276
+ - Parameter: reply_to_message_id
2277
+ Type: Integer
2278
+ Required: Optional
2279
+ Description: If the message is a reply, ID of the original message
2280
+ - Parameter: reply_markup
2281
+ Type: InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply
2282
+ Required: Optional
2283
+ Description: Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
2284
+ - name: getStickerSet
2285
+ children: []
2286
+ desc:
2287
+ - name: p
2288
+ content: Use this method to get a sticker set. On success, a StickerSet object is returned.
2289
+ table:
2290
+ - Parameter: name
2291
+ Type: String
2292
+ Required: 'Yes'
2293
+ Description: Name of the sticker set
2294
+ - name: uploadStickerFile
2295
+ children: []
2296
+ desc:
2297
+ - name: p
2298
+ content: Use this method to upload a .png file with a sticker for later use in createNewStickerSet and addStickerToSet methods (can be used multiple times). Returns the uploaded File on success.
2299
+ table:
2300
+ - Parameter: user_id
2301
+ Type: Integer
2302
+ Required: 'Yes'
2303
+ Description: User identifier of sticker file owner
2304
+ - Parameter: png_sticker
2305
+ Type: InputFile
2306
+ Required: 'Yes'
2307
+ Description: Png image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px. More info on Sending Files »
2308
+ - name: createNewStickerSet
2309
+ children: []
2310
+ desc:
2311
+ - name: p
2312
+ content: Use this method to create new sticker set owned by a user. The bot will be able to edit the created sticker set. Returns True on success.
2313
+ table:
2314
+ - Parameter: user_id
2315
+ Type: Integer
2316
+ Required: 'Yes'
2317
+ Description: User identifier of created sticker set owner
2318
+ - Parameter: name
2319
+ Type: String
2320
+ Required: 'Yes'
2321
+ Description: 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.
2322
+ - Parameter: title
2323
+ Type: String
2324
+ Required: 'Yes'
2325
+ Description: Sticker set title, 1-64 characters
2326
+ - Parameter: png_sticker
2327
+ Type: InputFile or String
2328
+ Required: 'Yes'
2329
+ Description: Png image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px. 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 info on Sending Files »
2330
+ - Parameter: emojis
2331
+ Type: String
2332
+ Required: 'Yes'
2333
+ Description: One or more emoji corresponding to the sticker
2334
+ - Parameter: contains_masks
2335
+ Type: Boolean
2336
+ Required: Optional
2337
+ Description: Pass True, if a set of mask stickers should be created
2338
+ - Parameter: mask_position
2339
+ Type: MaskPosition
2340
+ Required: Optional
2341
+ Description: A JSON-serialized object for position where the mask should be placed on faces
2342
+ - name: addStickerToSet
2343
+ children: []
2344
+ desc:
2345
+ - name: p
2346
+ content: Use this method to add a new sticker to a set created by the bot. Returns True on success.
2347
+ table:
2348
+ - Parameter: user_id
2349
+ Type: Integer
2350
+ Required: 'Yes'
2351
+ Description: User identifier of sticker set owner
2352
+ - Parameter: name
2353
+ Type: String
2354
+ Required: 'Yes'
2355
+ Description: Sticker set name
2356
+ - Parameter: png_sticker
2357
+ Type: InputFile or String
2358
+ Required: 'Yes'
2359
+ Description: Png image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px. 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 info on Sending Files »
2360
+ - Parameter: emojis
2361
+ Type: String
2362
+ Required: 'Yes'
2363
+ Description: One or more emoji corresponding to the sticker
2364
+ - Parameter: mask_position
2365
+ Type: MaskPosition
2366
+ Required: Optional
2367
+ Description: A JSON-serialized object for position where the mask should be placed on faces
2368
+ - name: setStickerPositionInSet
2369
+ children: []
2370
+ desc:
2371
+ - name: p
2372
+ content: Use this method to move a sticker in a set created by the bot to a specific position . Returns True on success.
2373
+ table:
2374
+ - Parameter: sticker
2375
+ Type: String
2376
+ Required: 'Yes'
2377
+ Description: File identifier of the sticker
2378
+ - Parameter: position
2379
+ Type: Integer
2380
+ Required: 'Yes'
2381
+ Description: New sticker position in the set, zero-based
2382
+ - name: deleteStickerFromSet
2383
+ children: []
2384
+ desc:
2385
+ - name: p
2386
+ content: Use this method to delete a sticker from a set created by the bot. Returns True on success.
2387
+ table:
2388
+ - Parameter: sticker
2389
+ Type: String
2390
+ Required: 'Yes'
2391
+ Description: File identifier of the sticker
2392
+ desc:
2393
+ - name: p
2394
+ content: The following methods and objects allow your bot to handle stickers and sticker sets.
2395
+ - name: Inline mode
2396
+ children:
2397
+ - name: InlineQuery
2398
+ children: []
2399
+ desc:
2400
+ - name: p
2401
+ content: This object represents an incoming inline query. When the user sends an empty query, your bot could return some default or trending results.
2402
+ table:
2403
+ - Field: id
2404
+ Type: String
2405
+ Description: Unique identifier for this query
2406
+ - Field: from
2407
+ Type: User
2408
+ Description: Sender
2409
+ - Field: location
2410
+ Type: Location
2411
+ Description: Optional. Sender location, only for bots that request user location
2412
+ - Field: query
2413
+ Type: String
2414
+ Description: Text of the query (up to 512 characters)
2415
+ - Field: offset
2416
+ Type: String
2417
+ Description: Offset of the results to be returned, can be controlled by the bot
2418
+ - name: answerInlineQuery
2419
+ children: []
2420
+ desc:
2421
+ - name: p
2422
+ content: Use this method to send answers to an inline query. On success, True is returned.No more than 50 results per query are allowed.
2423
+ table:
2424
+ - Parameter: inline_query_id
2425
+ Type: String
2426
+ Required: 'Yes'
2427
+ Description: Unique identifier for the answered query
2428
+ - Parameter: results
2429
+ Type: Array of InlineQueryResult
2430
+ Required: 'Yes'
2431
+ Description: A JSON-serialized array of results for the inline query
2432
+ - Parameter: cache_time
2433
+ Type: Integer
2434
+ Required: Optional
2435
+ Description: The maximum amount of time in seconds that the result of the inline query may be cached on the server. Defaults to 300.
2436
+ - Parameter: is_personal
2437
+ Type: Boolean
2438
+ Required: Optional
2439
+ Description: 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
2440
+ - Parameter: next_offset
2441
+ Type: String
2442
+ Required: Optional
2443
+ Description: 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.
2444
+ - Parameter: switch_pm_text
2445
+ Type: String
2446
+ Required: Optional
2447
+ Description: If passed, clients will display a button with specified text that switches the user to a private chat with the bot and sends the bot a start message with the parameter switch_pm_parameter
2448
+ - Parameter: switch_pm_parameter
2449
+ Type: String
2450
+ Required: Optional
2451
+ Description: 'Deep-linking parameter for the /start message sent to the bot when user presses the switch button. 1-64 characters, only A-Z, a-z, 0-9, _ and - are allowed.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.'
2452
+ - name: InlineQueryResult
2453
+ children: []
2454
+ desc:
2455
+ - name: p
2456
+ content: 'This object represents one result of an inline query. Telegram clients currently support results of the following 20 types:'
2457
+ - name: ul
2458
+ content:
2459
+ - InlineQueryResultCachedAudio
2460
+ - InlineQueryResultCachedDocument
2461
+ - InlineQueryResultCachedGif
2462
+ - InlineQueryResultCachedMpeg4Gif
2463
+ - InlineQueryResultCachedPhoto
2464
+ - InlineQueryResultCachedSticker
2465
+ - InlineQueryResultCachedVideo
2466
+ - InlineQueryResultCachedVoice
2467
+ - InlineQueryResultArticle
2468
+ - InlineQueryResultAudio
2469
+ - InlineQueryResultContact
2470
+ - InlineQueryResultGame
2471
+ - InlineQueryResultDocument
2472
+ - InlineQueryResultGif
2473
+ - InlineQueryResultLocation
2474
+ - InlineQueryResultMpeg4Gif
2475
+ - InlineQueryResultPhoto
2476
+ - InlineQueryResultVenue
2477
+ - InlineQueryResultVideo
2478
+ - InlineQueryResultVoice
2479
+ - name: InlineQueryResultArticle
2480
+ children: []
2481
+ desc:
2482
+ - name: p
2483
+ content: Represents a link to an article or web page.
2484
+ table:
2485
+ - Field: type
2486
+ Type: String
2487
+ Description: Type of the result, must be article
2488
+ - Field: id
2489
+ Type: String
2490
+ Description: Unique identifier for this result, 1-64 Bytes
2491
+ - Field: title
2492
+ Type: String
2493
+ Description: Title of the result
2494
+ - Field: input_message_content
2495
+ Type: InputMessageContent
2496
+ Description: Content of the message to be sent
2497
+ - Field: reply_markup
2498
+ Type: InlineKeyboardMarkup
2499
+ Description: Optional. Inline keyboard attached to the message
2500
+ - Field: url
2501
+ Type: String
2502
+ Description: Optional. URL of the result
2503
+ - Field: hide_url
2504
+ Type: Boolean
2505
+ Description: Optional. Pass True, if you don't want the URL to be shown in the message
2506
+ - Field: description
2507
+ Type: String
2508
+ Description: Optional. Short description of the result
2509
+ - Field: thumb_url
2510
+ Type: String
2511
+ Description: Optional. Url of the thumbnail for the result
2512
+ - Field: thumb_width
2513
+ Type: Integer
2514
+ Description: Optional. Thumbnail width
2515
+ - Field: thumb_height
2516
+ Type: Integer
2517
+ Description: Optional. Thumbnail height
2518
+ - name: InlineQueryResultPhoto
2519
+ children: []
2520
+ desc:
2521
+ - name: p
2522
+ content: 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.
2523
+ table:
2524
+ - Field: type
2525
+ Type: String
2526
+ Description: Type of the result, must be photo
2527
+ - Field: id
2528
+ Type: String
2529
+ Description: Unique identifier for this result, 1-64 bytes
2530
+ - Field: photo_url
2531
+ Type: String
2532
+ Description: A valid URL of the photo. Photo must be in jpeg format. Photo size must not exceed 5MB
2533
+ - Field: thumb_url
2534
+ Type: String
2535
+ Description: URL of the thumbnail for the photo
2536
+ - Field: photo_width
2537
+ Type: Integer
2538
+ Description: Optional. Width of the photo
2539
+ - Field: photo_height
2540
+ Type: Integer
2541
+ Description: Optional. Height of the photo
2542
+ - Field: title
2543
+ Type: String
2544
+ Description: Optional. Title for the result
2545
+ - Field: description
2546
+ Type: String
2547
+ Description: Optional. Short description of the result
2548
+ - Field: caption
2549
+ Type: String
2550
+ Description: Optional. Caption of the photo to be sent, 0-1024 characters
2551
+ - Field: parse_mode
2552
+ Type: String
2553
+ Description: Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
2554
+ - Field: reply_markup
2555
+ Type: InlineKeyboardMarkup
2556
+ Description: Optional. Inline keyboard attached to the message
2557
+ - Field: input_message_content
2558
+ Type: InputMessageContent
2559
+ Description: Optional. Content of the message to be sent instead of the photo
2560
+ - name: InlineQueryResultGif
2561
+ children: []
2562
+ desc:
2563
+ - name: p
2564
+ content: 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.
2565
+ table:
2566
+ - Field: type
2567
+ Type: String
2568
+ Description: Type of the result, must be gif
2569
+ - Field: id
2570
+ Type: String
2571
+ Description: Unique identifier for this result, 1-64 bytes
2572
+ - Field: gif_url
2573
+ Type: String
2574
+ Description: A valid URL for the GIF file. File size must not exceed 1MB
2575
+ - Field: gif_width
2576
+ Type: Integer
2577
+ Description: Optional. Width of the GIF
2578
+ - Field: gif_height
2579
+ Type: Integer
2580
+ Description: Optional. Height of the GIF
2581
+ - Field: gif_duration
2582
+ Type: Integer
2583
+ Description: Optional. Duration of the GIF
2584
+ - Field: thumb_url
2585
+ Type: String
2586
+ Description: URL of the static thumbnail for the result (jpeg or gif)
2587
+ - Field: title
2588
+ Type: String
2589
+ Description: Optional. Title for the result
2590
+ - Field: caption
2591
+ Type: String
2592
+ Description: Optional. Caption of the GIF file to be sent, 0-1024 characters
2593
+ - Field: parse_mode
2594
+ Type: String
2595
+ Description: Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
2596
+ - Field: reply_markup
2597
+ Type: InlineKeyboardMarkup
2598
+ Description: Optional. Inline keyboard attached to the message
2599
+ - Field: input_message_content
2600
+ Type: InputMessageContent
2601
+ Description: Optional. Content of the message to be sent instead of the GIF animation
2602
+ - name: InlineQueryResultMpeg4Gif
2603
+ children: []
2604
+ desc:
2605
+ - name: p
2606
+ content: 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.
2607
+ table:
2608
+ - Field: type
2609
+ Type: String
2610
+ Description: Type of the result, must be mpeg4_gif
2611
+ - Field: id
2612
+ Type: String
2613
+ Description: Unique identifier for this result, 1-64 bytes
2614
+ - Field: mpeg4_url
2615
+ Type: String
2616
+ Description: A valid URL for the MP4 file. File size must not exceed 1MB
2617
+ - Field: mpeg4_width
2618
+ Type: Integer
2619
+ Description: Optional. Video width
2620
+ - Field: mpeg4_height
2621
+ Type: Integer
2622
+ Description: Optional. Video height
2623
+ - Field: mpeg4_duration
2624
+ Type: Integer
2625
+ Description: Optional. Video duration
2626
+ - Field: thumb_url
2627
+ Type: String
2628
+ Description: URL of the static thumbnail (jpeg or gif) for the result
2629
+ - Field: title
2630
+ Type: String
2631
+ Description: Optional. Title for the result
2632
+ - Field: caption
2633
+ Type: String
2634
+ Description: Optional. Caption of the MPEG-4 file to be sent, 0-1024 characters
2635
+ - Field: parse_mode
2636
+ Type: String
2637
+ Description: Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
2638
+ - Field: reply_markup
2639
+ Type: InlineKeyboardMarkup
2640
+ Description: Optional. Inline keyboard attached to the message
2641
+ - Field: input_message_content
2642
+ Type: InputMessageContent
2643
+ Description: Optional. Content of the message to be sent instead of the video animation
2644
+ - name: InlineQueryResultVideo
2645
+ children: []
2646
+ desc:
2647
+ - name: p
2648
+ content: 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.
2649
+ - name: blockquote
2650
+ content: If an InlineQueryResultVideo message contains an embedded video (e.g., YouTube), you must replace its content using input_message_content.
2651
+ table:
2652
+ - Field: type
2653
+ Type: String
2654
+ Description: Type of the result, must be video
2655
+ - Field: id
2656
+ Type: String
2657
+ Description: Unique identifier for this result, 1-64 bytes
2658
+ - Field: video_url
2659
+ Type: String
2660
+ Description: A valid URL for the embedded video player or video file
2661
+ - Field: mime_type
2662
+ Type: String
2663
+ Description: Mime type of the content of video url, “text/html” or “video/mp4”
2664
+ - Field: thumb_url
2665
+ Type: String
2666
+ Description: URL of the thumbnail (jpeg only) for the video
2667
+ - Field: title
2668
+ Type: String
2669
+ Description: Title for the result
2670
+ - Field: caption
2671
+ Type: String
2672
+ Description: Optional. Caption of the video to be sent, 0-1024 characters
2673
+ - Field: parse_mode
2674
+ Type: String
2675
+ Description: Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
2676
+ - Field: video_width
2677
+ Type: Integer
2678
+ Description: Optional. Video width
2679
+ - Field: video_height
2680
+ Type: Integer
2681
+ Description: Optional. Video height
2682
+ - Field: video_duration
2683
+ Type: Integer
2684
+ Description: Optional. Video duration in seconds
2685
+ - Field: description
2686
+ Type: String
2687
+ Description: Optional. Short description of the result
2688
+ - Field: reply_markup
2689
+ Type: InlineKeyboardMarkup
2690
+ Description: Optional. Inline keyboard attached to the message
2691
+ - Field: input_message_content
2692
+ Type: InputMessageContent
2693
+ Description: 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).
2694
+ - name: InlineQueryResultAudio
2695
+ children: []
2696
+ desc:
2697
+ - name: p
2698
+ content: 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.
2699
+ - name: p
2700
+ content: 'Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.'
2701
+ table:
2702
+ - Field: type
2703
+ Type: String
2704
+ Description: Type of the result, must be audio
2705
+ - Field: id
2706
+ Type: String
2707
+ Description: Unique identifier for this result, 1-64 bytes
2708
+ - Field: audio_url
2709
+ Type: String
2710
+ Description: A valid URL for the audio file
2711
+ - Field: title
2712
+ Type: String
2713
+ Description: Title
2714
+ - Field: caption
2715
+ Type: String
2716
+ Description: Optional. Caption, 0-1024 characters
2717
+ - Field: parse_mode
2718
+ Type: String
2719
+ Description: Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
2720
+ - Field: performer
2721
+ Type: String
2722
+ Description: Optional. Performer
2723
+ - Field: audio_duration
2724
+ Type: Integer
2725
+ Description: Optional. Audio duration in seconds
2726
+ - Field: reply_markup
2727
+ Type: InlineKeyboardMarkup
2728
+ Description: Optional. Inline keyboard attached to the message
2729
+ - Field: input_message_content
2730
+ Type: InputMessageContent
2731
+ Description: Optional. Content of the message to be sent instead of the audio
2732
+ - name: InlineQueryResultVoice
2733
+ children: []
2734
+ desc:
2735
+ - name: p
2736
+ content: 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.
2737
+ - name: p
2738
+ content: 'Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.'
2739
+ table:
2740
+ - Field: type
2741
+ Type: String
2742
+ Description: Type of the result, must be voice
2743
+ - Field: id
2744
+ Type: String
2745
+ Description: Unique identifier for this result, 1-64 bytes
2746
+ - Field: voice_url
2747
+ Type: String
2748
+ Description: A valid URL for the voice recording
2749
+ - Field: title
2750
+ Type: String
2751
+ Description: Recording title
2752
+ - Field: caption
2753
+ Type: String
2754
+ Description: Optional. Caption, 0-1024 characters
2755
+ - Field: parse_mode
2756
+ Type: String
2757
+ Description: Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
2758
+ - Field: voice_duration
2759
+ Type: Integer
2760
+ Description: Optional. Recording duration in seconds
2761
+ - Field: reply_markup
2762
+ Type: InlineKeyboardMarkup
2763
+ Description: Optional. Inline keyboard attached to the message
2764
+ - Field: input_message_content
2765
+ Type: InputMessageContent
2766
+ Description: Optional. Content of the message to be sent instead of the voice recording
2767
+ - name: InlineQueryResultDocument
2768
+ children: []
2769
+ desc:
2770
+ - name: p
2771
+ content: 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.
2772
+ - name: p
2773
+ content: 'Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.'
2774
+ table:
2775
+ - Field: type
2776
+ Type: String
2777
+ Description: Type of the result, must be document
2778
+ - Field: id
2779
+ Type: String
2780
+ Description: Unique identifier for this result, 1-64 bytes
2781
+ - Field: title
2782
+ Type: String
2783
+ Description: Title for the result
2784
+ - Field: caption
2785
+ Type: String
2786
+ Description: Optional. Caption of the document to be sent, 0-1024 characters
2787
+ - Field: parse_mode
2788
+ Type: String
2789
+ Description: Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
2790
+ - Field: document_url
2791
+ Type: String
2792
+ Description: A valid URL for the file
2793
+ - Field: mime_type
2794
+ Type: String
2795
+ Description: Mime type of the content of the file, either “application/pdf” or “application/zip”
2796
+ - Field: description
2797
+ Type: String
2798
+ Description: Optional. Short description of the result
2799
+ - Field: reply_markup
2800
+ Type: InlineKeyboardMarkup
2801
+ Description: Optional. Inline keyboard attached to the message
2802
+ - Field: input_message_content
2803
+ Type: InputMessageContent
2804
+ Description: Optional. Content of the message to be sent instead of the file
2805
+ - Field: thumb_url
2806
+ Type: String
2807
+ Description: Optional. URL of the thumbnail (jpeg only) for the file
2808
+ - Field: thumb_width
2809
+ Type: Integer
2810
+ Description: Optional. Thumbnail width
2811
+ - Field: thumb_height
2812
+ Type: Integer
2813
+ Description: Optional. Thumbnail height
2814
+ - name: InlineQueryResultLocation
2815
+ children: []
2816
+ desc:
2817
+ - name: p
2818
+ content: 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.
2819
+ - name: p
2820
+ content: 'Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.'
2821
+ table:
2822
+ - Field: type
2823
+ Type: String
2824
+ Description: Type of the result, must be location
2825
+ - Field: id
2826
+ Type: String
2827
+ Description: Unique identifier for this result, 1-64 Bytes
2828
+ - Field: latitude
2829
+ Type: Float number
2830
+ Description: Location latitude in degrees
2831
+ - Field: longitude
2832
+ Type: Float number
2833
+ Description: Location longitude in degrees
2834
+ - Field: title
2835
+ Type: String
2836
+ Description: Location title
2837
+ - Field: live_period
2838
+ Type: Integer
2839
+ Description: Optional. Period in seconds for which the location can be updated, should be between 60 and 86400.
2840
+ - Field: reply_markup
2841
+ Type: InlineKeyboardMarkup
2842
+ Description: Optional. Inline keyboard attached to the message
2843
+ - Field: input_message_content
2844
+ Type: InputMessageContent
2845
+ Description: Optional. Content of the message to be sent instead of the location
2846
+ - Field: thumb_url
2847
+ Type: String
2848
+ Description: Optional. Url of the thumbnail for the result
2849
+ - Field: thumb_width
2850
+ Type: Integer
2851
+ Description: Optional. Thumbnail width
2852
+ - Field: thumb_height
2853
+ Type: Integer
2854
+ Description: Optional. Thumbnail height
2855
+ - name: InlineQueryResultVenue
2856
+ children: []
2857
+ desc:
2858
+ - name: p
2859
+ content: 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.
2860
+ - name: p
2861
+ content: 'Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.'
2862
+ table:
2863
+ - Field: type
2864
+ Type: String
2865
+ Description: Type of the result, must be venue
2866
+ - Field: id
2867
+ Type: String
2868
+ Description: Unique identifier for this result, 1-64 Bytes
2869
+ - Field: latitude
2870
+ Type: Float
2871
+ Description: Latitude of the venue location in degrees
2872
+ - Field: longitude
2873
+ Type: Float
2874
+ Description: Longitude of the venue location in degrees
2875
+ - Field: title
2876
+ Type: String
2877
+ Description: Title of the venue
2878
+ - Field: address
2879
+ Type: String
2880
+ Description: Address of the venue
2881
+ - Field: foursquare_id
2882
+ Type: String
2883
+ Description: Optional. Foursquare identifier of the venue if known
2884
+ - Field: foursquare_type
2885
+ Type: String
2886
+ Description: Optional. Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.)
2887
+ - Field: reply_markup
2888
+ Type: InlineKeyboardMarkup
2889
+ Description: Optional. Inline keyboard attached to the message
2890
+ - Field: input_message_content
2891
+ Type: InputMessageContent
2892
+ Description: Optional. Content of the message to be sent instead of the venue
2893
+ - Field: thumb_url
2894
+ Type: String
2895
+ Description: Optional. Url of the thumbnail for the result
2896
+ - Field: thumb_width
2897
+ Type: Integer
2898
+ Description: Optional. Thumbnail width
2899
+ - Field: thumb_height
2900
+ Type: Integer
2901
+ Description: Optional. Thumbnail height
2902
+ - name: InlineQueryResultContact
2903
+ children: []
2904
+ desc:
2905
+ - name: p
2906
+ content: 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.
2907
+ - name: p
2908
+ content: 'Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.'
2909
+ table:
2910
+ - Field: type
2911
+ Type: String
2912
+ Description: Type of the result, must be contact
2913
+ - Field: id
2914
+ Type: String
2915
+ Description: Unique identifier for this result, 1-64 Bytes
2916
+ - Field: phone_number
2917
+ Type: String
2918
+ Description: Contact's phone number
2919
+ - Field: first_name
2920
+ Type: String
2921
+ Description: Contact's first name
2922
+ - Field: last_name
2923
+ Type: String
2924
+ Description: Optional. Contact's last name
2925
+ - Field: vcard
2926
+ Type: String
2927
+ Description: Optional. Additional data about the contact in the form of a vCard, 0-2048 bytes
2928
+ - Field: reply_markup
2929
+ Type: InlineKeyboardMarkup
2930
+ Description: Optional. Inline keyboard attached to the message
2931
+ - Field: input_message_content
2932
+ Type: InputMessageContent
2933
+ Description: Optional. Content of the message to be sent instead of the contact
2934
+ - Field: thumb_url
2935
+ Type: String
2936
+ Description: Optional. Url of the thumbnail for the result
2937
+ - Field: thumb_width
2938
+ Type: Integer
2939
+ Description: Optional. Thumbnail width
2940
+ - Field: thumb_height
2941
+ Type: Integer
2942
+ Description: Optional. Thumbnail height
2943
+ - name: InlineQueryResultGame
2944
+ children: []
2945
+ desc:
2946
+ - name: p
2947
+ content: Represents a Game.
2948
+ - name: p
2949
+ content: 'Note: This will only work in Telegram versions released after October 1, 2016. Older clients will not display any inline results if a game result is among them.'
2950
+ table:
2951
+ - Field: type
2952
+ Type: String
2953
+ Description: Type of the result, must be game
2954
+ - Field: id
2955
+ Type: String
2956
+ Description: Unique identifier for this result, 1-64 bytes
2957
+ - Field: game_short_name
2958
+ Type: String
2959
+ Description: Short name of the game
2960
+ - Field: reply_markup
2961
+ Type: InlineKeyboardMarkup
2962
+ Description: Optional. Inline keyboard attached to the message
2963
+ - name: InlineQueryResultCachedPhoto
2964
+ children: []
2965
+ desc:
2966
+ - name: p
2967
+ content: 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.
2968
+ table:
2969
+ - Field: type
2970
+ Type: String
2971
+ Description: Type of the result, must be photo
2972
+ - Field: id
2973
+ Type: String
2974
+ Description: Unique identifier for this result, 1-64 bytes
2975
+ - Field: photo_file_id
2976
+ Type: String
2977
+ Description: A valid file identifier of the photo
2978
+ - Field: title
2979
+ Type: String
2980
+ Description: Optional. Title for the result
2981
+ - Field: description
2982
+ Type: String
2983
+ Description: Optional. Short description of the result
2984
+ - Field: caption
2985
+ Type: String
2986
+ Description: Optional. Caption of the photo to be sent, 0-1024 characters
2987
+ - Field: parse_mode
2988
+ Type: String
2989
+ Description: Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
2990
+ - Field: reply_markup
2991
+ Type: InlineKeyboardMarkup
2992
+ Description: Optional. Inline keyboard attached to the message
2993
+ - Field: input_message_content
2994
+ Type: InputMessageContent
2995
+ Description: Optional. Content of the message to be sent instead of the photo
2996
+ - name: InlineQueryResultCachedGif
2997
+ children: []
2998
+ desc:
2999
+ - name: p
3000
+ content: 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.
3001
+ table:
3002
+ - Field: type
3003
+ Type: String
3004
+ Description: Type of the result, must be gif
3005
+ - Field: id
3006
+ Type: String
3007
+ Description: Unique identifier for this result, 1-64 bytes
3008
+ - Field: gif_file_id
3009
+ Type: String
3010
+ Description: A valid file identifier for the GIF file
3011
+ - Field: title
3012
+ Type: String
3013
+ Description: Optional. Title for the result
3014
+ - Field: caption
3015
+ Type: String
3016
+ Description: Optional. Caption of the GIF file to be sent, 0-1024 characters
3017
+ - Field: parse_mode
3018
+ Type: String
3019
+ Description: Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
3020
+ - Field: reply_markup
3021
+ Type: InlineKeyboardMarkup
3022
+ Description: Optional. Inline keyboard attached to the message
3023
+ - Field: input_message_content
3024
+ Type: InputMessageContent
3025
+ Description: Optional. Content of the message to be sent instead of the GIF animation
3026
+ - name: InlineQueryResultCachedMpeg4Gif
3027
+ children: []
3028
+ desc:
3029
+ - name: p
3030
+ content: 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.
3031
+ table:
3032
+ - Field: type
3033
+ Type: String
3034
+ Description: Type of the result, must be mpeg4_gif
3035
+ - Field: id
3036
+ Type: String
3037
+ Description: Unique identifier for this result, 1-64 bytes
3038
+ - Field: mpeg4_file_id
3039
+ Type: String
3040
+ Description: A valid file identifier for the MP4 file
3041
+ - Field: title
3042
+ Type: String
3043
+ Description: Optional. Title for the result
3044
+ - Field: caption
3045
+ Type: String
3046
+ Description: Optional. Caption of the MPEG-4 file to be sent, 0-1024 characters
3047
+ - Field: parse_mode
3048
+ Type: String
3049
+ Description: Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
3050
+ - Field: reply_markup
3051
+ Type: InlineKeyboardMarkup
3052
+ Description: Optional. Inline keyboard attached to the message
3053
+ - Field: input_message_content
3054
+ Type: InputMessageContent
3055
+ Description: Optional. Content of the message to be sent instead of the video animation
3056
+ - name: InlineQueryResultCachedSticker
3057
+ children: []
3058
+ desc:
3059
+ - name: p
3060
+ content: 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.
3061
+ - name: p
3062
+ content: 'Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.'
3063
+ table:
3064
+ - Field: type
3065
+ Type: String
3066
+ Description: Type of the result, must be sticker
3067
+ - Field: id
3068
+ Type: String
3069
+ Description: Unique identifier for this result, 1-64 bytes
3070
+ - Field: sticker_file_id
3071
+ Type: String
3072
+ Description: A valid file identifier of the sticker
3073
+ - Field: reply_markup
3074
+ Type: InlineKeyboardMarkup
3075
+ Description: Optional. Inline keyboard attached to the message
3076
+ - Field: input_message_content
3077
+ Type: InputMessageContent
3078
+ Description: Optional. Content of the message to be sent instead of the sticker
3079
+ - name: InlineQueryResultCachedDocument
3080
+ children: []
3081
+ desc:
3082
+ - name: p
3083
+ content: 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.
3084
+ - name: p
3085
+ content: 'Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.'
3086
+ table:
3087
+ - Field: type
3088
+ Type: String
3089
+ Description: Type of the result, must be document
3090
+ - Field: id
3091
+ Type: String
3092
+ Description: Unique identifier for this result, 1-64 bytes
3093
+ - Field: title
3094
+ Type: String
3095
+ Description: Title for the result
3096
+ - Field: document_file_id
3097
+ Type: String
3098
+ Description: A valid file identifier for the file
3099
+ - Field: description
3100
+ Type: String
3101
+ Description: Optional. Short description of the result
3102
+ - Field: caption
3103
+ Type: String
3104
+ Description: Optional. Caption of the document to be sent, 0-1024 characters
3105
+ - Field: parse_mode
3106
+ Type: String
3107
+ Description: Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
3108
+ - Field: reply_markup
3109
+ Type: InlineKeyboardMarkup
3110
+ Description: Optional. Inline keyboard attached to the message
3111
+ - Field: input_message_content
3112
+ Type: InputMessageContent
3113
+ Description: Optional. Content of the message to be sent instead of the file
3114
+ - name: InlineQueryResultCachedVideo
3115
+ children: []
3116
+ desc:
3117
+ - name: p
3118
+ content: 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.
3119
+ table:
3120
+ - Field: type
3121
+ Type: String
3122
+ Description: Type of the result, must be video
3123
+ - Field: id
3124
+ Type: String
3125
+ Description: Unique identifier for this result, 1-64 bytes
3126
+ - Field: video_file_id
3127
+ Type: String
3128
+ Description: A valid file identifier for the video file
3129
+ - Field: title
3130
+ Type: String
3131
+ Description: Title for the result
3132
+ - Field: description
3133
+ Type: String
3134
+ Description: Optional. Short description of the result
3135
+ - Field: caption
3136
+ Type: String
3137
+ Description: Optional. Caption of the video to be sent, 0-1024 characters
3138
+ - Field: parse_mode
3139
+ Type: String
3140
+ Description: Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
3141
+ - Field: reply_markup
3142
+ Type: InlineKeyboardMarkup
3143
+ Description: Optional. Inline keyboard attached to the message
3144
+ - Field: input_message_content
3145
+ Type: InputMessageContent
3146
+ Description: Optional. Content of the message to be sent instead of the video
3147
+ - name: InlineQueryResultCachedVoice
3148
+ children: []
3149
+ desc:
3150
+ - name: p
3151
+ content: 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.
3152
+ - name: p
3153
+ content: 'Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.'
3154
+ table:
3155
+ - Field: type
3156
+ Type: String
3157
+ Description: Type of the result, must be voice
3158
+ - Field: id
3159
+ Type: String
3160
+ Description: Unique identifier for this result, 1-64 bytes
3161
+ - Field: voice_file_id
3162
+ Type: String
3163
+ Description: A valid file identifier for the voice message
3164
+ - Field: title
3165
+ Type: String
3166
+ Description: Voice message title
3167
+ - Field: caption
3168
+ Type: String
3169
+ Description: Optional. Caption, 0-1024 characters
3170
+ - Field: parse_mode
3171
+ Type: String
3172
+ Description: Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
3173
+ - Field: reply_markup
3174
+ Type: InlineKeyboardMarkup
3175
+ Description: Optional. Inline keyboard attached to the message
3176
+ - Field: input_message_content
3177
+ Type: InputMessageContent
3178
+ Description: Optional. Content of the message to be sent instead of the voice message
3179
+ - name: InlineQueryResultCachedAudio
3180
+ children: []
3181
+ desc:
3182
+ - name: p
3183
+ content: 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.
3184
+ - name: p
3185
+ content: 'Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.'
3186
+ table:
3187
+ - Field: type
3188
+ Type: String
3189
+ Description: Type of the result, must be audio
3190
+ - Field: id
3191
+ Type: String
3192
+ Description: Unique identifier for this result, 1-64 bytes
3193
+ - Field: audio_file_id
3194
+ Type: String
3195
+ Description: A valid file identifier for the audio file
3196
+ - Field: caption
3197
+ Type: String
3198
+ Description: Optional. Caption, 0-1024 characters
3199
+ - Field: parse_mode
3200
+ Type: String
3201
+ Description: Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
3202
+ - Field: reply_markup
3203
+ Type: InlineKeyboardMarkup
3204
+ Description: Optional. Inline keyboard attached to the message
3205
+ - Field: input_message_content
3206
+ Type: InputMessageContent
3207
+ Description: Optional. Content of the message to be sent instead of the audio
3208
+ - name: InputMessageContent
3209
+ children: []
3210
+ desc:
3211
+ - name: p
3212
+ content: 'This object represents the content of a message to be sent as a result of an inline query. Telegram clients currently support the following 4 types:'
3213
+ - name: ul
3214
+ content:
3215
+ - InputTextMessageContent
3216
+ - InputLocationMessageContent
3217
+ - InputVenueMessageContent
3218
+ - InputContactMessageContent
3219
+ - name: InputTextMessageContent
3220
+ children: []
3221
+ desc:
3222
+ - name: p
3223
+ content: Represents the content of a text message to be sent as the result of an inline query.
3224
+ table:
3225
+ - Field: message_text
3226
+ Type: String
3227
+ Description: Text of the message to be sent, 1-4096 characters
3228
+ - Field: parse_mode
3229
+ Type: String
3230
+ Description: Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in your bot's message.
3231
+ - Field: disable_web_page_preview
3232
+ Type: Boolean
3233
+ Description: Optional. Disables link previews for links in the sent message
3234
+ - name: InputLocationMessageContent
3235
+ children: []
3236
+ desc:
3237
+ - name: p
3238
+ content: Represents the content of a location message to be sent as the result of an inline query.
3239
+ table:
3240
+ - Field: latitude
3241
+ Type: Float
3242
+ Description: Latitude of the location in degrees
3243
+ - Field: longitude
3244
+ Type: Float
3245
+ Description: Longitude of the location in degrees
3246
+ - Field: live_period
3247
+ Type: Integer
3248
+ Description: Optional. Period in seconds for which the location can be updated, should be between 60 and 86400.
3249
+ - name: InputVenueMessageContent
3250
+ children: []
3251
+ desc:
3252
+ - name: p
3253
+ content: Represents the content of a venue message to be sent as the result of an inline query.
3254
+ table:
3255
+ - Field: latitude
3256
+ Type: Float
3257
+ Description: Latitude of the venue in degrees
3258
+ - Field: longitude
3259
+ Type: Float
3260
+ Description: Longitude of the venue in degrees
3261
+ - Field: title
3262
+ Type: String
3263
+ Description: Name of the venue
3264
+ - Field: address
3265
+ Type: String
3266
+ Description: Address of the venue
3267
+ - Field: foursquare_id
3268
+ Type: String
3269
+ Description: Optional. Foursquare identifier of the venue, if known
3270
+ - Field: foursquare_type
3271
+ Type: String
3272
+ Description: Optional. Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.)
3273
+ - name: InputContactMessageContent
3274
+ children: []
3275
+ desc:
3276
+ - name: p
3277
+ content: Represents the content of a contact message to be sent as the result of an inline query.
3278
+ table:
3279
+ - Field: phone_number
3280
+ Type: String
3281
+ Description: Contact's phone number
3282
+ - Field: first_name
3283
+ Type: String
3284
+ Description: Contact's first name
3285
+ - Field: last_name
3286
+ Type: String
3287
+ Description: Optional. Contact's last name
3288
+ - Field: vcard
3289
+ Type: String
3290
+ Description: Optional. Additional data about the contact in the form of a vCard, 0-2048 bytes
3291
+ - name: ChosenInlineResult
3292
+ children: []
3293
+ desc:
3294
+ - name: p
3295
+ content: Represents a result of an inline query that was chosen by the user and sent to their chat partner.
3296
+ - name: p
3297
+ content: 'Note: It is necessary to enable inline feedback via @Botfather in order to receive these objects in updates.'
3298
+ table:
3299
+ - Field: result_id
3300
+ Type: String
3301
+ Description: The unique identifier for the result that was chosen
3302
+ - Field: from
3303
+ Type: User
3304
+ Description: The user that chose the result
3305
+ - Field: location
3306
+ Type: Location
3307
+ Description: Optional. Sender location, only for bots that require user location
3308
+ - Field: inline_message_id
3309
+ Type: String
3310
+ Description: 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.
3311
+ - Field: query
3312
+ Type: String
3313
+ Description: The query that was used to obtain the result
3314
+ desc:
3315
+ - name: p
3316
+ content: The following methods and objects allow your bot to work in inline mode.Please see our Introduction to Inline bots for more details.
3317
+ - name: p
3318
+ content: 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.
3319
+ - name: Payments
3320
+ children:
3321
+ - name: sendInvoice
3322
+ children: []
3323
+ desc:
3324
+ - name: p
3325
+ content: Use this method to send invoices. On success, the sent Message is returned.
3326
+ table:
3327
+ - Parameter: chat_id
3328
+ Type: Integer
3329
+ Required: 'Yes'
3330
+ Description: Unique identifier for the target private chat
3331
+ - Parameter: title
3332
+ Type: String
3333
+ Required: 'Yes'
3334
+ Description: Product name, 1-32 characters
3335
+ - Parameter: description
3336
+ Type: String
3337
+ Required: 'Yes'
3338
+ Description: Product description, 1-255 characters
3339
+ - Parameter: payload
3340
+ Type: String
3341
+ Required: 'Yes'
3342
+ Description: Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes.
3343
+ - Parameter: provider_token
3344
+ Type: String
3345
+ Required: 'Yes'
3346
+ Description: Payments provider token, obtained via Botfather
3347
+ - Parameter: start_parameter
3348
+ Type: String
3349
+ Required: 'Yes'
3350
+ Description: Unique deep-linking parameter that can be used to generate this invoice when used as a start parameter
3351
+ - Parameter: currency
3352
+ Type: String
3353
+ Required: 'Yes'
3354
+ Description: Three-letter ISO 4217 currency code, see more on currencies
3355
+ - Parameter: prices
3356
+ Type: Array of LabeledPrice
3357
+ Required: 'Yes'
3358
+ Description: Price breakdown, a list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)
3359
+ - Parameter: provider_data
3360
+ Type: String
3361
+ Required: Optional
3362
+ Description: JSON-encoded 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.
3363
+ - Parameter: photo_url
3364
+ Type: String
3365
+ Required: Optional
3366
+ Description: 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.
3367
+ - Parameter: photo_size
3368
+ Type: Integer
3369
+ Required: Optional
3370
+ Description: Photo size
3371
+ - Parameter: photo_width
3372
+ Type: Integer
3373
+ Required: Optional
3374
+ Description: Photo width
3375
+ - Parameter: photo_height
3376
+ Type: Integer
3377
+ Required: Optional
3378
+ Description: Photo height
3379
+ - Parameter: need_name
3380
+ Type: Boolean
3381
+ Required: Optional
3382
+ Description: Pass True, if you require the user's full name to complete the order
3383
+ - Parameter: need_phone_number
3384
+ Type: Boolean
3385
+ Required: Optional
3386
+ Description: Pass True, if you require the user's phone number to complete the order
3387
+ - Parameter: need_email
3388
+ Type: Boolean
3389
+ Required: Optional
3390
+ Description: Pass True, if you require the user's email address to complete the order
3391
+ - Parameter: need_shipping_address
3392
+ Type: Boolean
3393
+ Required: Optional
3394
+ Description: Pass True, if you require the user's shipping address to complete the order
3395
+ - Parameter: send_phone_number_to_provider
3396
+ Type: Boolean
3397
+ Required: Optional
3398
+ Description: Pass True, if user's phone number should be sent to provider
3399
+ - Parameter: send_email_to_provider
3400
+ Type: Boolean
3401
+ Required: Optional
3402
+ Description: Pass True, if user's email address should be sent to provider
3403
+ - Parameter: is_flexible
3404
+ Type: Boolean
3405
+ Required: Optional
3406
+ Description: Pass True, if the final price depends on the shipping method
3407
+ - Parameter: disable_notification
3408
+ Type: Boolean
3409
+ Required: Optional
3410
+ Description: Sends the message silently. Users will receive a notification with no sound.
3411
+ - Parameter: reply_to_message_id
3412
+ Type: Integer
3413
+ Required: Optional
3414
+ Description: If the message is a reply, ID of the original message
3415
+ - Parameter: reply_markup
3416
+ Type: InlineKeyboardMarkup
3417
+ Required: Optional
3418
+ Description: 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.
3419
+ - name: answerShippingQuery
3420
+ children: []
3421
+ desc:
3422
+ - name: p
3423
+ content: 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.
3424
+ table:
3425
+ - Parameter: shipping_query_id
3426
+ Type: String
3427
+ Required: 'Yes'
3428
+ Description: Unique identifier for the query to be answered
3429
+ - Parameter: ok
3430
+ Type: Boolean
3431
+ Required: 'Yes'
3432
+ Description: Specify 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)
3433
+ - Parameter: shipping_options
3434
+ Type: Array of ShippingOption
3435
+ Required: Optional
3436
+ Description: Required if ok is True. A JSON-serialized array of available shipping options.
3437
+ - Parameter: error_message
3438
+ Type: String
3439
+ Required: Optional
3440
+ Description: 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.
3441
+ - name: answerPreCheckoutQuery
3442
+ children: []
3443
+ desc:
3444
+ - name: p
3445
+ content: '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.'
3446
+ table:
3447
+ - Parameter: pre_checkout_query_id
3448
+ Type: String
3449
+ Required: 'Yes'
3450
+ Description: Unique identifier for the query to be answered
3451
+ - Parameter: ok
3452
+ Type: Boolean
3453
+ Required: 'Yes'
3454
+ Description: 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.
3455
+ - Parameter: error_message
3456
+ Type: String
3457
+ Required: Optional
3458
+ Description: 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.
3459
+ - name: LabeledPrice
3460
+ children: []
3461
+ desc:
3462
+ - name: p
3463
+ content: This object represents a portion of the price for goods or services.
3464
+ table:
3465
+ - Field: label
3466
+ Type: String
3467
+ Description: Portion label
3468
+ - Field: amount
3469
+ Type: Integer
3470
+ Description: 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).
3471
+ - name: Invoice
3472
+ children: []
3473
+ desc:
3474
+ - name: p
3475
+ content: This object contains basic information about an invoice.
3476
+ table:
3477
+ - Field: title
3478
+ Type: String
3479
+ Description: Product name
3480
+ - Field: description
3481
+ Type: String
3482
+ Description: Product description
3483
+ - Field: start_parameter
3484
+ Type: String
3485
+ Description: Unique bot deep-linking parameter that can be used to generate this invoice
3486
+ - Field: currency
3487
+ Type: String
3488
+ Description: Three-letter ISO 4217 currency code
3489
+ - Field: total_amount
3490
+ Type: Integer
3491
+ Description: 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).
3492
+ - name: ShippingAddress
3493
+ children: []
3494
+ desc:
3495
+ - name: p
3496
+ content: This object represents a shipping address.
3497
+ table:
3498
+ - Field: country_code
3499
+ Type: String
3500
+ Description: ISO 3166-1 alpha-2 country code
3501
+ - Field: state
3502
+ Type: String
3503
+ Description: State, if applicable
3504
+ - Field: city
3505
+ Type: String
3506
+ Description: City
3507
+ - Field: street_line1
3508
+ Type: String
3509
+ Description: First line for the address
3510
+ - Field: street_line2
3511
+ Type: String
3512
+ Description: Second line for the address
3513
+ - Field: post_code
3514
+ Type: String
3515
+ Description: Address post code
3516
+ - name: OrderInfo
3517
+ children: []
3518
+ desc:
3519
+ - name: p
3520
+ content: This object represents information about an order.
3521
+ table:
3522
+ - Field: name
3523
+ Type: String
3524
+ Description: Optional. User name
3525
+ - Field: phone_number
3526
+ Type: String
3527
+ Description: Optional. User's phone number
3528
+ - Field: email
3529
+ Type: String
3530
+ Description: Optional. User email
3531
+ - Field: shipping_address
3532
+ Type: ShippingAddress
3533
+ Description: Optional. User shipping address
3534
+ - name: ShippingOption
3535
+ children: []
3536
+ desc:
3537
+ - name: p
3538
+ content: This object represents one shipping option.
3539
+ table:
3540
+ - Field: id
3541
+ Type: String
3542
+ Description: Shipping option identifier
3543
+ - Field: title
3544
+ Type: String
3545
+ Description: Option title
3546
+ - Field: prices
3547
+ Type: Array of LabeledPrice
3548
+ Description: List of price portions
3549
+ - name: SuccessfulPayment
3550
+ children: []
3551
+ desc:
3552
+ - name: p
3553
+ content: This object contains basic information about a successful payment.
3554
+ table:
3555
+ - Field: currency
3556
+ Type: String
3557
+ Description: Three-letter ISO 4217 currency code
3558
+ - Field: total_amount
3559
+ Type: Integer
3560
+ Description: 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).
3561
+ - Field: invoice_payload
3562
+ Type: String
3563
+ Description: Bot specified invoice payload
3564
+ - Field: shipping_option_id
3565
+ Type: String
3566
+ Description: Optional. Identifier of the shipping option chosen by the user
3567
+ - Field: order_info
3568
+ Type: OrderInfo
3569
+ Description: Optional. Order info provided by the user
3570
+ - Field: telegram_payment_charge_id
3571
+ Type: String
3572
+ Description: Telegram payment identifier
3573
+ - Field: provider_payment_charge_id
3574
+ Type: String
3575
+ Description: Provider payment identifier
3576
+ - name: ShippingQuery
3577
+ children: []
3578
+ desc:
3579
+ - name: p
3580
+ content: This object contains information about an incoming shipping query.
3581
+ table:
3582
+ - Field: id
3583
+ Type: String
3584
+ Description: Unique query identifier
3585
+ - Field: from
3586
+ Type: User
3587
+ Description: User who sent the query
3588
+ - Field: invoice_payload
3589
+ Type: String
3590
+ Description: Bot specified invoice payload
3591
+ - Field: shipping_address
3592
+ Type: ShippingAddress
3593
+ Description: User specified shipping address
3594
+ - name: PreCheckoutQuery
3595
+ children: []
3596
+ desc:
3597
+ - name: p
3598
+ content: This object contains information about an incoming pre-checkout query.
3599
+ table:
3600
+ - Field: id
3601
+ Type: String
3602
+ Description: Unique query identifier
3603
+ - Field: from
3604
+ Type: User
3605
+ Description: User who sent the query
3606
+ - Field: currency
3607
+ Type: String
3608
+ Description: Three-letter ISO 4217 currency code
3609
+ - Field: total_amount
3610
+ Type: Integer
3611
+ Description: 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).
3612
+ - Field: invoice_payload
3613
+ Type: String
3614
+ Description: Bot specified invoice payload
3615
+ - Field: shipping_option_id
3616
+ Type: String
3617
+ Description: Optional. Identifier of the shipping option chosen by the user
3618
+ - Field: order_info
3619
+ Type: OrderInfo
3620
+ Description: Optional. Order info provided by the user
3621
+ desc:
3622
+ - name: p
3623
+ content: 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. Please note that users will need Telegram v.4.0 or higher to use payments (released on May 18, 2017).
3624
+ - name: Telegram Passport
3625
+ children:
3626
+ - name: PassportData
3627
+ children: []
3628
+ desc:
3629
+ - name: p
3630
+ content: Contains information about Telegram Passport data shared with the bot by the user.
3631
+ table:
3632
+ - Field: data
3633
+ Type: Array of EncryptedPassportElement
3634
+ Description: Array with information about documents and other Telegram Passport elements that was shared with the bot
3635
+ - Field: credentials
3636
+ Type: EncryptedCredentials
3637
+ Description: Encrypted credentials required to decrypt the data
3638
+ - name: PassportFile
3639
+ children: []
3640
+ desc:
3641
+ - name: p
3642
+ content: 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.
3643
+ table:
3644
+ - Field: file_id
3645
+ Type: String
3646
+ Description: Unique identifier for this file
3647
+ - Field: file_size
3648
+ Type: Integer
3649
+ Description: File size
3650
+ - Field: file_date
3651
+ Type: Integer
3652
+ Description: Unix time when the file was uploaded
3653
+ - name: EncryptedPassportElement
3654
+ children: []
3655
+ desc:
3656
+ - name: p
3657
+ content: Contains information about documents or other Telegram Passport elements shared with the bot by the user.
3658
+ table:
3659
+ - Field: type
3660
+ Type: String
3661
+ Description: 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”.
3662
+ - Field: data
3663
+ Type: String
3664
+ Description: Optional. Base64-encoded encrypted Telegram Passport element data provided by the user, available for “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport” and “address” types. Can be decrypted and verified using the accompanying EncryptedCredentials.
3665
+ - Field: phone_number
3666
+ Type: String
3667
+ Description: Optional. User's verified phone number, available only for “phone_number” type
3668
+ - Field: email
3669
+ Type: String
3670
+ Description: Optional. User's verified email address, available only for “email” type
3671
+ - Field: files
3672
+ Type: Array of PassportFile
3673
+ Description: Optional. Array of encrypted files with documents provided by the user, available for “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration” and “temporary_registration” types. Files can be decrypted and verified using the accompanying EncryptedCredentials.
3674
+ - Field: front_side
3675
+ Type: PassportFile
3676
+ Description: Optional. Encrypted file with the front side of the document, provided by the user. Available for “passport”, “driver_license”, “identity_card” and “internal_passport”. The file can be decrypted and verified using the accompanying EncryptedCredentials.
3677
+ - Field: reverse_side
3678
+ Type: PassportFile
3679
+ Description: Optional. Encrypted file with the reverse side of the document, provided by the user. Available for “driver_license” and “identity_card”. The file can be decrypted and verified using the accompanying EncryptedCredentials.
3680
+ - Field: selfie
3681
+ Type: PassportFile
3682
+ Description: Optional. Encrypted file with the selfie of the user holding a document, provided by the user; available for “passport”, “driver_license”, “identity_card” and “internal_passport”. The file can be decrypted and verified using the accompanying EncryptedCredentials.
3683
+ - Field: translation
3684
+ Type: Array of PassportFile
3685
+ Description: 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.
3686
+ - Field: hash
3687
+ Type: String
3688
+ Description: Base64-encoded element hash for using in PassportElementErrorUnspecified
3689
+ - name: EncryptedCredentials
3690
+ children: []
3691
+ desc:
3692
+ - name: p
3693
+ content: Contains data required for decrypting and authenticating EncryptedPassportElement. See the Telegram Passport Documentation for a complete description of the data decryption and authentication processes.
3694
+ table:
3695
+ - Field: data
3696
+ Type: String
3697
+ Description: Base64-encoded encrypted JSON-serialized data with unique user's payload, data hashes and secrets required for EncryptedPassportElement decryption and authentication
3698
+ - Field: hash
3699
+ Type: String
3700
+ Description: Base64-encoded data hash for data authentication
3701
+ - Field: secret
3702
+ Type: String
3703
+ Description: Base64-encoded secret, encrypted with the bot's public RSA key, required for data decryption
3704
+ - name: setPassportDataErrors
3705
+ children: []
3706
+ desc:
3707
+ - name: p
3708
+ content: 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.
3709
+ - name: p
3710
+ content: 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.
3711
+ table:
3712
+ - Parameter: user_id
3713
+ Type: Integer
3714
+ Required: 'Yes'
3715
+ Description: User identifier
3716
+ - Parameter: errors
3717
+ Type: Array of PassportElementError
3718
+ Required: 'Yes'
3719
+ Description: A JSON-serialized array describing the errors
3720
+ - name: PassportElementError
3721
+ children: []
3722
+ desc:
3723
+ - name: p
3724
+ content: '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:'
3725
+ - name: ul
3726
+ content:
3727
+ - PassportElementErrorDataField
3728
+ - PassportElementErrorFrontSide
3729
+ - PassportElementErrorReverseSide
3730
+ - PassportElementErrorSelfie
3731
+ - PassportElementErrorFile
3732
+ - PassportElementErrorFiles
3733
+ - PassportElementErrorTranslationFile
3734
+ - PassportElementErrorTranslationFiles
3735
+ - PassportElementErrorUnspecified
3736
+ - name: PassportElementErrorDataField
3737
+ children: []
3738
+ desc:
3739
+ - name: p
3740
+ content: 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.
3741
+ table:
3742
+ - Field: source
3743
+ Type: String
3744
+ Description: Error source, must be data
3745
+ - Field: type
3746
+ Type: String
3747
+ Description: The section of the user's Telegram Passport which has the error, one of “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport”, “address”
3748
+ - Field: field_name
3749
+ Type: String
3750
+ Description: Name of the data field which has the error
3751
+ - Field: data_hash
3752
+ Type: String
3753
+ Description: Base64-encoded data hash
3754
+ - Field: message
3755
+ Type: String
3756
+ Description: Error message
3757
+ - name: PassportElementErrorFrontSide
3758
+ children: []
3759
+ desc:
3760
+ - name: p
3761
+ content: 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.
3762
+ table:
3763
+ - Field: source
3764
+ Type: String
3765
+ Description: Error source, must be front_side
3766
+ - Field: type
3767
+ Type: String
3768
+ Description: The section of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport”
3769
+ - Field: file_hash
3770
+ Type: String
3771
+ Description: Base64-encoded hash of the file with the front side of the document
3772
+ - Field: message
3773
+ Type: String
3774
+ Description: Error message
3775
+ - name: PassportElementErrorReverseSide
3776
+ children: []
3777
+ desc:
3778
+ - name: p
3779
+ content: 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.
3780
+ table:
3781
+ - Field: source
3782
+ Type: String
3783
+ Description: Error source, must be reverse_side
3784
+ - Field: type
3785
+ Type: String
3786
+ Description: The section of the user's Telegram Passport which has the issue, one of “driver_license”, “identity_card”
3787
+ - Field: file_hash
3788
+ Type: String
3789
+ Description: Base64-encoded hash of the file with the reverse side of the document
3790
+ - Field: message
3791
+ Type: String
3792
+ Description: Error message
3793
+ - name: PassportElementErrorSelfie
3794
+ children: []
3795
+ desc:
3796
+ - name: p
3797
+ content: Represents an issue with the selfie with a document. The error is considered resolved when the file with the selfie changes.
3798
+ table:
3799
+ - Field: source
3800
+ Type: String
3801
+ Description: Error source, must be selfie
3802
+ - Field: type
3803
+ Type: String
3804
+ Description: The section of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport”
3805
+ - Field: file_hash
3806
+ Type: String
3807
+ Description: Base64-encoded hash of the file with the selfie
3808
+ - Field: message
3809
+ Type: String
3810
+ Description: Error message
3811
+ - name: PassportElementErrorFile
3812
+ children: []
3813
+ desc:
3814
+ - name: p
3815
+ content: Represents an issue with a document scan. The error is considered resolved when the file with the document scan changes.
3816
+ table:
3817
+ - Field: source
3818
+ Type: String
3819
+ Description: Error source, must be file
3820
+ - Field: type
3821
+ Type: String
3822
+ Description: The section of the user's Telegram Passport which has the issue, one of “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”
3823
+ - Field: file_hash
3824
+ Type: String
3825
+ Description: Base64-encoded file hash
3826
+ - Field: message
3827
+ Type: String
3828
+ Description: Error message
3829
+ - name: PassportElementErrorFiles
3830
+ children: []
3831
+ desc:
3832
+ - name: p
3833
+ content: Represents an issue with a list of scans. The error is considered resolved when the list of files containing the scans changes.
3834
+ table:
3835
+ - Field: source
3836
+ Type: String
3837
+ Description: Error source, must be files
3838
+ - Field: type
3839
+ Type: String
3840
+ Description: The section of the user's Telegram Passport which has the issue, one of “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”
3841
+ - Field: file_hashes
3842
+ Type: Array of String
3843
+ Description: List of base64-encoded file hashes
3844
+ - Field: message
3845
+ Type: String
3846
+ Description: Error message
3847
+ - name: PassportElementErrorTranslationFile
3848
+ children: []
3849
+ desc:
3850
+ - name: p
3851
+ content: Represents an issue with one of the files that constitute the translation of a document. The error is considered resolved when the file changes.
3852
+ table:
3853
+ - Field: source
3854
+ Type: String
3855
+ Description: Error source, must be translation_file
3856
+ - Field: type
3857
+ Type: String
3858
+ Description: 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”
3859
+ - Field: file_hash
3860
+ Type: String
3861
+ Description: Base64-encoded file hash
3862
+ - Field: message
3863
+ Type: String
3864
+ Description: Error message
3865
+ - name: PassportElementErrorTranslationFiles
3866
+ children: []
3867
+ desc:
3868
+ - name: p
3869
+ content: Represents an issue with the translated version of a document. The error is considered resolved when a file with the document translation change.
3870
+ table:
3871
+ - Field: source
3872
+ Type: String
3873
+ Description: Error source, must be translation_files
3874
+ - Field: type
3875
+ Type: String
3876
+ Description: 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”
3877
+ - Field: file_hashes
3878
+ Type: Array of String
3879
+ Description: List of base64-encoded file hashes
3880
+ - Field: message
3881
+ Type: String
3882
+ Description: Error message
3883
+ - name: PassportElementErrorUnspecified
3884
+ children: []
3885
+ desc:
3886
+ - name: p
3887
+ content: Represents an issue in an unspecified place. The error is considered resolved when new data is added.
3888
+ table:
3889
+ - Field: source
3890
+ Type: String
3891
+ Description: Error source, must be unspecified
3892
+ - Field: type
3893
+ Type: String
3894
+ Description: Type of element of the user's Telegram Passport which has the issue
3895
+ - Field: element_hash
3896
+ Type: String
3897
+ Description: Base64-encoded element hash
3898
+ - Field: message
3899
+ Type: String
3900
+ Description: Error message
3901
+ desc:
3902
+ - name: p
3903
+ content: 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.
3904
+ - name: Games
3905
+ children:
3906
+ - name: sendGame
3907
+ children: []
3908
+ desc:
3909
+ - name: p
3910
+ content: Use this method to send a game. On success, the sent Message is returned.
3911
+ table:
3912
+ - Parameter: chat_id
3913
+ Type: Integer
3914
+ Required: 'Yes'
3915
+ Description: Unique identifier for the target chat
3916
+ - Parameter: game_short_name
3917
+ Type: String
3918
+ Required: 'Yes'
3919
+ Description: Short name of the game, serves as the unique identifier for the game. Set up your games via Botfather.
3920
+ - Parameter: disable_notification
3921
+ Type: Boolean
3922
+ Required: Optional
3923
+ Description: Sends the message silently. Users will receive a notification with no sound.
3924
+ - Parameter: reply_to_message_id
3925
+ Type: Integer
3926
+ Required: Optional
3927
+ Description: If the message is a reply, ID of the original message
3928
+ - Parameter: reply_markup
3929
+ Type: InlineKeyboardMarkup
3930
+ Required: Optional
3931
+ Description: 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.
3932
+ - name: Game
3933
+ children: []
3934
+ desc:
3935
+ - name: p
3936
+ content: This object represents a game. Use BotFather to create and edit games, their short names will act as unique identifiers.
3937
+ table:
3938
+ - Field: title
3939
+ Type: String
3940
+ Description: Title of the game
3941
+ - Field: description
3942
+ Type: String
3943
+ Description: Description of the game
3944
+ - Field: photo
3945
+ Type: Array of PhotoSize
3946
+ Description: Photo that will be displayed in the game message in chats.
3947
+ - Field: text
3948
+ Type: String
3949
+ Description: 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.
3950
+ - Field: text_entities
3951
+ Type: Array of MessageEntity
3952
+ Description: Optional. Special entities that appear in text, such as usernames, URLs, bot commands, etc.
3953
+ - Field: animation
3954
+ Type: Animation
3955
+ Description: Optional. Animation that will be displayed in the game message in chats. Upload via BotFather
3956
+ - name: CallbackGame
3957
+ children: []
3958
+ desc:
3959
+ - name: p
3960
+ content: A placeholder, currently holds no information. Use BotFather to set up your game.
3961
+ - name: setGameScore
3962
+ children: []
3963
+ desc:
3964
+ - name: p
3965
+ content: Use this method to set the score of the specified user in a game. On success, if the message was sent by the bot, returns the edited Message, otherwise returns True. Returns an error, if the new score is not greater than the user's current score in the chat and force is False.
3966
+ table:
3967
+ - Parameter: user_id
3968
+ Type: Integer
3969
+ Required: 'Yes'
3970
+ Description: User identifier
3971
+ - Parameter: score
3972
+ Type: Integer
3973
+ Required: 'Yes'
3974
+ Description: New score, must be non-negative
3975
+ - Parameter: force
3976
+ Type: Boolean
3977
+ Required: Optional
3978
+ Description: Pass True, if the high score is allowed to decrease. This can be useful when fixing mistakes or banning cheaters
3979
+ - Parameter: disable_edit_message
3980
+ Type: Boolean
3981
+ Required: Optional
3982
+ Description: Pass True, if the game message should not be automatically edited to include the current scoreboard
3983
+ - Parameter: chat_id
3984
+ Type: Integer
3985
+ Required: Optional
3986
+ Description: Required if inline_message_id is not specified. Unique identifier for the target chat
3987
+ - Parameter: message_id
3988
+ Type: Integer
3989
+ Required: Optional
3990
+ Description: Required if inline_message_id is not specified. Identifier of the sent message
3991
+ - Parameter: inline_message_id
3992
+ Type: String
3993
+ Required: Optional
3994
+ Description: Required if chat_id and message_id are not specified. Identifier of the inline message
3995
+ - name: getGameHighScores
3996
+ children: []
3997
+ desc:
3998
+ - name: p
3999
+ content: Use this method to get data for high score tables. Will return the score of the specified user and several of his neighbors in a game. On success, returns an Array of GameHighScore objects.
4000
+ - name: blockquote
4001
+ content: This method will currently return scores for the target user, plus two of his closest neighbors on each side. Will also return the top three users if the user and his neighbors are not among them. Please note that this behavior is subject to change.
4002
+ table:
4003
+ - Parameter: user_id
4004
+ Type: Integer
4005
+ Required: 'Yes'
4006
+ Description: Target user id
4007
+ - Parameter: chat_id
4008
+ Type: Integer
4009
+ Required: Optional
4010
+ Description: Required if inline_message_id is not specified. Unique identifier for the target chat
4011
+ - Parameter: message_id
4012
+ Type: Integer
4013
+ Required: Optional
4014
+ Description: Required if inline_message_id is not specified. Identifier of the sent message
4015
+ - Parameter: inline_message_id
4016
+ Type: String
4017
+ Required: Optional
4018
+ Description: Required if chat_id and message_id are not specified. Identifier of the inline message
4019
+ - name: GameHighScore
4020
+ children: []
4021
+ desc:
4022
+ - name: p
4023
+ content: This object represents one row of the high scores table for a game.
4024
+ - name: p
4025
+ content: And that‘s about all we’ve got for now.If you've got any questions, please check out our Bot FAQ »
4026
+ table:
4027
+ - Field: position
4028
+ Type: Integer
4029
+ Description: Position in high score table for the game
4030
+ - Field: user
4031
+ Type: User
4032
+ Description: User
4033
+ - Field: score
4034
+ Type: Integer
4035
+ Description: Score
4036
+ desc:
4037
+ - name: p
4038
+ content: '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.'
4039
+ - name: ul
4040
+ content:
4041
+ - Games are a new type of content on Telegram, represented by the Game and InlineQueryResultGame objects.
4042
+ - Once you've created a game via BotFather, you can send games to chats as regular messages using the sendGame method, or use inline mode with InlineQueryResultGame.
4043
+ - If you send the game message without any buttons, it will automatically have a 'Play GameName' button. When this button is pressed, your bot gets a CallbackQuery with the game_short_name of the requested game. You provide the correct URL for this particular user and the app opens the game in the in-app browser.
4044
+ - 'You can manually add multiple buttons to your game message. Please note that the first button in the first row must always launch the game, using the field callback_game in InlineKeyboardButton. You can add extra buttons according to taste: e.g., for a description of the rules, or to open the game''s official community.'
4045
+ - To make your game more attractive, you can upload a GIF animation that demostrates the game to the users via BotFather (see Lumberjack for example).
4046
+ - A game message will also display high scores for the current chat. Use setGameScore to post high scores to the chat with the game, add the edit_message parameter to automatically update the message with the current scoreboard.
4047
+ - Use getGameHighScores to get data for in-game high score tables.
4048
+ - You can also add an extra sharing button for users to share their best score to different chats.
4049
+ - For examples of what can be done using this new stuff, check the @gamebot and @gamee bots.
4050
+ desc:
4051
+ - name: blockquote
4052
+ content: The Bot API is an HTTP-based interface created for developers keen on building bots for Telegram.To learn how to create and set up a bot, please consult our Introduction to Bots and Bot FAQ.