Skip to content

Commit 736ed62

Browse files
authored
Update to Telegram Bot API 9.3 (#328)
1 parent 962abc1 commit 736ed62

18 files changed

+232
-9
lines changed

data/methods.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"sendPoll": "Message",
2727
"sendChecklist": "Message",
2828
"sendDice": "Message",
29+
"sendMessageDraft": "Boolean",
2930
"sendChatAction": "Boolean",
3031
"setMessageReaction": "Boolean",
3132
"getUserProfilePhotos": "UserProfilePhotos",
@@ -108,10 +109,13 @@
108109
"getBusinessAccountStarBalance": "StarAmount",
109110
"transferBusinessAccountStars": "Boolean",
110111
"getBusinessAccountGifts": "OwnedGifts",
112+
"getUserGifts": "OwnedGifts",
113+
"getChatGifts": "OwnedGifts",
111114
"convertGiftToStars": "Boolean",
112115
"upgradeGift": "Boolean",
113116
"transferGift": "Boolean",
114117
"postStory": "Story",
118+
"repostStory": "Story",
115119
"editStory": "Story",
116120
"deleteStory": "Boolean",
117121
"editMessageText": "Message | Boolean",

data/types.json

Lines changed: 156 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,9 @@
151151
},
152152
"has_main_web_app": {
153153
"type": "boolean"
154+
},
155+
"has_topics_enabled": {
156+
"type": "boolean"
154157
}
155158
},
156159
"Chat": {
@@ -343,6 +346,15 @@
343346
},
344347
"location": {
345348
"type": "ChatLocation"
349+
},
350+
"rating": {
351+
"type": "UserRating"
352+
},
353+
"unique_gift_colors": {
354+
"type": "UniqueGiftColors"
355+
},
356+
"paid_message_star_count": {
357+
"type": "integer"
346358
}
347359
},
348360
"Message": {
@@ -578,6 +590,9 @@
578590
"unique_gift": {
579591
"type": "UniqueGiftInfo"
580592
},
593+
"gift_upgrade_sent": {
594+
"type": "GiftInfo"
595+
},
581596
"connected_website": {
582597
"type": "string"
583598
},
@@ -1351,6 +1366,9 @@
13511366
"completed_by_user": {
13521367
"type": "User"
13531368
},
1369+
"completed_by_chat": {
1370+
"type": "Chat"
1371+
},
13541372
"completion_date": {
13551373
"type": "integer"
13561374
}
@@ -1687,9 +1705,14 @@
16871705
},
16881706
"icon_custom_emoji_id": {
16891707
"type": "string"
1708+
},
1709+
"is_name_implicit": {
1710+
"type": "boolean",
1711+
"default": true
16901712
}
16911713
},
1692-
"ForumTopicClosed": {},
1714+
"ForumTopicClosed": {
1715+
},
16931716
"ForumTopicEdited": {
16941717
"name": {
16951718
"type": "string"
@@ -1698,9 +1721,12 @@
16981721
"type": "string"
16991722
}
17001723
},
1701-
"ForumTopicReopened": {},
1702-
"GeneralForumTopicHidden": {},
1703-
"GeneralForumTopicUnhidden": {},
1724+
"ForumTopicReopened": {
1725+
},
1726+
"GeneralForumTopicHidden": {
1727+
},
1728+
"GeneralForumTopicUnhidden": {
1729+
},
17041730
"SharedUser": {
17051731
"user_id": {
17061732
"type": "integer",
@@ -1768,7 +1794,8 @@
17681794
"required": true
17691795
}
17701796
},
1771-
"VideoChatStarted": {},
1797+
"VideoChatStarted": {
1798+
},
17721799
"VideoChatEnded": {
17731800
"duration": {
17741801
"type": "integer",
@@ -2804,6 +2831,23 @@
28042831
"required": true
28052832
}
28062833
},
2834+
"UserRating": {
2835+
"level": {
2836+
"type": "integer",
2837+
"required": true
2838+
},
2839+
"rating": {
2840+
"type": "integer",
2841+
"required": true
2842+
},
2843+
"current_level_rating": {
2844+
"type": "integer",
2845+
"required": true
2846+
},
2847+
"next_level_rating": {
2848+
"type": "integer"
2849+
}
2850+
},
28072851
"StoryAreaPosition": {
28082852
"x_percentage": {
28092853
"type": "number",
@@ -3070,6 +3114,24 @@
30703114
},
30713115
"icon_custom_emoji_id": {
30723116
"type": "string"
3117+
},
3118+
"is_name_implicit": {
3119+
"type": "boolean",
3120+
"default": true
3121+
}
3122+
},
3123+
"GiftBackground": {
3124+
"center_color": {
3125+
"type": "integer",
3126+
"required": true
3127+
},
3128+
"edge_color": {
3129+
"type": "integer",
3130+
"required": true
3131+
},
3132+
"text_color": {
3133+
"type": "integer",
3134+
"required": true
30733135
}
30743136
},
30753137
"Gift": {
@@ -3088,12 +3150,32 @@
30883150
"upgrade_star_count": {
30893151
"type": "integer"
30903152
},
3153+
"is_premium": {
3154+
"type": "boolean",
3155+
"default": true
3156+
},
3157+
"has_colors": {
3158+
"type": "boolean",
3159+
"default": true
3160+
},
30913161
"total_count": {
30923162
"type": "integer"
30933163
},
30943164
"remaining_count": {
30953165
"type": "integer"
30963166
},
3167+
"personal_total_count": {
3168+
"type": "integer"
3169+
},
3170+
"personal_remaining_count": {
3171+
"type": "integer"
3172+
},
3173+
"background": {
3174+
"type": "GiftBackground"
3175+
},
3176+
"unique_gift_variant_count": {
3177+
"type": "integer"
3178+
},
30973179
"publisher_chat": {
30983180
"type": "Chat"
30993181
}
@@ -3165,7 +3247,39 @@
31653247
"required": true
31663248
}
31673249
},
3250+
"UniqueGiftColors": {
3251+
"model_custom_emoji_id": {
3252+
"type": "string",
3253+
"required": true
3254+
},
3255+
"symbol_custom_emoji_id": {
3256+
"type": "string",
3257+
"required": true
3258+
},
3259+
"light_theme_main_color": {
3260+
"type": "integer",
3261+
"required": true
3262+
},
3263+
"light_theme_other_colors": {
3264+
"type": "array",
3265+
"items": "integer",
3266+
"required": true
3267+
},
3268+
"dark_theme_main_color": {
3269+
"type": "integer",
3270+
"required": true
3271+
},
3272+
"dark_theme_other_colors": {
3273+
"type": "array",
3274+
"items": "integer",
3275+
"required": true
3276+
}
3277+
},
31683278
"UniqueGift": {
3279+
"gift_id": {
3280+
"type": "string",
3281+
"required": true
3282+
},
31693283
"base_name": {
31703284
"type": "string",
31713285
"required": true
@@ -3190,6 +3304,17 @@
31903304
"type": "UniqueGiftBackdrop",
31913305
"required": true
31923306
},
3307+
"is_premium": {
3308+
"type": "boolean",
3309+
"default": true
3310+
},
3311+
"is_from_blockchain": {
3312+
"type": "boolean",
3313+
"default": true
3314+
},
3315+
"colors": {
3316+
"type": "UniqueGiftColors"
3317+
},
31933318
"publisher_chat": {
31943319
"type": "Chat"
31953320
}
@@ -3208,6 +3333,10 @@
32083333
"prepaid_upgrade_star_count": {
32093334
"type": "integer"
32103335
},
3336+
"is_upgrade_separate": {
3337+
"type": "boolean",
3338+
"default": true
3339+
},
32113340
"can_be_upgraded": {
32123341
"type": "boolean",
32133342
"default": true
@@ -3222,6 +3351,9 @@
32223351
"is_private": {
32233352
"type": "boolean",
32243353
"default": true
3354+
},
3355+
"unique_gift_number": {
3356+
"type": "integer"
32253357
}
32263358
},
32273359
"UniqueGiftInfo": {
@@ -3233,7 +3365,10 @@
32333365
"type": "string",
32343366
"required": true
32353367
},
3236-
"last_resale_star_count": {
3368+
"last_resale_currency": {
3369+
"type": "string"
3370+
},
3371+
"last_resale_amount": {
32373372
"type": "integer"
32383373
},
32393374
"owned_gift_id": {
@@ -3301,6 +3436,13 @@
33013436
},
33023437
"prepaid_upgrade_star_count": {
33033438
"type": "integer"
3439+
},
3440+
"is_upgrade_separate": {
3441+
"type": "boolean",
3442+
"default": true
3443+
},
3444+
"unique_gift_number": {
3445+
"type": "integer"
33043446
}
33053447
},
33063448
"OwnedGiftUnique": {
@@ -3369,6 +3511,10 @@
33693511
"premium_subscription": {
33703512
"type": "boolean",
33713513
"required": true
3514+
},
3515+
"gifts_from_channels": {
3516+
"type": "boolean",
3517+
"required": true
33723518
}
33733519
},
33743520
"StarAmount": {
@@ -3948,7 +4094,8 @@
39484094
"type": "boolean"
39494095
}
39504096
},
3951-
"InputFile": {},
4097+
"InputFile": {
4098+
},
39524099
"InputPaidMedia": {
39534100
"type": [
39544101
"InputPaidMediaPhoto",
@@ -6031,7 +6178,8 @@
60316178
"type": "Animation"
60326179
}
60336180
},
6034-
"CallbackGame": {},
6181+
"CallbackGame": {
6182+
},
60356183
"GameHighScore": {
60366184
"position": {
60376185
"type": "integer",

lib/telegram/bot/api/endpoints.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class Api
3131
'sendPoll' => Types::Message,
3232
'sendChecklist' => Types::Message,
3333
'sendDice' => Types::Message,
34+
'sendMessageDraft' => Types::Bool,
3435
'sendChatAction' => Types::Bool,
3536
'setMessageReaction' => Types::Bool,
3637
'getUserProfilePhotos' => Types::UserProfilePhotos,
@@ -113,10 +114,13 @@ class Api
113114
'getBusinessAccountStarBalance' => Types::StarAmount,
114115
'transferBusinessAccountStars' => Types::Bool,
115116
'getBusinessAccountGifts' => Types::OwnedGifts,
117+
'getUserGifts' => Types::OwnedGifts,
118+
'getChatGifts' => Types::OwnedGifts,
116119
'convertGiftToStars' => Types::Bool,
117120
'upgradeGift' => Types::Bool,
118121
'transferGift' => Types::Bool,
119122
'postStory' => Types::Story,
123+
'repostStory' => Types::Story,
120124
'editStory' => Types::Story,
121125
'deleteStory' => Types::Bool,
122126
'editMessageText' => Types::Message | Types::Bool,

lib/telegram/bot/types/accepted_gift_types.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ class AcceptedGiftTypes < Base
88
attribute :limited_gifts, Types::Bool
99
attribute :unique_gifts, Types::Bool
1010
attribute :premium_subscription, Types::Bool
11+
attribute :gifts_from_channels, Types::Bool
1112
end
1213
end
1314
end

lib/telegram/bot/types/chat_full_info.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ class ChatFullInfo < Base
5151
attribute? :custom_emoji_sticker_set_name, Types::String
5252
attribute? :linked_chat_id, Types::Integer
5353
attribute? :location, ChatLocation
54+
attribute? :rating, UserRating
55+
attribute? :unique_gift_colors, UniqueGiftColors
56+
attribute? :paid_message_star_count, Types::Integer
5457
end
5558
end
5659
end

lib/telegram/bot/types/checklist_task.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ class ChecklistTask < Base
88
attribute :text, Types::String
99
attribute? :text_entities, Types::Array.of(MessageEntity)
1010
attribute? :completed_by_user, User
11+
attribute? :completed_by_chat, Chat
1112
attribute? :completion_date, Types::Integer
1213
end
1314
end

lib/telegram/bot/types/forum_topic.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ class ForumTopic < Base
88
attribute :name, Types::String
99
attribute :icon_color, Types::Integer
1010
attribute? :icon_custom_emoji_id, Types::String
11+
attribute? :is_name_implicit, Types::True
1112
end
1213
end
1314
end

lib/telegram/bot/types/forum_topic_created.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ class ForumTopicCreated < Base
77
attribute :name, Types::String
88
attribute :icon_color, Types::Integer
99
attribute? :icon_custom_emoji_id, Types::String
10+
attribute? :is_name_implicit, Types::True
1011
end
1112
end
1213
end

0 commit comments

Comments
 (0)