tgbot 0.2.4 → 0.2.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/lib/api.yaml +377 -104
  4. data/lib/tgbot/version.rb +1 -1
  5. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dbaa43b35f2b7dc4ca638faa4916d8a6d048fd0d750bfd57ff2f32df41f61328
4
- data.tar.gz: 94a8aae2c6f642d08c8d001c0ee7f761a7d186b45bf3885e3e3d4f517ceabf9d
3
+ metadata.gz: d9a76dc51733e8bf5980a4cbc12aa9f86159a74066660c6b4b385c1dda3424d6
4
+ data.tar.gz: 6022394e75913433de65dc0aa580ed4c39851a70059995bdffcf42f38709a743
5
5
  SHA512:
6
- metadata.gz: 2fc1a210d70ff33ba63a2e11916bb8f54c496d9725d365770fbe31b87b29404eab3a62346d03b59d302d431cb48807544766ebe7d4728a2ecec358755bcfc897
7
- data.tar.gz: cd5b0921d4e2ee244352768cb86dc5cb9ad629cd2b668b76593ebbdb964f05acb2d04d4fb07036473da99f07f3a3cdc56ed413fe3ce0109dc299062596e44ae9
6
+ metadata.gz: 105f22096320ed5634ef41fe10571ff51b5e25cd9592b537e044854c853bc87d72f86ef7c2d053fbab33d75815e5dda7e3227008ab5c72cfda90ca0dbc064d05
7
+ data.tar.gz: 4dcc05edefdc30a79187a6684c473dd3d10b80b8eac5e894568dd82055c19a710c8717919c48141de076ff39822e7cbeddcf5314e7bf4f3fb8eca87fef19de56
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-4.4-blue.svg?style=flat-square)
4
+ ![Bot API Version](https://img.shields.io/badge/Bot%20API-4.7-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).
@@ -3,57 +3,56 @@ name: Telegram Bot API
3
3
  children:
4
4
  - name: Recent changes
5
5
  children:
6
- - name: July 29, 2019
6
+ - name: March 30, 2020
7
7
  children: []
8
8
  desc:
9
9
  - name: p
10
- content: Bot API 4.4
10
+ content: Bot API 4.7
11
11
  - name: ul
12
12
  content:
13
- - Added support for animated stickers. New field is_animated in Sticker and StickerSet objects, animated stickers can now be used in sendSticker and InlineQueryResultCachedSticker.
14
- - Added support for default permissions in groups. New object ChatPermissions, containing actions which a member can take in a chat. New field permissions in the Chat object; new method setChatPermissions.
15
- - The field all_members_are_administrators has been removed from the documentation for the Chat object. The field is still returned in the object for backward compatibility, but new bots should use the permissions field instead.
16
- - 'Added support for more permissions for group and supergroup members: added the new field can_send_polls to ChatMember object, added can_change_info, can_invite_users, can_pin_messages in ChatMember object for restricted users (previously available only for administrators).'
17
- - The method restrictChatMember now takes the new user permissions in a single argument of the type ChatPermissions. The old way of passing parameters will keep working for a while for backward compatibility.
18
- - Added description support for basic groups (previously available in supergroups and channel chats). You can pass a group's chat_id to setChatDescription and receive the group's description in the Chat object in the response to getChat method.
19
- - Added invite_link support for basic groups (previously available in supergroups and channel chats). You can pass a group's chat_id to exportChatInviteLink and receive the group's invite link in the Chat object in the response to getChat method.
20
- - File identifiers from the ChatPhoto object are now invalidated and can no longer be used whenever the photo is changed.
21
- - 'All webhook requests from the Bot API are now coming from the subnets 149.154.160.0/20 and 91.108.4.0/22. Most users won''t need to do anything to continue receiving webhooks. If you control inbound access with a firewall, you may need to update your configuration. You can always find the list of actual IP addresses of servers used to send webhooks there: https://core.telegram.org/bots/webhooks.'
22
- - As of the next Bot API update (version 4.5), nested MessageEntity objects will be allowed in message texts and captions. Please make sure that your code can correctly handle such entities.
23
- - name: May 31, 2019
13
+ - Added the method sendDice for sending a dice message, which will have a random value from 1 to 6. (Yes, we're aware of the “proper” singular of die. But it's awkward, and we decided to help it change. One dice at a time!)
14
+ - Added the field dice to the Message object.
15
+ - Added the method getMyCommands for getting the current list of the bot's commands.
16
+ - Added the method setMyCommands for changing the list of the bot's commands through the Bot API instead of @BotFather.
17
+ - Added the ability to create animated sticker sets by specifying the parameter tgs_sticker instead of png_sticker in the method createNewStickerSet.
18
+ - Added the ability to add animated stickers to sets created by the bot by specifying the parameter tgs_sticker instead of png_sticker in the method addStickerToSet.
19
+ - Added the field thumb to the StickerSet object.
20
+ - Added the ability to change thumbnails of sticker sets created by the bot using the method setStickerSetThumb.
21
+ - name: January 23, 2020
24
22
  children: []
25
23
  desc:
26
24
  - name: p
27
- content: Bot API 4.3
25
+ content: Bot API 4.6
28
26
  - name: ul
29
27
  content:
30
- - Added support for Seamless Telegram Login on external websites (needs Telegram 5.7 or higher).
31
- - 'Added the new object LoginUrl and the new field login_url to the InlineKeyboardButton object which allows to automatically authorize users before they go to a URL specified by the bot. Users will be asked to confirm authorization in their Telegram app (needs version 5.7 or higher) when they press the button:'
32
- - name: p
33
- content: 'Also in this update:'
34
- - name: ul
35
- content:
36
- - Added the field reply_markup to the Message object, containing the inline keyboard attached to the message.
37
- - If a message with an inline keyboard is forwarded, the forwarded message will now have an inline keyboard if the keyboard contained only url and login_url buttons or if the message was sent via a bot and the keyboard contained only url, login_url, switch_inline_query or switch_inline_query_current_chat buttons. In the latter case, switch_inline_query_current_chat buttons are replaced with switch_inline_query buttons.
38
- - Bots now receive the edited_message Update even if only Message.reply_markup has changed.
39
- - Bots that have the can_edit_messages right in a channel can now use the method editMessageReplyMarkup for messages written by other administrators forever without the 48 hours limit.
40
- - 'Don''t forget that starting in July 2019, webhook requests from Bot API will be coming from the subnets 149.154.160.0/20 and 91.108.4.0/22. Most users won''t need to do anything to continue receiving webhooks. If you control inbound access with a firewall, you may need to update your configuration. You can always find the list of actual IP addresses of servers used to send webhooks there: https://core.telegram.org/bots/webhooks.'
41
- - name: April 14, 2019
28
+ - Supported Polls 2.0.
29
+ - 'Added the ability to send non-anonymous, multiple answer, and quiz-style polls: added the parameters is_anonymous, type, allows_multiple_answers, correct_option_id, is_closed options to the method sendPoll.'
30
+ - Added the object KeyboardButtonPollType and the field request_poll to the object KeyboardButton.
31
+ - Added updates about changes of user answers in non-anonymous polls, represented by the object PollAnswer and the field poll_answer in the Update object.
32
+ - Added the fields total_voter_count, is_anonymous, type, allows_multiple_answers, correct_option_id to the Poll object.
33
+ - Bots can now send polls to private chats.
34
+ - 'Added more information about the bot in response to the getMe request: added the fields can_join_groups, can_read_all_group_messages and supports_inline_queries to the User object.'
35
+ - Added the optional field language to the MessageEntity object.
36
+ - name: December 31, 2019
42
37
  children: []
43
38
  desc:
44
39
  - name: p
45
- content: Bot API 4.2
40
+ content: Bot API 4.5
46
41
  - name: ul
47
42
  content:
48
- - 'Added support for native polls: added the object Poll, the methods sendPoll and stopPoll and the field poll in the Message and Update objects.'
49
- - The method deleteMessage can now be used to delete messages sent by a user to the bot in private chats within 48 hours.
50
- - 'Added support for pinned messages in basic groups in addition to supergroups and channel chats: you can pass group''s chat_id to pinChatMessage and unpinChatMessage, and receive the pinned group message in Chat object.'
51
- - Added the field is_member to the ChatMember object, which can be used to find whether a restricted user is a member of the chat.
52
- - Added the field forward_sender_name to the Message object, containing name of the sender who has opted to hide their account.
53
- - 'Starting in July 2019, webhook requests from Bot API will be coming from the subnets 149.154.160.0/20 and 91.108.4.0/22. Most users won''t need to do anything to continue receiving webhooks. If you control inbound access with a firewall, you may need to update your configuration. You can always find the list of actual IP addresses of servers used to send webhooks there: https://core.telegram.org/bots/webhooks.'
54
- - Document thumbnails now should be inscribed in a 320x320 square instead of 90x90.
43
+ - Added support for two new MessageEntity types, underline and strikethrough.
44
+ - Added support for nested MessageEntity objects. Entities can now contain other entities. If two entities have common characters then one of them is fully contained inside the other.
45
+ - Added support for nested entities and the new tags <u>/<ins> (for underlined text) and <s>/<strike>/<del> (for strikethrough text) in parse mode HTML.
46
+ - Added a new parse mode, MarkdownV2, which supports nested entities and two new entities __ (for underlined text) and ~ (for strikethrough text). Parse mode Markdown remains unchanged for backward compatibility.
47
+ - Added the field file_unique_id to the objects Animation, Audio, Document, PassportFile, PhotoSize, Sticker, Video, VideoNote, Voice, File and the fields small_file_unique_id and big_file_unique_id to the object ChatPhoto. The new fields contain a unique file identifier, which is supposed to be the same over time and for different bots, but can't be used to download or reuse the file.
48
+ - Added the field custom_title to the ChatMember object.
49
+ - Added the new method setChatAdministratorCustomTitle to manage the custom titles of administrators promoted by the bot.
50
+ - Added the field slow_mode_delay to the Chat object.
55
51
  - name: p
56
52
  content: See earlier changes »
53
+ desc:
54
+ - name: blockquote
55
+ content: Subscribe to @BotNews to be the first to know about the latest updates and join the discussion in @BotTalk
57
56
  - name: Authorizing your bot
58
57
  children: []
59
58
  desc:
@@ -128,6 +127,9 @@ children:
128
127
  - Field: poll
129
128
  Type: Poll
130
129
  Description: Optional. New poll state. Bots receive only updates about stopped polls and polls, which are sent by the bot
130
+ - Field: poll_answer
131
+ Type: PollAnswer
132
+ Description: Optional. A user changed their answer in a non-anonymous poll. Bots receive new votes only in polls that were sent by the bot itself.
131
133
  - name: getUpdates
132
134
  children: []
133
135
  desc:
@@ -151,7 +153,7 @@ children:
151
153
  - Parameter: allowed_updates
152
154
  Type: Array of String
153
155
  Required: Optional
154
- 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.
156
+ Description: A JSON-serialized list of the update types you want your bot to receive. For example, specify [“message”, “edited_channel_post”, “callback_query”] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all 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.
155
157
  - name: setWebhook
156
158
  children: []
157
159
  desc:
@@ -179,7 +181,7 @@ children:
179
181
  - Parameter: allowed_updates
180
182
  Type: Array of String
181
183
  Required: Optional
182
- 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.
184
+ Description: A JSON-serialized list of the update types you want your bot to receive. For example, specify [“message”, “edited_channel_post”, “callback_query”] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all 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.
183
185
  - name: deleteWebhook
184
186
  children: []
185
187
  desc:
@@ -248,6 +250,15 @@ children:
248
250
  - Field: language_code
249
251
  Type: String
250
252
  Description: Optional. IETF language tag of the user's language
253
+ - Field: can_join_groups
254
+ Type: Boolean
255
+ Description: Optional. True, if the bot can be invited to groups. Returned only in getMe.
256
+ - Field: can_read_all_group_messages
257
+ Type: Boolean
258
+ Description: Optional. True, if privacy mode is disabled for the bot. Returned only in getMe.
259
+ - Field: supports_inline_queries
260
+ Type: Boolean
261
+ Description: Optional. True, if the bot supports inline queries. Returned only in getMe.
251
262
  - name: Chat
252
263
  children: []
253
264
  desc:
@@ -287,6 +298,9 @@ children:
287
298
  - Field: permissions
288
299
  Type: ChatPermissions
289
300
  Description: Optional. Default chat member permissions, for groups and supergroups. Returned only in getChat.
301
+ - Field: slow_mode_delay
302
+ Type: Integer
303
+ Description: Optional. For supergroups, the minimum allowed delay between consecutive messages sent by each unpriviledged user. Returned only in getChat.
290
304
  - Field: sticker_set_name
291
305
  Type: String
292
306
  Description: Optional. For supergroups, name of group sticker set. Returned only in getChat.
@@ -343,7 +357,7 @@ children:
343
357
  Description: Optional. Signature of the post author for messages in channels
344
358
  - Field: text
345
359
  Type: String
346
- Description: Optional. For text messages, the actual UTF-8 text of the message, 0-4096 characters.
360
+ Description: Optional. For text messages, the actual UTF-8 text of the message, 0-4096 characters
347
361
  - Field: entities
348
362
  Type: Array of MessageEntity
349
363
  Description: Optional. For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text
@@ -392,6 +406,9 @@ children:
392
406
  - Field: poll
393
407
  Type: Poll
394
408
  Description: Optional. Message is a native poll, information about the poll
409
+ - Field: dice
410
+ Type: Dice
411
+ Description: Optional. Message is a dice with random value from 1 to 6
395
412
  - Field: new_chat_members
396
413
  Type: Array of User
397
414
  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)
@@ -448,7 +465,7 @@ children:
448
465
  table:
449
466
  - Field: type
450
467
  Type: String
451
- 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)
468
+ Description: Type of the entity. Can be mention (@username), hashtag” (#hashtag), cashtag” ($USD), bot_command” (/start@jobs_bot), url” (https://telegram.org), email” (do-not-reply@telegram.org), phone_number” (+1-212-555-0123), bold (bold text), italic (italic text), “underline” (underlined text), “strikethrough” (strikethrough text), “code (monowidth string), pre (monowidth block), text_link (for clickable text URLs), text_mention (for users without usernames)
452
469
  - Field: offset
453
470
  Type: Integer
454
471
  Description: Offset in UTF-16 code units to the start of the entity
@@ -461,6 +478,9 @@ children:
461
478
  - Field: user
462
479
  Type: User
463
480
  Description: Optional. For “text_mention” only, the mentioned user
481
+ - Field: language
482
+ Type: String
483
+ Description: Optional. For “pre” only, the programming language of the entity text
464
484
  - name: PhotoSize
465
485
  children: []
466
486
  desc:
@@ -469,7 +489,10 @@ children:
469
489
  table:
470
490
  - Field: file_id
471
491
  Type: String
472
- Description: Identifier for this file
492
+ Description: Identifier for this file, which can be used to download or reuse the file
493
+ - Field: file_unique_id
494
+ Type: String
495
+ Description: Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
473
496
  - Field: width
474
497
  Type: Integer
475
498
  Description: Photo width
@@ -487,7 +510,10 @@ children:
487
510
  table:
488
511
  - Field: file_id
489
512
  Type: String
490
- Description: Identifier for this file
513
+ Description: Identifier for this file, which can be used to download or reuse the file
514
+ - Field: file_unique_id
515
+ Type: String
516
+ Description: Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
491
517
  - Field: duration
492
518
  Type: Integer
493
519
  Description: Duration of the audio in seconds as defined by sender
@@ -514,7 +540,10 @@ children:
514
540
  table:
515
541
  - Field: file_id
516
542
  Type: String
517
- Description: Identifier for this file
543
+ Description: Identifier for this file, which can be used to download or reuse the file
544
+ - Field: file_unique_id
545
+ Type: String
546
+ Description: Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
518
547
  - Field: thumb
519
548
  Type: PhotoSize
520
549
  Description: Optional. Document thumbnail as defined by sender
@@ -535,7 +564,10 @@ children:
535
564
  table:
536
565
  - Field: file_id
537
566
  Type: String
538
- Description: Identifier for this file
567
+ Description: Identifier for this file, which can be used to download or reuse the file
568
+ - Field: file_unique_id
569
+ Type: String
570
+ Description: Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
539
571
  - Field: width
540
572
  Type: Integer
541
573
  Description: Video width as defined by sender
@@ -562,7 +594,10 @@ children:
562
594
  table:
563
595
  - Field: file_id
564
596
  Type: String
565
- Description: Identifier for this file
597
+ Description: Identifier for this file, which can be used to download or reuse the file
598
+ - Field: file_unique_id
599
+ Type: String
600
+ Description: Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
566
601
  - Field: width
567
602
  Type: Integer
568
603
  Description: Video width as defined by sender
@@ -592,7 +627,10 @@ children:
592
627
  table:
593
628
  - Field: file_id
594
629
  Type: String
595
- Description: Identifier for this file
630
+ Description: Identifier for this file, which can be used to download or reuse the file
631
+ - Field: file_unique_id
632
+ Type: String
633
+ Description: Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
596
634
  - Field: duration
597
635
  Type: Integer
598
636
  Description: Duration of the audio in seconds as defined by sender
@@ -610,7 +648,10 @@ children:
610
648
  table:
611
649
  - Field: file_id
612
650
  Type: String
613
- Description: Identifier for this file
651
+ Description: Identifier for this file, which can be used to download or reuse the file
652
+ - Field: file_unique_id
653
+ Type: String
654
+ Description: Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
614
655
  - Field: length
615
656
  Type: Integer
616
657
  Description: Video width and height (diameter of the video message) as defined by sender
@@ -689,6 +730,21 @@ children:
689
730
  - Field: voter_count
690
731
  Type: Integer
691
732
  Description: Number of users that voted for this option
733
+ - name: PollAnswer
734
+ children: []
735
+ desc:
736
+ - name: p
737
+ content: This object represents an answer of a user in a non-anonymous poll.
738
+ table:
739
+ - Field: poll_id
740
+ Type: String
741
+ Description: Unique poll identifier
742
+ - Field: user
743
+ Type: User
744
+ Description: The user, who changed the answer to the poll
745
+ - Field: option_ids
746
+ Type: Array of Integer
747
+ Description: 0-based identifiers of answer options, chosen by the user. May be empty if the user retracted their vote.
692
748
  - name: Poll
693
749
  children: []
694
750
  desc:
@@ -704,9 +760,33 @@ children:
704
760
  - Field: options
705
761
  Type: Array of PollOption
706
762
  Description: List of poll options
763
+ - Field: total_voter_count
764
+ Type: Integer
765
+ Description: Total number of users that voted in the poll
707
766
  - Field: is_closed
708
767
  Type: Boolean
709
768
  Description: True, if the poll is closed
769
+ - Field: is_anonymous
770
+ Type: Boolean
771
+ Description: True, if the poll is anonymous
772
+ - Field: type
773
+ Type: String
774
+ Description: Poll type, currently can be “regular” or “quiz”
775
+ - Field: allows_multiple_answers
776
+ Type: Boolean
777
+ Description: True, if the poll allows multiple answers
778
+ - Field: correct_option_id
779
+ Type: Integer
780
+ Description: Optional. 0-based identifier of the correct answer option. Available only for polls in the quiz mode, which are closed, or was sent (not forwarded) by the bot or to the private chat with the bot.
781
+ - name: Dice
782
+ children: []
783
+ desc:
784
+ - name: p
785
+ content: This object represents a dice with random value from 1 to 6. (Yes, we're aware of the “proper” singular of die. But it's awkward, and we decided to help it change. One dice at a time!)
786
+ table:
787
+ - Field: value
788
+ Type: Integer
789
+ Description: Value of the dice, 1-6
710
790
  - name: UserProfilePhotos
711
791
  children: []
712
792
  desc:
@@ -729,7 +809,10 @@ children:
729
809
  table:
730
810
  - Field: file_id
731
811
  Type: String
732
- Description: Identifier for this file
812
+ Description: Identifier for this file, which can be used to download or reuse the file
813
+ - Field: file_unique_id
814
+ Type: String
815
+ Description: Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
733
816
  - Field: file_size
734
817
  Type: Integer
735
818
  Description: Optional. File size, if known
@@ -758,9 +841,9 @@ children:
758
841
  children: []
759
842
  desc:
760
843
  - name: p
761
- 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.
844
+ 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 request_contact, request_location, and request_poll are mutually exclusive.
762
845
  - name: p
763
- content: 'Note: request_contact and request_location options will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.'
846
+ content: 'Note: request_contact and request_location options will only work in Telegram versions released after 9 April, 2016. Older clients will display unsupported message.Note: request_poll option will only work in Telegram versions released after 23 January, 2020. Older clients will display unsupported message.'
764
847
  table:
765
848
  - Field: text
766
849
  Type: String
@@ -771,6 +854,18 @@ children:
771
854
  - Field: request_location
772
855
  Type: Boolean
773
856
  Description: Optional. If True, the user's current location will be sent when the button is pressed. Available in private chats only
857
+ - Field: request_poll
858
+ Type: KeyboardButtonPollType
859
+ Description: Optional. If specified, the user will be asked to create a poll and send it to the bot when the button is pressed. Available in private chats only
860
+ - name: KeyboardButtonPollType
861
+ children: []
862
+ desc:
863
+ - name: p
864
+ content: This object represents type of a poll, which is allowed to be created and sent when the corresponding button is pressed.
865
+ table:
866
+ - Field: type
867
+ Type: String
868
+ Description: Optional. If quiz is passed, the user will be allowed to create only polls in the quiz mode. If regular is passed, only regular polls will be allowed. Otherwise, the user will be allowed to create a poll of any type.
774
869
  - name: ReplyKeyboardRemove
775
870
  children: []
776
871
  desc:
@@ -904,9 +999,15 @@ children:
904
999
  - Field: small_file_id
905
1000
  Type: String
906
1001
  Description: File identifier of small (160x160) chat photo. This file_id can be used only for photo download and only for as long as the photo is not changed.
1002
+ - Field: small_file_unique_id
1003
+ Type: String
1004
+ Description: Unique file identifier of small (160x160) chat photo, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
907
1005
  - Field: big_file_id
908
1006
  Type: String
909
1007
  Description: File identifier of big (640x640) chat photo. This file_id can be used only for photo download and only for as long as the photo is not changed.
1008
+ - Field: big_file_unique_id
1009
+ Type: String
1010
+ Description: Unique file identifier of big (640x640) chat photo, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
910
1011
  - name: ChatMember
911
1012
  children: []
912
1013
  desc:
@@ -919,6 +1020,9 @@ children:
919
1020
  - Field: status
920
1021
  Type: String
921
1022
  Description: The member's status in the chat. Can be “creator”, “administrator”, “member”, “restricted”, “left” or “kicked”
1023
+ - Field: custom_title
1024
+ Type: String
1025
+ Description: Optional. Owner and administrators only. Custom title for this user
922
1026
  - Field: until_date
923
1027
  Type: Integer
924
1028
  Description: Optional. Restricted and kicked only. Date when restrictions will be lifted for this user; unix time
@@ -997,6 +1101,18 @@ children:
997
1101
  - Field: can_pin_messages
998
1102
  Type: Boolean
999
1103
  Description: Optional. True, if the user is allowed to pin messages. Ignored in public supergroups
1104
+ - name: BotCommand
1105
+ children: []
1106
+ desc:
1107
+ - name: p
1108
+ content: This object represents a bot command.
1109
+ table:
1110
+ - Field: command
1111
+ Type: String
1112
+ Description: Text of the command, 1-32 characters. Can contain only lowercase English letters, digits and underscores.
1113
+ - Field: description
1114
+ Type: String
1115
+ Description: Description of the command, 3-256 characters.
1000
1116
  - name: ResponseParameters
1001
1117
  children: []
1002
1118
  desc:
@@ -1035,7 +1151,7 @@ children:
1035
1151
  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 »
1036
1152
  - Field: caption
1037
1153
  Type: String
1038
- Description: Optional. Caption of the photo to be sent, 0-1024 characters
1154
+ Description: Optional. Caption of the photo to be sent, 0-1024 characters after entities parsing
1039
1155
  - Field: parse_mode
1040
1156
  Type: String
1041
1157
  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.
@@ -1056,7 +1172,7 @@ children:
1056
1172
  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 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files »
1057
1173
  - Field: caption
1058
1174
  Type: String
1059
- Description: Optional. Caption of the video to be sent, 0-1024 characters
1175
+ Description: Optional. Caption of the video to be sent, 0-1024 characters after entities parsing
1060
1176
  - Field: parse_mode
1061
1177
  Type: String
1062
1178
  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.
@@ -1089,7 +1205,7 @@ children:
1089
1205
  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 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files »
1090
1206
  - Field: caption
1091
1207
  Type: String
1092
- Description: Optional. Caption of the animation to be sent, 0-1024 characters
1208
+ Description: Optional. Caption of the animation to be sent, 0-1024 characters after entities parsing
1093
1209
  - Field: parse_mode
1094
1210
  Type: String
1095
1211
  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.
@@ -1119,7 +1235,7 @@ children:
1119
1235
  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 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files »
1120
1236
  - Field: caption
1121
1237
  Type: String
1122
- Description: Optional. Caption of the audio to be sent, 0-1024 characters
1238
+ Description: Optional. Caption of the audio to be sent, 0-1024 characters after entities parsing
1123
1239
  - Field: parse_mode
1124
1240
  Type: String
1125
1241
  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.
@@ -1149,7 +1265,7 @@ children:
1149
1265
  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 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files »
1150
1266
  - Field: caption
1151
1267
  Type: String
1152
- Description: Optional. Caption of the document to be sent, 0-1024 characters
1268
+ Description: Optional. Caption of the document to be sent, 0-1024 characters after entities parsing
1153
1269
  - Field: parse_mode
1154
1270
  Type: String
1155
1271
  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.
@@ -1217,7 +1333,7 @@ children:
1217
1333
  - Parameter: text
1218
1334
  Type: String
1219
1335
  Required: 'Yes'
1220
- Description: Text of the message to be sent
1336
+ Description: Text of the message to be sent, 1-4096 characters after entities parsing
1221
1337
  - Parameter: parse_mode
1222
1338
  Type: String
1223
1339
  Required: Optional
@@ -1242,50 +1358,97 @@ children:
1242
1358
  children: []
1243
1359
  desc:
1244
1360
  - name: p
1245
- 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.
1361
+ content: The Bot API supports basic formatting for messages. You can use bold, italic, underlined and strikethrough 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.
1246
1362
  - name: p
1247
1363
  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).
1248
1364
  - name: p
1249
- content: 'Links tg://user?id=<user_id> can be used to mention a user by their id without using a username. Please note:'
1365
+ content: Message entities can be nested, providing following restrictions are met:- If two entities has common characters then one of them is fully contained inside another.- bold, italic, underline and strikethrough entities can contain and to be contained in any other entities, except pre and code.- All other entities can't contain each other.
1366
+ - name: p
1367
+ content: 'Links tg://user?id=<user_id> can be used to mention a user by their ID without using a username. Please note:'
1250
1368
  - name: ul
1251
1369
  content:
1252
1370
  - 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.
1253
1371
  - 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.
1254
1372
  - name: h6
1255
- content: Markdown style
1373
+ content: MarkdownV2 style
1256
1374
  - name: p
1257
- content: 'To use this mode, pass Markdown in the parse_mode field when using sendMessage. Use the following syntax in your message:'
1375
+ content: 'To use this mode, pass MarkdownV2 in the parse_mode field. Use the following syntax in your message:'
1258
1376
  - name: pre
1259
1377
  content: |-
1260
- *bold text*
1261
- _italic text_
1378
+ *bold \*text*
1379
+ _italic \*text_
1380
+ __underline__
1381
+ ~strikethrough~
1382
+ *bold _italic bold ~italic bold strikethrough~ __underline italic bold___ bold*
1262
1383
  [inline URL](http://www.example.com/)
1263
1384
  [inline mention of a user](tg://user?id=123456789)
1264
1385
  `inline fixed-width code`
1265
- ```block_language
1386
+ ```
1266
1387
  pre-formatted fixed-width code block
1267
1388
  ```
1389
+ ```python
1390
+ pre-formatted fixed-width code block written in the Python programming language
1391
+ ```
1392
+ - name: p
1393
+ content: 'Please note:'
1394
+ - name: ul
1395
+ content:
1396
+ - Any character between 1 and 126 inclusively can be escaped anywhere with a preceding '\' character, in which case it is treated as an ordinary character and not a part of the markup.
1397
+ - Inside pre and code entities, all '`‘ and ’\‘ characters must be escaped with a preceding ’\' character.
1398
+ - Inside (...) part of inline link definition, all ')‘ and ’\‘ must be escaped with a preceding ’\' character.
1399
+ - In all other places characters '_‘, ’*‘, ’[‘, ’]‘, ’(‘, ’)‘, ’~‘, ’`‘, ’>‘, ’#‘, ’+‘, ’-‘, ’=‘, ’|‘, ’{‘, ’}‘, ’.‘, ’!‘ must be escaped with the preceding character ’\'.
1400
+ - In case of ambiguity between italic and underline entities __ is always greadily treated from left to right as beginning or end of underline entity, so instead of ___italic underline___ use ___italic underline_\r__, where \r is a character with code 13, which will be ignored.
1268
1401
  - name: h6
1269
1402
  content: HTML style
1270
1403
  - name: p
1271
- content: 'To use this mode, pass HTML in the parse_mode field when using sendMessage. The following tags are currently supported:'
1404
+ content: 'To use this mode, pass HTML in the parse_mode field. The following tags are currently supported:'
1272
1405
  - name: pre
1273
1406
  content: |-
1274
1407
  <b>bold</b>, <strong>bold</strong>
1275
1408
  <i>italic</i>, <em>italic</em>
1409
+ <u>underline</u>, <ins>underline</ins>
1410
+ <s>strikethrough</s>, <strike>strikethrough</strike>, <del>strikethrough</del>
1411
+ <b>bold <i>italic bold <s>italic bold strikethrough</s> <u>underline italic bold</u></i> bold</b>
1276
1412
  <a href="http://www.example.com/">inline URL</a>
1277
1413
  <a href="tg://user?id=123456789">inline mention of a user</a>
1278
1414
  <code>inline fixed-width code</code>
1279
1415
  <pre>pre-formatted fixed-width code block</pre>
1416
+ <pre><code class="language-python">pre-formatted fixed-width code block written in the Python programming language</code></pre>
1280
1417
  - name: p
1281
1418
  content: 'Please note:'
1282
1419
  - name: ul
1283
1420
  content:
1284
1421
  - Only the tags mentioned above are currently supported.
1285
- - Tags must not be nested.
1286
1422
  - 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;).
1287
1423
  - All numerical HTML entities are supported.
1288
1424
  - 'The API currently supports only the following named HTML entities: &lt;, &gt;, &amp; and &quot;.'
1425
+ - Use nested pre and code tags, to define programming language for pre entity.
1426
+ - Programming language can't be specified for standalone code tags.
1427
+ - name: h6
1428
+ content: Markdown style
1429
+ - name: p
1430
+ content: 'This is a legacy mode, retained for backward compatibility. To use this mode, pass Markdown in the parse_mode field. Use the following syntax in your message:'
1431
+ - name: pre
1432
+ content: |-
1433
+ *bold text*
1434
+ _italic text_
1435
+ [inline URL](http://www.example.com/)
1436
+ [inline mention of a user](tg://user?id=123456789)
1437
+ `inline fixed-width code`
1438
+ ```
1439
+ pre-formatted fixed-width code block
1440
+ ```
1441
+ ```python
1442
+ pre-formatted fixed-width code block written in the Python programming language
1443
+ ```
1444
+ - name: p
1445
+ content: 'Please note:'
1446
+ - name: ul
1447
+ content:
1448
+ - Entities must not be nested, use parse mode MarkdownV2 instead.
1449
+ - There is no way to specify underline and strikethrough entities, use parse mode MarkdownV2 instead.
1450
+ - To escape characters '_‘, ’*‘, ’`‘, ’[‘ outside of an entity, prepend the characters ’\' before them.
1451
+ - 'Escaping inside entities is not allowed, so entity must be closed first and reopened again: use _snake_\__case_ for italic snake_case and *2*\**2=4* for bold 2*2=4.'
1289
1452
  - name: forwardMessage
1290
1453
  children: []
1291
1454
  desc:
@@ -1325,7 +1488,7 @@ children:
1325
1488
  - Parameter: caption
1326
1489
  Type: String
1327
1490
  Required: Optional
1328
- Description: Photo caption (may also be used when resending photos by file_id), 0-1024 characters
1491
+ Description: Photo caption (may also be used when resending photos by file_id), 0-1024 characters after entities parsing
1329
1492
  - Parameter: parse_mode
1330
1493
  Type: String
1331
1494
  Required: Optional
@@ -1361,7 +1524,7 @@ children:
1361
1524
  - Parameter: caption
1362
1525
  Type: String
1363
1526
  Required: Optional
1364
- Description: Audio caption, 0-1024 characters
1527
+ Description: Audio caption, 0-1024 characters after entities parsing
1365
1528
  - Parameter: parse_mode
1366
1529
  Type: String
1367
1530
  Required: Optional
@@ -1415,7 +1578,7 @@ children:
1415
1578
  - Parameter: caption
1416
1579
  Type: String
1417
1580
  Required: Optional
1418
- Description: Document caption (may also be used when resending documents by file_id), 0-1024 characters
1581
+ Description: Document caption (may also be used when resending documents by file_id), 0-1024 characters after entities parsing
1419
1582
  - Parameter: parse_mode
1420
1583
  Type: String
1421
1584
  Required: Optional
@@ -1465,7 +1628,7 @@ children:
1465
1628
  - Parameter: caption
1466
1629
  Type: String
1467
1630
  Required: Optional
1468
- Description: Video caption (may also be used when resending videos by file_id), 0-1024 characters
1631
+ Description: Video caption (may also be used when resending videos by file_id), 0-1024 characters after entities parsing
1469
1632
  - Parameter: parse_mode
1470
1633
  Type: String
1471
1634
  Required: Optional
@@ -1519,7 +1682,7 @@ children:
1519
1682
  - Parameter: caption
1520
1683
  Type: String
1521
1684
  Required: Optional
1522
- Description: Animation caption (may also be used when resending animation by file_id), 0-1024 characters
1685
+ Description: Animation caption (may also be used when resending animation by file_id), 0-1024 characters after entities parsing
1523
1686
  - Parameter: parse_mode
1524
1687
  Type: String
1525
1688
  Required: Optional
@@ -1540,7 +1703,7 @@ children:
1540
1703
  children: []
1541
1704
  desc:
1542
1705
  - name: p
1543
- 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.
1706
+ 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.
1544
1707
  table:
1545
1708
  - Parameter: chat_id
1546
1709
  Type: Integer or String
@@ -1553,7 +1716,7 @@ children:
1553
1716
  - Parameter: caption
1554
1717
  Type: String
1555
1718
  Required: Optional
1556
- Description: Voice message caption, 0-1024 characters
1719
+ Description: Voice message caption, 0-1024 characters after entities parsing
1557
1720
  - Parameter: parse_mode
1558
1721
  Type: String
1559
1722
  Required: Optional
@@ -1808,12 +1971,12 @@ children:
1808
1971
  children: []
1809
1972
  desc:
1810
1973
  - name: p
1811
- content: Use this method to send a native poll. A native poll can't be sent to a private chat. On success, the sent Message is returned.
1974
+ content: Use this method to send a native poll. On success, the sent Message is returned.
1812
1975
  table:
1813
1976
  - Parameter: chat_id
1814
1977
  Type: Integer or String
1815
1978
  Required: 'Yes'
1816
- Description: Unique identifier for the target chat or username of the target channel (in the format @channelusername). A native poll can't be sent to a private chat.
1979
+ Description: Unique identifier for the target chat or username of the target channel (in the format @channelusername)
1817
1980
  - Parameter: question
1818
1981
  Type: String
1819
1982
  Required: 'Yes'
@@ -1821,7 +1984,49 @@ children:
1821
1984
  - Parameter: options
1822
1985
  Type: Array of String
1823
1986
  Required: 'Yes'
1824
- Description: List of answer options, 2-10 strings 1-100 characters each
1987
+ Description: A JSON-serialized list of answer options, 2-10 strings 1-100 characters each
1988
+ - Parameter: is_anonymous
1989
+ Type: Boolean
1990
+ Required: Optional
1991
+ Description: True, if the poll needs to be anonymous, defaults to True
1992
+ - Parameter: type
1993
+ Type: String
1994
+ Required: Optional
1995
+ Description: Poll type, “quiz” or “regular”, defaults to “regular”
1996
+ - Parameter: allows_multiple_answers
1997
+ Type: Boolean
1998
+ Required: Optional
1999
+ Description: True, if the poll allows multiple answers, ignored for polls in quiz mode, defaults to False
2000
+ - Parameter: correct_option_id
2001
+ Type: Integer
2002
+ Required: Optional
2003
+ Description: 0-based identifier of the correct answer option, required for polls in quiz mode
2004
+ - Parameter: is_closed
2005
+ Type: Boolean
2006
+ Required: Optional
2007
+ Description: Pass True, if the poll needs to be immediately closed. This can be useful for poll preview.
2008
+ - Parameter: disable_notification
2009
+ Type: Boolean
2010
+ Required: Optional
2011
+ Description: Sends the message silently. Users will receive a notification with no sound.
2012
+ - Parameter: reply_to_message_id
2013
+ Type: Integer
2014
+ Required: Optional
2015
+ Description: If the message is a reply, ID of the original message
2016
+ - Parameter: reply_markup
2017
+ Type: InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply
2018
+ Required: Optional
2019
+ 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.
2020
+ - name: sendDice
2021
+ children: []
2022
+ desc:
2023
+ - name: p
2024
+ content: Use this method to send a dice, which will have a random value from 1 to 6. On success, the sent Message is returned. (Yes, we're aware of the “proper” singular of die. But it's awkward, and we decided to help it change. One dice at a time!)
2025
+ table:
2026
+ - Parameter: chat_id
2027
+ Type: Integer or String
2028
+ Required: 'Yes'
2029
+ Description: Unique identifier for the target chat or username of the target channel (in the format @channelusername)
1825
2030
  - Parameter: disable_notification
1826
2031
  Type: Boolean
1827
2032
  Required: Optional
@@ -1982,6 +2187,24 @@ children:
1982
2187
  Type: Boolean
1983
2188
  Required: Optional
1984
2189
  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)
2190
+ - name: setChatAdministratorCustomTitle
2191
+ children: []
2192
+ desc:
2193
+ - name: p
2194
+ content: Use this method to set a custom title for an administrator in a supergroup promoted by the bot. Returns True on success.
2195
+ table:
2196
+ - Parameter: chat_id
2197
+ Type: Integer or String
2198
+ Required: 'Yes'
2199
+ Description: Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
2200
+ - Parameter: user_id
2201
+ Type: Integer
2202
+ Required: 'Yes'
2203
+ Description: Unique identifier of the target user
2204
+ - Parameter: custom_title
2205
+ Type: String
2206
+ Required: 'Yes'
2207
+ Description: New custom title for the administrator; 0-16 characters, emoji are not allowed
1985
2208
  - name: setChatPermissions
1986
2209
  children: []
1987
2210
  desc:
@@ -2194,6 +2417,21 @@ children:
2194
2417
  Type: Integer
2195
2418
  Required: Optional
2196
2419
  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.
2420
+ - name: setMyCommands
2421
+ children: []
2422
+ desc:
2423
+ - name: p
2424
+ content: Use this method to change the list of the bot's commands. Returns True on success.
2425
+ table:
2426
+ - Parameter: commands
2427
+ Type: Array of BotCommand
2428
+ Required: 'Yes'
2429
+ Description: A JSON-serialized list of bot commands to be set as the list of the bot's commands. At most 100 commands can be specified.
2430
+ - name: getMyCommands
2431
+ children: []
2432
+ desc:
2433
+ - name: p
2434
+ content: Use this method to get the current list of the bot's commands. Requires no parameters. Returns Array of BotCommand on success.
2197
2435
  - name: Inline mode methods
2198
2436
  children: []
2199
2437
  desc:
@@ -2225,7 +2463,7 @@ children:
2225
2463
  - Parameter: text
2226
2464
  Type: String
2227
2465
  Required: 'Yes'
2228
- Description: New text of the message
2466
+ Description: New text of the message, 1-4096 characters after entities parsing
2229
2467
  - Parameter: parse_mode
2230
2468
  Type: String
2231
2469
  Required: Optional
@@ -2259,7 +2497,7 @@ children:
2259
2497
  - Parameter: caption
2260
2498
  Type: String
2261
2499
  Required: Optional
2262
- Description: New caption of the message
2500
+ Description: New caption of the message, 0-1024 characters after entities parsing
2263
2501
  - Parameter: parse_mode
2264
2502
  Type: String
2265
2503
  Required: Optional
@@ -2338,7 +2576,7 @@ children:
2338
2576
  children: []
2339
2577
  desc:
2340
2578
  - name: p
2341
- 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 can delete incoming messages in private chats.- 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.
2579
+ 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.- A dice message in a private chat can only be deleted if it was sent more than 24 hours ago.- Bots can delete outgoing messages in private chats, groups, and supergroups.- Bots can delete incoming messages in private chats.- Bots granted can_post_messages permissions can delete outgoing messages in channels.- 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.
2342
2580
  table:
2343
2581
  - Parameter: chat_id
2344
2582
  Type: Integer or String
@@ -2363,7 +2601,10 @@ children:
2363
2601
  table:
2364
2602
  - Field: file_id
2365
2603
  Type: String
2366
- Description: Identifier for this file
2604
+ Description: Identifier for this file, which can be used to download or reuse the file
2605
+ - Field: file_unique_id
2606
+ Type: String
2607
+ Description: Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
2367
2608
  - Field: width
2368
2609
  Type: Integer
2369
2610
  Description: Sticker width
@@ -2375,7 +2616,7 @@ children:
2375
2616
  Description: True, if the sticker is animated
2376
2617
  - Field: thumb
2377
2618
  Type: PhotoSize
2378
- Description: Optional. Sticker thumbnail in the .webp or .jpg format
2619
+ Description: Optional. Sticker thumbnail in the .WEBP or .JPG format
2379
2620
  - Field: emoji
2380
2621
  Type: String
2381
2622
  Description: Optional. Emoji associated with the sticker
@@ -2409,6 +2650,9 @@ children:
2409
2650
  - Field: stickers
2410
2651
  Type: Array of Sticker
2411
2652
  Description: List of all set stickers
2653
+ - Field: thumb
2654
+ Type: PhotoSize
2655
+ Description: Optional. Sticker set thumbnail in the .WEBP or .TGS format
2412
2656
  - name: MaskPosition
2413
2657
  children: []
2414
2658
  desc:
@@ -2440,7 +2684,7 @@ children:
2440
2684
  - Parameter: sticker
2441
2685
  Type: InputFile or String
2442
2686
  Required: 'Yes'
2443
- 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 »
2687
+ 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 »
2444
2688
  - Parameter: disable_notification
2445
2689
  Type: Boolean
2446
2690
  Required: Optional
@@ -2467,7 +2711,7 @@ children:
2467
2711
  children: []
2468
2712
  desc:
2469
2713
  - name: p
2470
- 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.
2714
+ 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.
2471
2715
  table:
2472
2716
  - Parameter: user_id
2473
2717
  Type: Integer
@@ -2481,7 +2725,7 @@ children:
2481
2725
  children: []
2482
2726
  desc:
2483
2727
  - name: p
2484
- 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.
2728
+ content: Use this method to create a new sticker set owned by a user. The bot will be able to edit the sticker set thus created. You must use exactly one of the fields png_sticker or tgs_sticker. Returns True on success.
2485
2729
  table:
2486
2730
  - Parameter: user_id
2487
2731
  Type: Integer
@@ -2497,8 +2741,12 @@ children:
2497
2741
  Description: Sticker set title, 1-64 characters
2498
2742
  - Parameter: png_sticker
2499
2743
  Type: InputFile or String
2500
- Required: 'Yes'
2501
- 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 »
2744
+ Required: Optional
2745
+ 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 »
2746
+ - Parameter: tgs_sticker
2747
+ Type: InputFile
2748
+ Required: Optional
2749
+ Description: TGS animation with the sticker, uploaded using multipart/form-data. See https://core.telegram.org/animated_stickers#technical-requirements for technical requirements
2502
2750
  - Parameter: emojis
2503
2751
  Type: String
2504
2752
  Required: 'Yes'
@@ -2515,7 +2763,7 @@ children:
2515
2763
  children: []
2516
2764
  desc:
2517
2765
  - name: p
2518
- content: Use this method to add a new sticker to a set created by the bot. Returns True on success.
2766
+ content: Use this method to add a new sticker to a set created by the bot. You must use exactly one of the fields png_sticker or tgs_sticker. Animated stickers can be added to animated sticker sets and only to them. Animated sticker sets can have up to 50 stickers. Static sticker sets can have up to 120 stickers. Returns True on success.
2519
2767
  table:
2520
2768
  - Parameter: user_id
2521
2769
  Type: Integer
@@ -2528,7 +2776,11 @@ children:
2528
2776
  - Parameter: png_sticker
2529
2777
  Type: InputFile or String
2530
2778
  Required: 'Yes'
2531
- 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 »
2779
+ 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 »
2780
+ - Parameter: tgs_sticker
2781
+ Type: InputFile
2782
+ Required: Optional
2783
+ Description: TGS animation with the sticker, uploaded using multipart/form-data. See https://core.telegram.org/animated_stickers#technical-requirements for technical requirements
2532
2784
  - Parameter: emojis
2533
2785
  Type: String
2534
2786
  Required: 'Yes'
@@ -2541,7 +2793,7 @@ children:
2541
2793
  children: []
2542
2794
  desc:
2543
2795
  - name: p
2544
- content: Use this method to move a sticker in a set created by the bot to a specific position . Returns True on success.
2796
+ content: Use this method to move a sticker in a set created by the bot to a specific position. Returns True on success.
2545
2797
  table:
2546
2798
  - Parameter: sticker
2547
2799
  Type: String
@@ -2561,6 +2813,24 @@ children:
2561
2813
  Type: String
2562
2814
  Required: 'Yes'
2563
2815
  Description: File identifier of the sticker
2816
+ - name: setStickerSetThumb
2817
+ children: []
2818
+ desc:
2819
+ - name: p
2820
+ content: Use this method to set the thumbnail of a sticker set. Animated thumbnails can be set for animated sticker sets only. Returns True on success.
2821
+ table:
2822
+ - Parameter: name
2823
+ Type: String
2824
+ Required: 'Yes'
2825
+ Description: Sticker set name
2826
+ - Parameter: user_id
2827
+ Type: Integer
2828
+ Required: 'Yes'
2829
+ Description: User identifier of the sticker set owner
2830
+ - Parameter: thumb
2831
+ Type: InputFile or String
2832
+ Required: Optional
2833
+ Description: A PNG image with the thumbnail, must be up to 128 kilobytes in size and have width and height exactly 100px, or a TGS animation with the thumbnail up to 32 kilobytes in size; see https://core.telegram.org/animated_stickers#technical-requirements for animated sticker technical requirements. Pass a file_id as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More info on Sending Files ». Animated sticker set thumbnail can't be uploaded via HTTP URL.
2564
2834
  desc:
2565
2835
  - name: p
2566
2836
  content: The following methods and objects allow your bot to handle stickers and sticker sets.
@@ -2583,7 +2853,7 @@ children:
2583
2853
  Description: Optional. Sender location, only for bots that request user location
2584
2854
  - Field: query
2585
2855
  Type: String
2586
- Description: Text of the query (up to 512 characters)
2856
+ Description: Text of the query (up to 256 characters)
2587
2857
  - Field: offset
2588
2858
  Type: String
2589
2859
  Description: Offset of the results to be returned, can be controlled by the bot
@@ -2719,7 +2989,7 @@ children:
2719
2989
  Description: Optional. Short description of the result
2720
2990
  - Field: caption
2721
2991
  Type: String
2722
- Description: Optional. Caption of the photo to be sent, 0-1024 characters
2992
+ Description: Optional. Caption of the photo to be sent, 0-1024 characters after entities parsing
2723
2993
  - Field: parse_mode
2724
2994
  Type: String
2725
2995
  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.
@@ -2761,7 +3031,7 @@ children:
2761
3031
  Description: Optional. Title for the result
2762
3032
  - Field: caption
2763
3033
  Type: String
2764
- Description: Optional. Caption of the GIF file to be sent, 0-1024 characters
3034
+ Description: Optional. Caption of the GIF file to be sent, 0-1024 characters after entities parsing
2765
3035
  - Field: parse_mode
2766
3036
  Type: String
2767
3037
  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.
@@ -2803,7 +3073,7 @@ children:
2803
3073
  Description: Optional. Title for the result
2804
3074
  - Field: caption
2805
3075
  Type: String
2806
- Description: Optional. Caption of the MPEG-4 file to be sent, 0-1024 characters
3076
+ Description: Optional. Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing
2807
3077
  - Field: parse_mode
2808
3078
  Type: String
2809
3079
  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.
@@ -2841,7 +3111,7 @@ children:
2841
3111
  Description: Title for the result
2842
3112
  - Field: caption
2843
3113
  Type: String
2844
- Description: Optional. Caption of the video to be sent, 0-1024 characters
3114
+ Description: Optional. Caption of the video to be sent, 0-1024 characters after entities parsing
2845
3115
  - Field: parse_mode
2846
3116
  Type: String
2847
3117
  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.
@@ -2885,7 +3155,7 @@ children:
2885
3155
  Description: Title
2886
3156
  - Field: caption
2887
3157
  Type: String
2888
- Description: Optional. Caption, 0-1024 characters
3158
+ Description: Optional. Caption, 0-1024 characters after entities parsing
2889
3159
  - Field: parse_mode
2890
3160
  Type: String
2891
3161
  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.
@@ -2905,7 +3175,7 @@ children:
2905
3175
  children: []
2906
3176
  desc:
2907
3177
  - name: p
2908
- 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.
3178
+ 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.
2909
3179
  - name: p
2910
3180
  content: 'Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.'
2911
3181
  table:
@@ -2923,7 +3193,7 @@ children:
2923
3193
  Description: Recording title
2924
3194
  - Field: caption
2925
3195
  Type: String
2926
- Description: Optional. Caption, 0-1024 characters
3196
+ Description: Optional. Caption, 0-1024 characters after entities parsing
2927
3197
  - Field: parse_mode
2928
3198
  Type: String
2929
3199
  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.
@@ -2955,7 +3225,7 @@ children:
2955
3225
  Description: Title for the result
2956
3226
  - Field: caption
2957
3227
  Type: String
2958
- Description: Optional. Caption of the document to be sent, 0-1024 characters
3228
+ Description: Optional. Caption of the document to be sent, 0-1024 characters after entities parsing
2959
3229
  - Field: parse_mode
2960
3230
  Type: String
2961
3231
  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.
@@ -3155,7 +3425,7 @@ children:
3155
3425
  Description: Optional. Short description of the result
3156
3426
  - Field: caption
3157
3427
  Type: String
3158
- Description: Optional. Caption of the photo to be sent, 0-1024 characters
3428
+ Description: Optional. Caption of the photo to be sent, 0-1024 characters after entities parsing
3159
3429
  - Field: parse_mode
3160
3430
  Type: String
3161
3431
  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.
@@ -3185,7 +3455,7 @@ children:
3185
3455
  Description: Optional. Title for the result
3186
3456
  - Field: caption
3187
3457
  Type: String
3188
- Description: Optional. Caption of the GIF file to be sent, 0-1024 characters
3458
+ Description: Optional. Caption of the GIF file to be sent, 0-1024 characters after entities parsing
3189
3459
  - Field: parse_mode
3190
3460
  Type: String
3191
3461
  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.
@@ -3215,7 +3485,7 @@ children:
3215
3485
  Description: Optional. Title for the result
3216
3486
  - Field: caption
3217
3487
  Type: String
3218
- Description: Optional. Caption of the MPEG-4 file to be sent, 0-1024 characters
3488
+ Description: Optional. Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing
3219
3489
  - Field: parse_mode
3220
3490
  Type: String
3221
3491
  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.
@@ -3273,7 +3543,7 @@ children:
3273
3543
  Description: Optional. Short description of the result
3274
3544
  - Field: caption
3275
3545
  Type: String
3276
- Description: Optional. Caption of the document to be sent, 0-1024 characters
3546
+ Description: Optional. Caption of the document to be sent, 0-1024 characters after entities parsing
3277
3547
  - Field: parse_mode
3278
3548
  Type: String
3279
3549
  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.
@@ -3306,7 +3576,7 @@ children:
3306
3576
  Description: Optional. Short description of the result
3307
3577
  - Field: caption
3308
3578
  Type: String
3309
- Description: Optional. Caption of the video to be sent, 0-1024 characters
3579
+ Description: Optional. Caption of the video to be sent, 0-1024 characters after entities parsing
3310
3580
  - Field: parse_mode
3311
3581
  Type: String
3312
3582
  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.
@@ -3338,7 +3608,7 @@ children:
3338
3608
  Description: Voice message title
3339
3609
  - Field: caption
3340
3610
  Type: String
3341
- Description: Optional. Caption, 0-1024 characters
3611
+ Description: Optional. Caption, 0-1024 characters after entities parsing
3342
3612
  - Field: parse_mode
3343
3613
  Type: String
3344
3614
  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.
@@ -3367,7 +3637,7 @@ children:
3367
3637
  Description: A valid file identifier for the audio file
3368
3638
  - Field: caption
3369
3639
  Type: String
3370
- Description: Optional. Caption, 0-1024 characters
3640
+ Description: Optional. Caption, 0-1024 characters after entities parsing
3371
3641
  - Field: parse_mode
3372
3642
  Type: String
3373
3643
  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.
@@ -3527,7 +3797,7 @@ children:
3527
3797
  - Parameter: prices
3528
3798
  Type: Array of LabeledPrice
3529
3799
  Required: 'Yes'
3530
- Description: Price breakdown, a list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)
3800
+ Description: Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)
3531
3801
  - Parameter: provider_data
3532
3802
  Type: String
3533
3803
  Required: Optional
@@ -3815,7 +4085,10 @@ children:
3815
4085
  table:
3816
4086
  - Field: file_id
3817
4087
  Type: String
3818
- Description: Identifier for this file
4088
+ Description: Identifier for this file, which can be used to download or reuse the file
4089
+ - Field: file_unique_id
4090
+ Type: String
4091
+ Description: Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
3819
4092
  - Field: file_size
3820
4093
  Type: Integer
3821
4094
  Description: File size
@@ -1,3 +1,3 @@
1
1
  class Tgbot
2
- VERSION = '0.2.4'.freeze
2
+ VERSION = '0.2.7'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tgbot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - hyrious
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-10-25 00:00:00.000000000 Z
11
+ date: 2020-03-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -104,7 +104,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
104
104
  - !ruby/object:Gem::Version
105
105
  version: '0'
106
106
  requirements: []
107
- rubygems_version: 3.0.3
107
+ rubygems_version: 3.1.2
108
108
  signing_key:
109
109
  specification_version: 4
110
110
  summary: Telegram Bot API