botapi-py 1.4.5__tar.gz → 1.4.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {botapi_py-1.4.5 → botapi_py-1.4.6}/PKG-INFO +1 -1
- {botapi_py-1.4.5 → botapi_py-1.4.6}/pyproject.toml +1 -1
- {botapi_py-1.4.5 → botapi_py-1.4.6}/src/botapi/methods.py +176 -33
- {botapi_py-1.4.5 → botapi_py-1.4.6}/src/botapi/types.py +114 -50
- {botapi_py-1.4.5 → botapi_py-1.4.6}/src/botapi/__init__.py +0 -0
- {botapi_py-1.4.5 → botapi_py-1.4.6}/src/botapi/__init__.pyi +0 -0
- {botapi_py-1.4.5 → botapi_py-1.4.6}/src/botapi/core.py +0 -0
- {botapi_py-1.4.5 → botapi_py-1.4.6}/src/botapi/dispatchers/__init__.py +0 -0
- {botapi_py-1.4.5 → botapi_py-1.4.6}/src/botapi/dispatchers/__init__.pyi +0 -0
- {botapi_py-1.4.5 → botapi_py-1.4.6}/src/botapi/dispatchers/common.py +0 -0
- {botapi_py-1.4.5 → botapi_py-1.4.6}/src/botapi/dispatchers/get_updates_handler.py +0 -0
- {botapi_py-1.4.5 → botapi_py-1.4.6}/src/botapi/dispatchers/redis_pubsub_handler.py +0 -0
- {botapi_py-1.4.5 → botapi_py-1.4.6}/src/botapi/enums.py +0 -0
- {botapi_py-1.4.5 → botapi_py-1.4.6}/src/botapi/errors.py +0 -0
- {botapi_py-1.4.5 → botapi_py-1.4.6}/src/botapi/utils.py +0 -0
|
@@ -140,6 +140,7 @@ from .types import (
|
|
|
140
140
|
BusinessLocation,
|
|
141
141
|
BusinessOpeningHoursInterval,
|
|
142
142
|
BusinessOpeningHours,
|
|
143
|
+
UserRating,
|
|
143
144
|
StoryAreaPosition,
|
|
144
145
|
LocationAddress,
|
|
145
146
|
StoryAreaType,
|
|
@@ -160,12 +161,14 @@ from .types import (
|
|
|
160
161
|
MessageReactionUpdated,
|
|
161
162
|
MessageReactionCountUpdated,
|
|
162
163
|
ForumTopic,
|
|
164
|
+
GiftBackground,
|
|
163
165
|
Gift,
|
|
164
166
|
Gifts,
|
|
165
167
|
UniqueGiftModel,
|
|
166
168
|
UniqueGiftSymbol,
|
|
167
169
|
UniqueGiftBackdropColors,
|
|
168
170
|
UniqueGiftBackdrop,
|
|
171
|
+
UniqueGiftColors,
|
|
169
172
|
UniqueGift,
|
|
170
173
|
GiftInfo,
|
|
171
174
|
UniqueGiftInfo,
|
|
@@ -522,6 +525,7 @@ class Bot(core.BaseBot):
|
|
|
522
525
|
video_start_timestamp: Optional[int] = None,
|
|
523
526
|
disable_notification: Optional[bool] = None,
|
|
524
527
|
protect_content: Optional[bool] = None,
|
|
528
|
+
message_effect_id: Optional[str] = None,
|
|
525
529
|
suggested_post_parameters: Optional[SuggestedPostParameters] = None,
|
|
526
530
|
) -> Message:
|
|
527
531
|
'''
|
|
@@ -541,6 +545,7 @@ class Bot(core.BaseBot):
|
|
|
541
545
|
'video_start_timestamp': video_start_timestamp,
|
|
542
546
|
'disable_notification': disable_notification,
|
|
543
547
|
'protect_content': protect_content,
|
|
548
|
+
'message_effect_id': message_effect_id,
|
|
544
549
|
'suggested_post_parameters': suggested_post_parameters,
|
|
545
550
|
'message_id': message_id,
|
|
546
551
|
})
|
|
@@ -594,6 +599,7 @@ class Bot(core.BaseBot):
|
|
|
594
599
|
disable_notification: Optional[bool] = None,
|
|
595
600
|
protect_content: Optional[bool] = None,
|
|
596
601
|
allow_paid_broadcast: Optional[bool] = None,
|
|
602
|
+
message_effect_id: Optional[str] = None,
|
|
597
603
|
suggested_post_parameters: Optional[SuggestedPostParameters] = None,
|
|
598
604
|
reply_parameters: Optional[ReplyParameters] = None,
|
|
599
605
|
reply_markup: Optional[Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]] = None,
|
|
@@ -627,6 +633,7 @@ class Bot(core.BaseBot):
|
|
|
627
633
|
'disable_notification': disable_notification,
|
|
628
634
|
'protect_content': protect_content,
|
|
629
635
|
'allow_paid_broadcast': allow_paid_broadcast,
|
|
636
|
+
'message_effect_id': message_effect_id,
|
|
630
637
|
'suggested_post_parameters': suggested_post_parameters,
|
|
631
638
|
'reply_parameters': reply_parameters,
|
|
632
639
|
'reply_markup': reply_markup,
|
|
@@ -1062,7 +1069,7 @@ class Bot(core.BaseBot):
|
|
|
1062
1069
|
self,
|
|
1063
1070
|
chat_id: Union[int, str],
|
|
1064
1071
|
star_count: int,
|
|
1065
|
-
media: List[
|
|
1072
|
+
media: List[InputPaidMedia],
|
|
1066
1073
|
business_connection_id: Optional[str] = None,
|
|
1067
1074
|
message_thread_id: Optional[int] = None,
|
|
1068
1075
|
direct_messages_topic_id: Optional[int] = None,
|
|
@@ -1418,6 +1425,34 @@ class Bot(core.BaseBot):
|
|
|
1418
1425
|
})
|
|
1419
1426
|
return Message.model_validate(response)
|
|
1420
1427
|
|
|
1428
|
+
async def send_message_draft(
|
|
1429
|
+
self,
|
|
1430
|
+
chat_id: int,
|
|
1431
|
+
draft_id: int,
|
|
1432
|
+
text: str,
|
|
1433
|
+
message_thread_id: Optional[int] = None,
|
|
1434
|
+
parse_mode: Optional[enums.ParseMode] = enums.ParseMode.HTML,
|
|
1435
|
+
entities: Optional[List[MessageEntity]] = None,
|
|
1436
|
+
) -> bool:
|
|
1437
|
+
'''
|
|
1438
|
+
Use this method to stream a partial message
|
|
1439
|
+
to a user while the message is being
|
|
1440
|
+
generated; supported only for bots with forum topic
|
|
1441
|
+
mode enabled. Returns True on success.
|
|
1442
|
+
|
|
1443
|
+
Reference: https://core.telegram.org/bots/api#sendmessagedraft
|
|
1444
|
+
'''
|
|
1445
|
+
|
|
1446
|
+
response = await self._send_request('sendMessageDraft', {
|
|
1447
|
+
'chat_id': chat_id,
|
|
1448
|
+
'message_thread_id': message_thread_id,
|
|
1449
|
+
'draft_id': draft_id,
|
|
1450
|
+
'text': text,
|
|
1451
|
+
'parse_mode': parse_mode if not entities else None, # FIX,
|
|
1452
|
+
'entities': entities,
|
|
1453
|
+
})
|
|
1454
|
+
return BoolAdapter.validate_python(response)
|
|
1455
|
+
|
|
1421
1456
|
async def send_chat_action(
|
|
1422
1457
|
self,
|
|
1423
1458
|
chat_id: Union[int, str],
|
|
@@ -1448,7 +1483,7 @@ class Bot(core.BaseBot):
|
|
|
1448
1483
|
self,
|
|
1449
1484
|
chat_id: Union[int, str],
|
|
1450
1485
|
message_id: int,
|
|
1451
|
-
reaction: Optional[List[
|
|
1486
|
+
reaction: Optional[List[ReactionType]] = None,
|
|
1452
1487
|
is_big: Optional[bool] = None,
|
|
1453
1488
|
) -> bool:
|
|
1454
1489
|
'''
|
|
@@ -2158,7 +2193,7 @@ class Bot(core.BaseBot):
|
|
|
2158
2193
|
async def get_chat_administrators(
|
|
2159
2194
|
self,
|
|
2160
2195
|
chat_id: Union[int, str],
|
|
2161
|
-
) -> List[
|
|
2196
|
+
) -> List[ChatMember]:
|
|
2162
2197
|
'''
|
|
2163
2198
|
Use this method to get a list of
|
|
2164
2199
|
administrators in a chat, which aren't bots. Returns
|
|
@@ -2192,7 +2227,7 @@ class Bot(core.BaseBot):
|
|
|
2192
2227
|
self,
|
|
2193
2228
|
chat_id: Union[int, str],
|
|
2194
2229
|
user_id: int,
|
|
2195
|
-
) ->
|
|
2230
|
+
) -> ChatMember:
|
|
2196
2231
|
'''
|
|
2197
2232
|
Use this method to get information about a
|
|
2198
2233
|
member of a chat. The method is only
|
|
@@ -2303,11 +2338,13 @@ class Bot(core.BaseBot):
|
|
|
2303
2338
|
) -> bool:
|
|
2304
2339
|
'''
|
|
2305
2340
|
Use this method to edit name and icon
|
|
2306
|
-
of a topic in a forum supergroup chat
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2341
|
+
of a topic in a forum supergroup chat
|
|
2342
|
+
or a private chat with a user. In
|
|
2343
|
+
the case of a supergroup chat the bot
|
|
2344
|
+
must be an administrator in the chat for
|
|
2345
|
+
this to work and must have the can_manage_topics
|
|
2346
|
+
administrator rights, unless it is the creator of
|
|
2347
|
+
the topic. Returns True on success.
|
|
2311
2348
|
|
|
2312
2349
|
Reference: https://core.telegram.org/bots/api#editforumtopic
|
|
2313
2350
|
'''
|
|
@@ -2372,10 +2409,11 @@ class Bot(core.BaseBot):
|
|
|
2372
2409
|
'''
|
|
2373
2410
|
Use this method to delete a forum topic
|
|
2374
2411
|
along with all its messages in a forum
|
|
2375
|
-
supergroup chat
|
|
2376
|
-
|
|
2377
|
-
must
|
|
2378
|
-
|
|
2412
|
+
supergroup chat or a private chat with a
|
|
2413
|
+
user. In the case of a supergroup chat
|
|
2414
|
+
the bot must be an administrator in the
|
|
2415
|
+
chat for this to work and must have
|
|
2416
|
+
the can_delete_messages administrator rights. Returns True on success.
|
|
2379
2417
|
|
|
2380
2418
|
Reference: https://core.telegram.org/bots/api#deleteforumtopic
|
|
2381
2419
|
'''
|
|
@@ -2393,11 +2431,13 @@ class Bot(core.BaseBot):
|
|
|
2393
2431
|
) -> bool:
|
|
2394
2432
|
'''
|
|
2395
2433
|
Use this method to clear the list of
|
|
2396
|
-
pinned messages in a forum topic
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2434
|
+
pinned messages in a forum topic in a
|
|
2435
|
+
forum supergroup chat or a private chat with
|
|
2436
|
+
a user. In the case of a supergroup
|
|
2437
|
+
chat the bot must be an administrator in
|
|
2438
|
+
the chat for this to work and must
|
|
2439
|
+
have the can_pin_messages administrator right in the supergroup.
|
|
2440
|
+
Returns True on success.
|
|
2401
2441
|
|
|
2402
2442
|
Reference: https://core.telegram.org/bots/api#unpinallforumtopicmessages
|
|
2403
2443
|
'''
|
|
@@ -2594,7 +2634,7 @@ class Bot(core.BaseBot):
|
|
|
2594
2634
|
async def set_my_commands(
|
|
2595
2635
|
self,
|
|
2596
2636
|
commands: List[BotCommand],
|
|
2597
|
-
scope: Optional[
|
|
2637
|
+
scope: Optional[BotCommandScope] = None,
|
|
2598
2638
|
language_code: Optional[str] = None,
|
|
2599
2639
|
) -> bool:
|
|
2600
2640
|
'''
|
|
@@ -2614,7 +2654,7 @@ class Bot(core.BaseBot):
|
|
|
2614
2654
|
|
|
2615
2655
|
async def delete_my_commands(
|
|
2616
2656
|
self,
|
|
2617
|
-
scope: Optional[
|
|
2657
|
+
scope: Optional[BotCommandScope] = None,
|
|
2618
2658
|
language_code: Optional[str] = None,
|
|
2619
2659
|
) -> bool:
|
|
2620
2660
|
'''
|
|
@@ -2635,7 +2675,7 @@ class Bot(core.BaseBot):
|
|
|
2635
2675
|
|
|
2636
2676
|
async def get_my_commands(
|
|
2637
2677
|
self,
|
|
2638
|
-
scope: Optional[
|
|
2678
|
+
scope: Optional[BotCommandScope] = None,
|
|
2639
2679
|
language_code: Optional[str] = None,
|
|
2640
2680
|
) -> List[BotCommand]:
|
|
2641
2681
|
'''
|
|
@@ -2767,7 +2807,7 @@ class Bot(core.BaseBot):
|
|
|
2767
2807
|
async def set_chat_menu_button(
|
|
2768
2808
|
self,
|
|
2769
2809
|
chat_id: Optional[int] = None,
|
|
2770
|
-
menu_button: Optional[
|
|
2810
|
+
menu_button: Optional[MenuButton] = None,
|
|
2771
2811
|
) -> bool:
|
|
2772
2812
|
'''
|
|
2773
2813
|
Use this method to change the bot's menu
|
|
@@ -2786,7 +2826,7 @@ class Bot(core.BaseBot):
|
|
|
2786
2826
|
async def get_chat_menu_button(
|
|
2787
2827
|
self,
|
|
2788
2828
|
chat_id: Optional[int] = None,
|
|
2789
|
-
) ->
|
|
2829
|
+
) -> MenuButton:
|
|
2790
2830
|
'''
|
|
2791
2831
|
Use this method to get the current value
|
|
2792
2832
|
of the bot's menu button in a private
|
|
@@ -3086,7 +3126,7 @@ class Bot(core.BaseBot):
|
|
|
3086
3126
|
async def set_business_account_profile_photo(
|
|
3087
3127
|
self,
|
|
3088
3128
|
business_connection_id: str,
|
|
3089
|
-
photo:
|
|
3129
|
+
photo: InputProfilePhoto,
|
|
3090
3130
|
is_public: Optional[bool] = None,
|
|
3091
3131
|
) -> bool:
|
|
3092
3132
|
'''
|
|
@@ -3186,8 +3226,10 @@ class Bot(core.BaseBot):
|
|
|
3186
3226
|
exclude_unsaved: Optional[bool] = None,
|
|
3187
3227
|
exclude_saved: Optional[bool] = None,
|
|
3188
3228
|
exclude_unlimited: Optional[bool] = None,
|
|
3189
|
-
|
|
3229
|
+
exclude_limited_upgradable: Optional[bool] = None,
|
|
3230
|
+
exclude_limited_non_upgradable: Optional[bool] = None,
|
|
3190
3231
|
exclude_unique: Optional[bool] = None,
|
|
3232
|
+
exclude_from_blockchain: Optional[bool] = None,
|
|
3191
3233
|
sort_by_price: Optional[bool] = None,
|
|
3192
3234
|
offset: Optional[str] = None,
|
|
3193
3235
|
limit: Optional[int] = None,
|
|
@@ -3205,7 +3247,77 @@ class Bot(core.BaseBot):
|
|
|
3205
3247
|
'exclude_unsaved': exclude_unsaved,
|
|
3206
3248
|
'exclude_saved': exclude_saved,
|
|
3207
3249
|
'exclude_unlimited': exclude_unlimited,
|
|
3208
|
-
'
|
|
3250
|
+
'exclude_limited_upgradable': exclude_limited_upgradable,
|
|
3251
|
+
'exclude_limited_non_upgradable': exclude_limited_non_upgradable,
|
|
3252
|
+
'exclude_unique': exclude_unique,
|
|
3253
|
+
'exclude_from_blockchain': exclude_from_blockchain,
|
|
3254
|
+
'sort_by_price': sort_by_price,
|
|
3255
|
+
'offset': offset,
|
|
3256
|
+
'limit': limit,
|
|
3257
|
+
})
|
|
3258
|
+
return OwnedGifts.model_validate(response)
|
|
3259
|
+
|
|
3260
|
+
async def get_user_gifts(
|
|
3261
|
+
self,
|
|
3262
|
+
user_id: int,
|
|
3263
|
+
exclude_unlimited: Optional[bool] = None,
|
|
3264
|
+
exclude_limited_upgradable: Optional[bool] = None,
|
|
3265
|
+
exclude_limited_non_upgradable: Optional[bool] = None,
|
|
3266
|
+
exclude_from_blockchain: Optional[bool] = None,
|
|
3267
|
+
exclude_unique: Optional[bool] = None,
|
|
3268
|
+
sort_by_price: Optional[bool] = None,
|
|
3269
|
+
offset: Optional[str] = None,
|
|
3270
|
+
limit: Optional[int] = None,
|
|
3271
|
+
) -> OwnedGifts:
|
|
3272
|
+
'''
|
|
3273
|
+
Returns the gifts owned and hosted by a
|
|
3274
|
+
user. Returns OwnedGifts on success.
|
|
3275
|
+
|
|
3276
|
+
Reference: https://core.telegram.org/bots/api#getusergifts
|
|
3277
|
+
'''
|
|
3278
|
+
|
|
3279
|
+
response = await self._send_request('getUserGifts', {
|
|
3280
|
+
'user_id': user_id,
|
|
3281
|
+
'exclude_unlimited': exclude_unlimited,
|
|
3282
|
+
'exclude_limited_upgradable': exclude_limited_upgradable,
|
|
3283
|
+
'exclude_limited_non_upgradable': exclude_limited_non_upgradable,
|
|
3284
|
+
'exclude_from_blockchain': exclude_from_blockchain,
|
|
3285
|
+
'exclude_unique': exclude_unique,
|
|
3286
|
+
'sort_by_price': sort_by_price,
|
|
3287
|
+
'offset': offset,
|
|
3288
|
+
'limit': limit,
|
|
3289
|
+
})
|
|
3290
|
+
return OwnedGifts.model_validate(response)
|
|
3291
|
+
|
|
3292
|
+
async def get_chat_gifts(
|
|
3293
|
+
self,
|
|
3294
|
+
chat_id: Union[int, str],
|
|
3295
|
+
exclude_unsaved: Optional[bool] = None,
|
|
3296
|
+
exclude_saved: Optional[bool] = None,
|
|
3297
|
+
exclude_unlimited: Optional[bool] = None,
|
|
3298
|
+
exclude_limited_upgradable: Optional[bool] = None,
|
|
3299
|
+
exclude_limited_non_upgradable: Optional[bool] = None,
|
|
3300
|
+
exclude_from_blockchain: Optional[bool] = None,
|
|
3301
|
+
exclude_unique: Optional[bool] = None,
|
|
3302
|
+
sort_by_price: Optional[bool] = None,
|
|
3303
|
+
offset: Optional[str] = None,
|
|
3304
|
+
limit: Optional[int] = None,
|
|
3305
|
+
) -> OwnedGifts:
|
|
3306
|
+
'''
|
|
3307
|
+
Returns the gifts owned by a chat. Returns
|
|
3308
|
+
OwnedGifts on success.
|
|
3309
|
+
|
|
3310
|
+
Reference: https://core.telegram.org/bots/api#getchatgifts
|
|
3311
|
+
'''
|
|
3312
|
+
|
|
3313
|
+
response = await self._send_request('getChatGifts', {
|
|
3314
|
+
'chat_id': chat_id,
|
|
3315
|
+
'exclude_unsaved': exclude_unsaved,
|
|
3316
|
+
'exclude_saved': exclude_saved,
|
|
3317
|
+
'exclude_unlimited': exclude_unlimited,
|
|
3318
|
+
'exclude_limited_upgradable': exclude_limited_upgradable,
|
|
3319
|
+
'exclude_limited_non_upgradable': exclude_limited_non_upgradable,
|
|
3320
|
+
'exclude_from_blockchain': exclude_from_blockchain,
|
|
3209
3321
|
'exclude_unique': exclude_unique,
|
|
3210
3322
|
'sort_by_price': sort_by_price,
|
|
3211
3323
|
'offset': offset,
|
|
@@ -3283,7 +3395,7 @@ class Bot(core.BaseBot):
|
|
|
3283
3395
|
async def post_story(
|
|
3284
3396
|
self,
|
|
3285
3397
|
business_connection_id: str,
|
|
3286
|
-
content:
|
|
3398
|
+
content: InputStoryContent,
|
|
3287
3399
|
active_period: int,
|
|
3288
3400
|
caption: Optional[str] = None,
|
|
3289
3401
|
parse_mode: Optional[enums.ParseMode] = enums.ParseMode.HTML,
|
|
@@ -3313,11 +3425,42 @@ class Bot(core.BaseBot):
|
|
|
3313
3425
|
})
|
|
3314
3426
|
return Story.model_validate(response)
|
|
3315
3427
|
|
|
3428
|
+
async def repost_story(
|
|
3429
|
+
self,
|
|
3430
|
+
business_connection_id: str,
|
|
3431
|
+
from_chat_id: int,
|
|
3432
|
+
from_story_id: int,
|
|
3433
|
+
active_period: int,
|
|
3434
|
+
post_to_chat_page: Optional[bool] = None,
|
|
3435
|
+
protect_content: Optional[bool] = None,
|
|
3436
|
+
) -> Story:
|
|
3437
|
+
'''
|
|
3438
|
+
Reposts a story on behalf of a business
|
|
3439
|
+
account from another business account. Both business accounts
|
|
3440
|
+
must be managed by the same bot, and
|
|
3441
|
+
the story on the source account must have
|
|
3442
|
+
been posted (or reposted) by the bot. Requires
|
|
3443
|
+
the can_manage_stories business bot right for both business
|
|
3444
|
+
accounts. Returns Story on success.
|
|
3445
|
+
|
|
3446
|
+
Reference: https://core.telegram.org/bots/api#repoststory
|
|
3447
|
+
'''
|
|
3448
|
+
|
|
3449
|
+
response = await self._send_request('repostStory', {
|
|
3450
|
+
'business_connection_id': business_connection_id,
|
|
3451
|
+
'from_chat_id': from_chat_id,
|
|
3452
|
+
'from_story_id': from_story_id,
|
|
3453
|
+
'active_period': active_period,
|
|
3454
|
+
'post_to_chat_page': post_to_chat_page,
|
|
3455
|
+
'protect_content': protect_content,
|
|
3456
|
+
})
|
|
3457
|
+
return Story.model_validate(response)
|
|
3458
|
+
|
|
3316
3459
|
async def edit_story(
|
|
3317
3460
|
self,
|
|
3318
3461
|
business_connection_id: str,
|
|
3319
3462
|
story_id: int,
|
|
3320
|
-
content:
|
|
3463
|
+
content: InputStoryContent,
|
|
3321
3464
|
caption: Optional[str] = None,
|
|
3322
3465
|
parse_mode: Optional[enums.ParseMode] = enums.ParseMode.HTML,
|
|
3323
3466
|
caption_entities: Optional[List[MessageEntity]] = None,
|
|
@@ -3447,7 +3590,7 @@ class Bot(core.BaseBot):
|
|
|
3447
3590
|
|
|
3448
3591
|
async def edit_message_media(
|
|
3449
3592
|
self,
|
|
3450
|
-
media:
|
|
3593
|
+
media: InputMedia,
|
|
3451
3594
|
business_connection_id: Optional[str] = None,
|
|
3452
3595
|
chat_id: Optional[Union[int, str]] = None,
|
|
3453
3596
|
message_id: Optional[int] = None,
|
|
@@ -4091,7 +4234,7 @@ class Bot(core.BaseBot):
|
|
|
4091
4234
|
async def answer_inline_query(
|
|
4092
4235
|
self,
|
|
4093
4236
|
inline_query_id: str,
|
|
4094
|
-
results: List[
|
|
4237
|
+
results: List[InlineQueryResult],
|
|
4095
4238
|
cache_time: Optional[int] = None,
|
|
4096
4239
|
is_personal: Optional[bool] = None,
|
|
4097
4240
|
next_offset: Optional[str] = None,
|
|
@@ -4118,7 +4261,7 @@ class Bot(core.BaseBot):
|
|
|
4118
4261
|
async def answer_web_app_query(
|
|
4119
4262
|
self,
|
|
4120
4263
|
web_app_query_id: str,
|
|
4121
|
-
result:
|
|
4264
|
+
result: InlineQueryResult,
|
|
4122
4265
|
) -> SentWebAppMessage:
|
|
4123
4266
|
'''
|
|
4124
4267
|
Use this method to set the result of
|
|
@@ -4139,7 +4282,7 @@ class Bot(core.BaseBot):
|
|
|
4139
4282
|
async def save_prepared_inline_message(
|
|
4140
4283
|
self,
|
|
4141
4284
|
user_id: int,
|
|
4142
|
-
result:
|
|
4285
|
+
result: InlineQueryResult,
|
|
4143
4286
|
allow_user_chats: Optional[bool] = None,
|
|
4144
4287
|
allow_bot_chats: Optional[bool] = None,
|
|
4145
4288
|
allow_group_chats: Optional[bool] = None,
|
|
@@ -4424,7 +4567,7 @@ class Bot(core.BaseBot):
|
|
|
4424
4567
|
async def set_passport_data_errors(
|
|
4425
4568
|
self,
|
|
4426
4569
|
user_id: int,
|
|
4427
|
-
errors: List[
|
|
4570
|
+
errors: List[PassportElementError],
|
|
4428
4571
|
) -> bool:
|
|
4429
4572
|
'''
|
|
4430
4573
|
Informs a user that some of the Telegram
|
|
@@ -34,7 +34,7 @@ class Message(MaybeInaccessibleMessage, frozen=True):
|
|
|
34
34
|
sender_boost_count: Optional[int] = Field(default=None)
|
|
35
35
|
sender_business_bot: Optional[User] = Field(default=None)
|
|
36
36
|
business_connection_id: Optional[str] = Field(default=None)
|
|
37
|
-
forward_origin: Optional[
|
|
37
|
+
forward_origin: Optional[MessageOrigin] = Field(default=None)
|
|
38
38
|
is_topic_message: Optional[bool] = Field(default=None)
|
|
39
39
|
is_automatic_forward: Optional[bool] = Field(default=None)
|
|
40
40
|
reply_to_message: Optional[Message] = Field(default=None)
|
|
@@ -87,7 +87,7 @@ class Message(MaybeInaccessibleMessage, frozen=True):
|
|
|
87
87
|
message_auto_delete_timer_changed: Optional[MessageAutoDeleteTimerChanged] = Field(default=None)
|
|
88
88
|
migrate_to_chat_id: Optional[int] = Field(default=None)
|
|
89
89
|
migrate_from_chat_id: Optional[int] = Field(default=None)
|
|
90
|
-
pinned_message: Optional[
|
|
90
|
+
pinned_message: Optional[MaybeInaccessibleMessage] = Field(default=None)
|
|
91
91
|
invoice: Optional[Invoice] = Field(default=None)
|
|
92
92
|
successful_payment: Optional[SuccessfulPayment] = Field(default=None)
|
|
93
93
|
refunded_payment: Optional[RefundedPayment] = Field(default=None)
|
|
@@ -95,6 +95,7 @@ class Message(MaybeInaccessibleMessage, frozen=True):
|
|
|
95
95
|
chat_shared: Optional[ChatShared] = Field(default=None)
|
|
96
96
|
gift: Optional[GiftInfo] = Field(default=None)
|
|
97
97
|
unique_gift: Optional[UniqueGiftInfo] = Field(default=None)
|
|
98
|
+
gift_upgrade_sent: Optional[GiftInfo] = Field(default=None)
|
|
98
99
|
connected_website: Optional[str] = Field(default=None)
|
|
99
100
|
write_access_allowed: Optional[WriteAccessAllowed] = Field(default=None)
|
|
100
101
|
passport_data: Optional[PassportData] = Field(default=None)
|
|
@@ -554,7 +555,7 @@ class BackgroundTypeFill(BackgroundType, frozen=True):
|
|
|
554
555
|
'''
|
|
555
556
|
|
|
556
557
|
type: Literal['fill'] = 'fill'
|
|
557
|
-
fill:
|
|
558
|
+
fill: BackgroundFill
|
|
558
559
|
dark_theme_dimming: int
|
|
559
560
|
|
|
560
561
|
class BackgroundTypeWallpaper(BackgroundType, frozen=True):
|
|
@@ -583,7 +584,7 @@ class BackgroundTypePattern(BackgroundType, frozen=True):
|
|
|
583
584
|
|
|
584
585
|
type: Literal['pattern'] = 'pattern'
|
|
585
586
|
document: Document
|
|
586
|
-
fill:
|
|
587
|
+
fill: BackgroundFill
|
|
587
588
|
intensity: int
|
|
588
589
|
is_inverted: Optional[bool] = Field(default=None)
|
|
589
590
|
is_moving: Optional[bool] = Field(default=None)
|
|
@@ -754,7 +755,7 @@ class StoryAreaTypeSuggestedReaction(StoryAreaType, frozen=True):
|
|
|
754
755
|
'''
|
|
755
756
|
|
|
756
757
|
type: Literal['suggested_reaction'] = 'suggested_reaction'
|
|
757
|
-
reaction_type:
|
|
758
|
+
reaction_type: ReactionType
|
|
758
759
|
is_dark: Optional[bool] = Field(default=None)
|
|
759
760
|
is_flipped: Optional[bool] = Field(default=None)
|
|
760
761
|
|
|
@@ -871,7 +872,9 @@ class OwnedGiftRegular(OwnedGift, frozen=True):
|
|
|
871
872
|
can_be_upgraded: Optional[bool] = Field(default=None)
|
|
872
873
|
was_refunded: Optional[bool] = Field(default=None)
|
|
873
874
|
convert_star_count: Optional[int] = Field(default=None)
|
|
874
|
-
prepaid_upgrade_star_count: Optional[int] = Field(default=None)
|
|
875
|
+
prepaid_upgrade_star_count: Optional[int] = Field(default=None)
|
|
876
|
+
is_upgrade_separate: Optional[bool] = Field(default=None)
|
|
877
|
+
unique_gift_number: Optional[int] = Field(default=None)
|
|
875
878
|
|
|
876
879
|
class OwnedGiftUnique(OwnedGift, frozen=True):
|
|
877
880
|
'''
|
|
@@ -1311,7 +1314,7 @@ class InlineQueryResultCachedAudio(InlineQueryResult, frozen=True):
|
|
|
1311
1314
|
parse_mode: Optional[str] = Field(default=enums.ParseMode.HTML.value)
|
|
1312
1315
|
caption_entities: Optional[List[MessageEntity]] = Field(default=None)
|
|
1313
1316
|
reply_markup: Optional[InlineKeyboardMarkup] = Field(default=None)
|
|
1314
|
-
input_message_content: Optional[
|
|
1317
|
+
input_message_content: Optional[InputMessageContent] = Field(default=None)
|
|
1315
1318
|
|
|
1316
1319
|
class InlineQueryResultCachedDocument(InlineQueryResult, frozen=True):
|
|
1317
1320
|
'''
|
|
@@ -1334,7 +1337,7 @@ class InlineQueryResultCachedDocument(InlineQueryResult, frozen=True):
|
|
|
1334
1337
|
parse_mode: Optional[str] = Field(default=enums.ParseMode.HTML.value)
|
|
1335
1338
|
caption_entities: Optional[List[MessageEntity]] = Field(default=None)
|
|
1336
1339
|
reply_markup: Optional[InlineKeyboardMarkup] = Field(default=None)
|
|
1337
|
-
input_message_content: Optional[
|
|
1340
|
+
input_message_content: Optional[InputMessageContent] = Field(default=None)
|
|
1338
1341
|
|
|
1339
1342
|
class InlineQueryResultCachedGif(InlineQueryResult, frozen=True):
|
|
1340
1343
|
'''
|
|
@@ -1357,7 +1360,7 @@ class InlineQueryResultCachedGif(InlineQueryResult, frozen=True):
|
|
|
1357
1360
|
caption_entities: Optional[List[MessageEntity]] = Field(default=None)
|
|
1358
1361
|
show_caption_above_media: Optional[bool] = Field(default=None)
|
|
1359
1362
|
reply_markup: Optional[InlineKeyboardMarkup] = Field(default=None)
|
|
1360
|
-
input_message_content: Optional[
|
|
1363
|
+
input_message_content: Optional[InputMessageContent] = Field(default=None)
|
|
1361
1364
|
|
|
1362
1365
|
class InlineQueryResultCachedMpeg4Gif(InlineQueryResult, frozen=True):
|
|
1363
1366
|
'''
|
|
@@ -1381,7 +1384,7 @@ class InlineQueryResultCachedMpeg4Gif(InlineQueryResult, frozen=True):
|
|
|
1381
1384
|
caption_entities: Optional[List[MessageEntity]] = Field(default=None)
|
|
1382
1385
|
show_caption_above_media: Optional[bool] = Field(default=None)
|
|
1383
1386
|
reply_markup: Optional[InlineKeyboardMarkup] = Field(default=None)
|
|
1384
|
-
input_message_content: Optional[
|
|
1387
|
+
input_message_content: Optional[InputMessageContent] = Field(default=None)
|
|
1385
1388
|
|
|
1386
1389
|
class InlineQueryResultCachedPhoto(InlineQueryResult, frozen=True):
|
|
1387
1390
|
'''
|
|
@@ -1405,7 +1408,7 @@ class InlineQueryResultCachedPhoto(InlineQueryResult, frozen=True):
|
|
|
1405
1408
|
caption_entities: Optional[List[MessageEntity]] = Field(default=None)
|
|
1406
1409
|
show_caption_above_media: Optional[bool] = Field(default=None)
|
|
1407
1410
|
reply_markup: Optional[InlineKeyboardMarkup] = Field(default=None)
|
|
1408
|
-
input_message_content: Optional[
|
|
1411
|
+
input_message_content: Optional[InputMessageContent] = Field(default=None)
|
|
1409
1412
|
|
|
1410
1413
|
class InlineQueryResultCachedSticker(InlineQueryResult, frozen=True):
|
|
1411
1414
|
'''
|
|
@@ -1422,7 +1425,7 @@ class InlineQueryResultCachedSticker(InlineQueryResult, frozen=True):
|
|
|
1422
1425
|
id: str
|
|
1423
1426
|
sticker_file_id: str
|
|
1424
1427
|
reply_markup: Optional[InlineKeyboardMarkup] = Field(default=None)
|
|
1425
|
-
input_message_content: Optional[
|
|
1428
|
+
input_message_content: Optional[InputMessageContent] = Field(default=None)
|
|
1426
1429
|
|
|
1427
1430
|
class InlineQueryResultCachedVideo(InlineQueryResult, frozen=True):
|
|
1428
1431
|
'''
|
|
@@ -1446,7 +1449,7 @@ class InlineQueryResultCachedVideo(InlineQueryResult, frozen=True):
|
|
|
1446
1449
|
caption_entities: Optional[List[MessageEntity]] = Field(default=None)
|
|
1447
1450
|
show_caption_above_media: Optional[bool] = Field(default=None)
|
|
1448
1451
|
reply_markup: Optional[InlineKeyboardMarkup] = Field(default=None)
|
|
1449
|
-
input_message_content: Optional[
|
|
1452
|
+
input_message_content: Optional[InputMessageContent] = Field(default=None)
|
|
1450
1453
|
|
|
1451
1454
|
class InlineQueryResultCachedVoice(InlineQueryResult, frozen=True):
|
|
1452
1455
|
'''
|
|
@@ -1468,7 +1471,7 @@ class InlineQueryResultCachedVoice(InlineQueryResult, frozen=True):
|
|
|
1468
1471
|
parse_mode: Optional[str] = Field(default=enums.ParseMode.HTML.value)
|
|
1469
1472
|
caption_entities: Optional[List[MessageEntity]] = Field(default=None)
|
|
1470
1473
|
reply_markup: Optional[InlineKeyboardMarkup] = Field(default=None)
|
|
1471
|
-
input_message_content: Optional[
|
|
1474
|
+
input_message_content: Optional[InputMessageContent] = Field(default=None)
|
|
1472
1475
|
|
|
1473
1476
|
class InlineQueryResultArticle(InlineQueryResult, frozen=True):
|
|
1474
1477
|
'''
|
|
@@ -1481,7 +1484,7 @@ class InlineQueryResultArticle(InlineQueryResult, frozen=True):
|
|
|
1481
1484
|
type: Literal['article'] = 'article'
|
|
1482
1485
|
id: str
|
|
1483
1486
|
title: str
|
|
1484
|
-
input_message_content:
|
|
1487
|
+
input_message_content: InputMessageContent
|
|
1485
1488
|
reply_markup: Optional[InlineKeyboardMarkup] = Field(default=None)
|
|
1486
1489
|
url: Optional[str] = Field(default=None)
|
|
1487
1490
|
description: Optional[str] = Field(default=None)
|
|
@@ -1510,7 +1513,7 @@ class InlineQueryResultAudio(InlineQueryResult, frozen=True):
|
|
|
1510
1513
|
performer: Optional[str] = Field(default=None)
|
|
1511
1514
|
audio_duration: Optional[int] = Field(default=None)
|
|
1512
1515
|
reply_markup: Optional[InlineKeyboardMarkup] = Field(default=None)
|
|
1513
|
-
input_message_content: Optional[
|
|
1516
|
+
input_message_content: Optional[InputMessageContent] = Field(default=None)
|
|
1514
1517
|
|
|
1515
1518
|
class InlineQueryResultContact(InlineQueryResult, frozen=True):
|
|
1516
1519
|
'''
|
|
@@ -1530,7 +1533,7 @@ class InlineQueryResultContact(InlineQueryResult, frozen=True):
|
|
|
1530
1533
|
last_name: Optional[str] = Field(default=None)
|
|
1531
1534
|
vcard: Optional[str] = Field(default=None)
|
|
1532
1535
|
reply_markup: Optional[InlineKeyboardMarkup] = Field(default=None)
|
|
1533
|
-
input_message_content: Optional[
|
|
1536
|
+
input_message_content: Optional[InputMessageContent] = Field(default=None)
|
|
1534
1537
|
thumbnail_url: Optional[str] = Field(default=None)
|
|
1535
1538
|
thumbnail_width: Optional[int] = Field(default=None)
|
|
1536
1539
|
thumbnail_height: Optional[int] = Field(default=None)
|
|
@@ -1570,7 +1573,7 @@ class InlineQueryResultDocument(InlineQueryResult, frozen=True):
|
|
|
1570
1573
|
caption_entities: Optional[List[MessageEntity]] = Field(default=None)
|
|
1571
1574
|
description: Optional[str] = Field(default=None)
|
|
1572
1575
|
reply_markup: Optional[InlineKeyboardMarkup] = Field(default=None)
|
|
1573
|
-
input_message_content: Optional[
|
|
1576
|
+
input_message_content: Optional[InputMessageContent] = Field(default=None)
|
|
1574
1577
|
thumbnail_url: Optional[str] = Field(default=None)
|
|
1575
1578
|
thumbnail_width: Optional[int] = Field(default=None)
|
|
1576
1579
|
thumbnail_height: Optional[int] = Field(default=None)
|
|
@@ -1600,7 +1603,7 @@ class InlineQueryResultGif(InlineQueryResult, frozen=True):
|
|
|
1600
1603
|
caption_entities: Optional[List[MessageEntity]] = Field(default=None)
|
|
1601
1604
|
show_caption_above_media: Optional[bool] = Field(default=None)
|
|
1602
1605
|
reply_markup: Optional[InlineKeyboardMarkup] = Field(default=None)
|
|
1603
|
-
input_message_content: Optional[
|
|
1606
|
+
input_message_content: Optional[InputMessageContent] = Field(default=None)
|
|
1604
1607
|
|
|
1605
1608
|
class InlineQueryResultLocation(InlineQueryResult, frozen=True):
|
|
1606
1609
|
'''
|
|
@@ -1623,7 +1626,7 @@ class InlineQueryResultLocation(InlineQueryResult, frozen=True):
|
|
|
1623
1626
|
heading: Optional[int] = Field(default=None)
|
|
1624
1627
|
proximity_alert_radius: Optional[int] = Field(default=None)
|
|
1625
1628
|
reply_markup: Optional[InlineKeyboardMarkup] = Field(default=None)
|
|
1626
|
-
input_message_content: Optional[
|
|
1629
|
+
input_message_content: Optional[InputMessageContent] = Field(default=None)
|
|
1627
1630
|
thumbnail_url: Optional[str] = Field(default=None)
|
|
1628
1631
|
thumbnail_width: Optional[int] = Field(default=None)
|
|
1629
1632
|
thumbnail_height: Optional[int] = Field(default=None)
|
|
@@ -1654,7 +1657,7 @@ class InlineQueryResultMpeg4Gif(InlineQueryResult, frozen=True):
|
|
|
1654
1657
|
caption_entities: Optional[List[MessageEntity]] = Field(default=None)
|
|
1655
1658
|
show_caption_above_media: Optional[bool] = Field(default=None)
|
|
1656
1659
|
reply_markup: Optional[InlineKeyboardMarkup] = Field(default=None)
|
|
1657
|
-
input_message_content: Optional[
|
|
1660
|
+
input_message_content: Optional[InputMessageContent] = Field(default=None)
|
|
1658
1661
|
|
|
1659
1662
|
class InlineQueryResultPhoto(InlineQueryResult, frozen=True):
|
|
1660
1663
|
'''
|
|
@@ -1680,7 +1683,7 @@ class InlineQueryResultPhoto(InlineQueryResult, frozen=True):
|
|
|
1680
1683
|
caption_entities: Optional[List[MessageEntity]] = Field(default=None)
|
|
1681
1684
|
show_caption_above_media: Optional[bool] = Field(default=None)
|
|
1682
1685
|
reply_markup: Optional[InlineKeyboardMarkup] = Field(default=None)
|
|
1683
|
-
input_message_content: Optional[
|
|
1686
|
+
input_message_content: Optional[InputMessageContent] = Field(default=None)
|
|
1684
1687
|
|
|
1685
1688
|
class InlineQueryResultVenue(InlineQueryResult, frozen=True):
|
|
1686
1689
|
'''
|
|
@@ -1703,7 +1706,7 @@ class InlineQueryResultVenue(InlineQueryResult, frozen=True):
|
|
|
1703
1706
|
google_place_id: Optional[str] = Field(default=None)
|
|
1704
1707
|
google_place_type: Optional[str] = Field(default=None)
|
|
1705
1708
|
reply_markup: Optional[InlineKeyboardMarkup] = Field(default=None)
|
|
1706
|
-
input_message_content: Optional[
|
|
1709
|
+
input_message_content: Optional[InputMessageContent] = Field(default=None)
|
|
1707
1710
|
thumbnail_url: Optional[str] = Field(default=None)
|
|
1708
1711
|
thumbnail_width: Optional[int] = Field(default=None)
|
|
1709
1712
|
thumbnail_height: Optional[int] = Field(default=None)
|
|
@@ -1735,7 +1738,7 @@ class InlineQueryResultVideo(InlineQueryResult, frozen=True):
|
|
|
1735
1738
|
video_duration: Optional[int] = Field(default=None)
|
|
1736
1739
|
description: Optional[str] = Field(default=None)
|
|
1737
1740
|
reply_markup: Optional[InlineKeyboardMarkup] = Field(default=None)
|
|
1738
|
-
input_message_content: Optional[
|
|
1741
|
+
input_message_content: Optional[InputMessageContent] = Field(default=None)
|
|
1739
1742
|
|
|
1740
1743
|
class InlineQueryResultVoice(InlineQueryResult, frozen=True):
|
|
1741
1744
|
'''
|
|
@@ -1758,7 +1761,7 @@ class InlineQueryResultVoice(InlineQueryResult, frozen=True):
|
|
|
1758
1761
|
caption_entities: Optional[List[MessageEntity]] = Field(default=None)
|
|
1759
1762
|
voice_duration: Optional[int] = Field(default=None)
|
|
1760
1763
|
reply_markup: Optional[InlineKeyboardMarkup] = Field(default=None)
|
|
1761
|
-
input_message_content: Optional[
|
|
1764
|
+
input_message_content: Optional[InputMessageContent] = Field(default=None)
|
|
1762
1765
|
|
|
1763
1766
|
_InlineQueryResult = Union[
|
|
1764
1767
|
InlineQueryResultCachedAudio,
|
|
@@ -1943,7 +1946,7 @@ class TransactionPartnerUser(TransactionPartner, frozen=True):
|
|
|
1943
1946
|
affiliate: Optional[AffiliateInfo] = Field(default=None)
|
|
1944
1947
|
invoice_payload: Optional[str] = Field(default=None)
|
|
1945
1948
|
subscription_period: Optional[int] = Field(default=None)
|
|
1946
|
-
paid_media: Optional[List[
|
|
1949
|
+
paid_media: Optional[List[PaidMedia]] = Field(default=None)
|
|
1947
1950
|
paid_media_payload: Optional[str] = Field(default=None)
|
|
1948
1951
|
gift: Optional[Gift] = Field(default=None)
|
|
1949
1952
|
premium_subscription_duration: Optional[int] = Field(default=None)
|
|
@@ -1979,7 +1982,7 @@ class TransactionPartnerFragment(TransactionPartner, frozen=True):
|
|
|
1979
1982
|
'''
|
|
1980
1983
|
|
|
1981
1984
|
type: Literal['fragment'] = 'fragment'
|
|
1982
|
-
withdrawal_state: Optional[
|
|
1985
|
+
withdrawal_state: Optional[RevenueWithdrawalState] = Field(default=None)
|
|
1983
1986
|
|
|
1984
1987
|
class TransactionPartnerTelegramAds(TransactionPartner, frozen=True):
|
|
1985
1988
|
'''
|
|
@@ -2250,7 +2253,8 @@ class User(BaseModel, frozen=True):
|
|
|
2250
2253
|
can_read_all_group_messages: Optional[bool] = Field(default=None)
|
|
2251
2254
|
supports_inline_queries: Optional[bool] = Field(default=None)
|
|
2252
2255
|
can_connect_to_business: Optional[bool] = Field(default=None)
|
|
2253
|
-
has_main_web_app: Optional[bool] = Field(default=None)
|
|
2256
|
+
has_main_web_app: Optional[bool] = Field(default=None)
|
|
2257
|
+
has_topics_enabled: Optional[bool] = Field(default=None)
|
|
2254
2258
|
|
|
2255
2259
|
class Chat(BaseModel, frozen=True):
|
|
2256
2260
|
'''
|
|
@@ -2294,7 +2298,7 @@ class ChatFullInfo(BaseModel, frozen=True):
|
|
|
2294
2298
|
business_opening_hours: Optional[BusinessOpeningHours] = Field(default=None)
|
|
2295
2299
|
personal_chat: Optional[Chat] = Field(default=None)
|
|
2296
2300
|
parent_chat: Optional[Chat] = Field(default=None)
|
|
2297
|
-
available_reactions: Optional[List[
|
|
2301
|
+
available_reactions: Optional[List[ReactionType]] = Field(default=None)
|
|
2298
2302
|
background_custom_emoji_id: Optional[str] = Field(default=None)
|
|
2299
2303
|
profile_accent_color_id: Optional[int] = Field(default=None)
|
|
2300
2304
|
profile_background_custom_emoji_id: Optional[str] = Field(default=None)
|
|
@@ -2321,7 +2325,10 @@ class ChatFullInfo(BaseModel, frozen=True):
|
|
|
2321
2325
|
can_set_sticker_set: Optional[bool] = Field(default=None)
|
|
2322
2326
|
custom_emoji_sticker_set_name: Optional[str] = Field(default=None)
|
|
2323
2327
|
linked_chat_id: Optional[int] = Field(default=None)
|
|
2324
|
-
location: Optional[ChatLocation] = Field(default=None)
|
|
2328
|
+
location: Optional[ChatLocation] = Field(default=None)
|
|
2329
|
+
rating: Optional[UserRating] = Field(default=None)
|
|
2330
|
+
unique_gift_colors: Optional[UniqueGiftColors] = Field(default=None)
|
|
2331
|
+
paid_message_star_count: Optional[int] = Field(default=None)
|
|
2325
2332
|
|
|
2326
2333
|
class MessageId(BaseModel, frozen=True):
|
|
2327
2334
|
'''
|
|
@@ -2390,7 +2397,7 @@ class ExternalReplyInfo(BaseModel, frozen=True):
|
|
|
2390
2397
|
Reference: https://core.telegram.org/bots/api#externalreplyinfo
|
|
2391
2398
|
'''
|
|
2392
2399
|
|
|
2393
|
-
origin:
|
|
2400
|
+
origin: MessageOrigin
|
|
2394
2401
|
chat: Optional[Chat] = Field(default=None)
|
|
2395
2402
|
message_id: Optional[int] = Field(default=None)
|
|
2396
2403
|
link_preview_options: Optional[LinkPreviewOptions] = Field(default=None)
|
|
@@ -2563,7 +2570,7 @@ class PaidMediaInfo(BaseModel, frozen=True):
|
|
|
2563
2570
|
'''
|
|
2564
2571
|
|
|
2565
2572
|
star_count: int
|
|
2566
|
-
paid_media: List[
|
|
2573
|
+
paid_media: List[PaidMedia]
|
|
2567
2574
|
|
|
2568
2575
|
class Contact(BaseModel, frozen=True):
|
|
2569
2576
|
'''
|
|
@@ -2659,6 +2666,7 @@ class ChecklistTask(BaseModel, frozen=True):
|
|
|
2659
2666
|
text: str
|
|
2660
2667
|
text_entities: Optional[List[MessageEntity]] = Field(default=None)
|
|
2661
2668
|
completed_by_user: Optional[User] = Field(default=None)
|
|
2669
|
+
completed_by_chat: Optional[Chat] = Field(default=None)
|
|
2662
2670
|
completion_date: Optional[int] = Field(default=None)
|
|
2663
2671
|
|
|
2664
2672
|
class Checklist(BaseModel, frozen=True):
|
|
@@ -2803,7 +2811,7 @@ class ChatBackground(BaseModel, frozen=True):
|
|
|
2803
2811
|
Reference: https://core.telegram.org/bots/api#chatbackground
|
|
2804
2812
|
'''
|
|
2805
2813
|
|
|
2806
|
-
type:
|
|
2814
|
+
type: BackgroundType
|
|
2807
2815
|
|
|
2808
2816
|
class ForumTopicCreated(BaseModel, frozen=True):
|
|
2809
2817
|
'''
|
|
@@ -2815,7 +2823,8 @@ class ForumTopicCreated(BaseModel, frozen=True):
|
|
|
2815
2823
|
|
|
2816
2824
|
name: str
|
|
2817
2825
|
icon_color: int
|
|
2818
|
-
icon_custom_emoji_id: Optional[str] = Field(default=None)
|
|
2826
|
+
icon_custom_emoji_id: Optional[str] = Field(default=None)
|
|
2827
|
+
is_name_implicit: Optional[bool] = Field(default=None)
|
|
2819
2828
|
|
|
2820
2829
|
class ForumTopicClosed(BaseModel, frozen=True):
|
|
2821
2830
|
'''
|
|
@@ -3425,7 +3434,7 @@ class CallbackQuery(BaseModel, frozen=True):
|
|
|
3425
3434
|
id: str
|
|
3426
3435
|
from_user: User = Field(alias='from') # FIX `from` is a python reserved keyword
|
|
3427
3436
|
chat_instance: str
|
|
3428
|
-
message: Optional[
|
|
3437
|
+
message: Optional[MaybeInaccessibleMessage] = Field(default=None)
|
|
3429
3438
|
inline_message_id: Optional[str] = Field(default=None)
|
|
3430
3439
|
data: Optional[str] = Field(default=None)
|
|
3431
3440
|
game_short_name: Optional[str] = Field(default=None)
|
|
@@ -3515,8 +3524,8 @@ class ChatMemberUpdated(BaseModel, frozen=True):
|
|
|
3515
3524
|
chat: Chat
|
|
3516
3525
|
from_user: User = Field(alias='from') # FIX `from` is a python reserved keyword
|
|
3517
3526
|
date: int
|
|
3518
|
-
old_chat_member:
|
|
3519
|
-
new_chat_member:
|
|
3527
|
+
old_chat_member: ChatMember
|
|
3528
|
+
new_chat_member: ChatMember
|
|
3520
3529
|
invite_link: Optional[ChatInviteLink] = Field(default=None)
|
|
3521
3530
|
via_join_request: Optional[bool] = Field(default=None)
|
|
3522
3531
|
via_chat_folder_invite_link: Optional[bool] = Field(default=None)
|
|
@@ -3638,6 +3647,19 @@ class BusinessOpeningHours(BaseModel, frozen=True):
|
|
|
3638
3647
|
time_zone_name: str
|
|
3639
3648
|
opening_hours: List[BusinessOpeningHoursInterval]
|
|
3640
3649
|
|
|
3650
|
+
class UserRating(BaseModel, frozen=True):
|
|
3651
|
+
'''
|
|
3652
|
+
This object describes the rating of a user
|
|
3653
|
+
based on their Telegram Star spendings.
|
|
3654
|
+
|
|
3655
|
+
Reference: https://core.telegram.org/bots/api#userrating
|
|
3656
|
+
'''
|
|
3657
|
+
|
|
3658
|
+
level: int
|
|
3659
|
+
rating: int
|
|
3660
|
+
current_level_rating: int
|
|
3661
|
+
next_level_rating: Optional[int] = Field(default=None)
|
|
3662
|
+
|
|
3641
3663
|
class StoryAreaPosition(BaseModel, frozen=True):
|
|
3642
3664
|
'''
|
|
3643
3665
|
Describes the position of a clickable area within
|
|
@@ -3673,7 +3695,7 @@ class StoryArea(BaseModel, frozen=True):
|
|
|
3673
3695
|
'''
|
|
3674
3696
|
|
|
3675
3697
|
position: StoryAreaPosition
|
|
3676
|
-
type:
|
|
3698
|
+
type: StoryAreaType
|
|
3677
3699
|
|
|
3678
3700
|
class ChatLocation(BaseModel, frozen=True):
|
|
3679
3701
|
'''
|
|
@@ -3694,7 +3716,7 @@ class ReactionCount(BaseModel, frozen=True):
|
|
|
3694
3716
|
Reference: https://core.telegram.org/bots/api#reactioncount
|
|
3695
3717
|
'''
|
|
3696
3718
|
|
|
3697
|
-
type:
|
|
3719
|
+
type: ReactionType
|
|
3698
3720
|
total_count: int
|
|
3699
3721
|
|
|
3700
3722
|
class MessageReactionUpdated(BaseModel, frozen=True):
|
|
@@ -3708,8 +3730,8 @@ class MessageReactionUpdated(BaseModel, frozen=True):
|
|
|
3708
3730
|
chat: Chat
|
|
3709
3731
|
message_id: int
|
|
3710
3732
|
date: int
|
|
3711
|
-
old_reaction: List[
|
|
3712
|
-
new_reaction: List[
|
|
3733
|
+
old_reaction: List[ReactionType]
|
|
3734
|
+
new_reaction: List[ReactionType]
|
|
3713
3735
|
user: Optional[User] = Field(default=None)
|
|
3714
3736
|
actor_chat: Optional[Chat] = Field(default=None)
|
|
3715
3737
|
|
|
@@ -3736,7 +3758,19 @@ class ForumTopic(BaseModel, frozen=True):
|
|
|
3736
3758
|
message_thread_id: int
|
|
3737
3759
|
name: str
|
|
3738
3760
|
icon_color: int
|
|
3739
|
-
icon_custom_emoji_id: Optional[str] = Field(default=None)
|
|
3761
|
+
icon_custom_emoji_id: Optional[str] = Field(default=None)
|
|
3762
|
+
is_name_implicit: Optional[bool] = Field(default=None)
|
|
3763
|
+
|
|
3764
|
+
class GiftBackground(BaseModel, frozen=True):
|
|
3765
|
+
'''
|
|
3766
|
+
This object describes the background of a gift.
|
|
3767
|
+
|
|
3768
|
+
Reference: https://core.telegram.org/bots/api#giftbackground
|
|
3769
|
+
'''
|
|
3770
|
+
|
|
3771
|
+
center_color: int
|
|
3772
|
+
edge_color: int
|
|
3773
|
+
text_color: int
|
|
3740
3774
|
|
|
3741
3775
|
class Gift(BaseModel, frozen=True):
|
|
3742
3776
|
'''
|
|
@@ -3750,8 +3784,14 @@ class Gift(BaseModel, frozen=True):
|
|
|
3750
3784
|
sticker: Sticker
|
|
3751
3785
|
star_count: int
|
|
3752
3786
|
upgrade_star_count: Optional[int] = Field(default=None)
|
|
3787
|
+
is_premium: Optional[bool] = Field(default=None)
|
|
3788
|
+
has_colors: Optional[bool] = Field(default=None)
|
|
3753
3789
|
total_count: Optional[int] = Field(default=None)
|
|
3754
3790
|
remaining_count: Optional[int] = Field(default=None)
|
|
3791
|
+
personal_total_count: Optional[int] = Field(default=None)
|
|
3792
|
+
personal_remaining_count: Optional[int] = Field(default=None)
|
|
3793
|
+
background: Optional[GiftBackground] = Field(default=None)
|
|
3794
|
+
unique_gift_variant_count: Optional[int] = Field(default=None)
|
|
3755
3795
|
publisher_chat: Optional[Chat] = Field(default=None)
|
|
3756
3796
|
|
|
3757
3797
|
class Gifts(BaseModel, frozen=True):
|
|
@@ -3812,6 +3852,22 @@ class UniqueGiftBackdrop(BaseModel, frozen=True):
|
|
|
3812
3852
|
colors: UniqueGiftBackdropColors
|
|
3813
3853
|
rarity_per_mille: int
|
|
3814
3854
|
|
|
3855
|
+
class UniqueGiftColors(BaseModel, frozen=True):
|
|
3856
|
+
'''
|
|
3857
|
+
This object contains information about the color scheme
|
|
3858
|
+
for a user's name, message replies and link
|
|
3859
|
+
previews based on a unique gift.
|
|
3860
|
+
|
|
3861
|
+
Reference: https://core.telegram.org/bots/api#uniquegiftcolors
|
|
3862
|
+
'''
|
|
3863
|
+
|
|
3864
|
+
model_custom_emoji_id: str
|
|
3865
|
+
symbol_custom_emoji_id: str
|
|
3866
|
+
light_theme_main_color: int
|
|
3867
|
+
light_theme_other_colors: List[int]
|
|
3868
|
+
dark_theme_main_color: int
|
|
3869
|
+
dark_theme_other_colors: List[int]
|
|
3870
|
+
|
|
3815
3871
|
class UniqueGift(BaseModel, frozen=True):
|
|
3816
3872
|
'''
|
|
3817
3873
|
This object describes a unique gift that was
|
|
@@ -3820,12 +3876,16 @@ class UniqueGift(BaseModel, frozen=True):
|
|
|
3820
3876
|
Reference: https://core.telegram.org/bots/api#uniquegift
|
|
3821
3877
|
'''
|
|
3822
3878
|
|
|
3879
|
+
gift_id: str
|
|
3823
3880
|
base_name: str
|
|
3824
3881
|
name: str
|
|
3825
3882
|
number: int
|
|
3826
3883
|
model: UniqueGiftModel
|
|
3827
3884
|
symbol: UniqueGiftSymbol
|
|
3828
3885
|
backdrop: UniqueGiftBackdrop
|
|
3886
|
+
is_premium: Optional[bool] = Field(default=None)
|
|
3887
|
+
is_from_blockchain: Optional[bool] = Field(default=None)
|
|
3888
|
+
colors: Optional[UniqueGiftColors] = Field(default=None)
|
|
3829
3889
|
publisher_chat: Optional[Chat] = Field(default=None)
|
|
3830
3890
|
|
|
3831
3891
|
class GiftInfo(BaseModel, frozen=True):
|
|
@@ -3840,10 +3900,12 @@ class GiftInfo(BaseModel, frozen=True):
|
|
|
3840
3900
|
owned_gift_id: Optional[str] = Field(default=None)
|
|
3841
3901
|
convert_star_count: Optional[int] = Field(default=None)
|
|
3842
3902
|
prepaid_upgrade_star_count: Optional[int] = Field(default=None)
|
|
3903
|
+
is_upgrade_separate: Optional[bool] = Field(default=None)
|
|
3843
3904
|
can_be_upgraded: Optional[bool] = Field(default=None)
|
|
3844
3905
|
text: Optional[str] = Field(default=None)
|
|
3845
3906
|
entities: Optional[List[MessageEntity]] = Field(default=None)
|
|
3846
|
-
is_private: Optional[bool] = Field(default=None)
|
|
3907
|
+
is_private: Optional[bool] = Field(default=None)
|
|
3908
|
+
unique_gift_number: Optional[int] = Field(default=None)
|
|
3847
3909
|
|
|
3848
3910
|
class UniqueGiftInfo(BaseModel, frozen=True):
|
|
3849
3911
|
'''
|
|
@@ -3855,7 +3917,8 @@ class UniqueGiftInfo(BaseModel, frozen=True):
|
|
|
3855
3917
|
|
|
3856
3918
|
gift: UniqueGift
|
|
3857
3919
|
origin: str
|
|
3858
|
-
|
|
3920
|
+
last_resale_currency: Optional[str] = Field(default=None)
|
|
3921
|
+
last_resale_amount: Optional[int] = Field(default=None)
|
|
3859
3922
|
owned_gift_id: Optional[str] = Field(default=None)
|
|
3860
3923
|
transfer_star_count: Optional[int] = Field(default=None)
|
|
3861
3924
|
next_transfer_date: Optional[int] = Field(default=None)
|
|
@@ -3869,7 +3932,7 @@ class OwnedGifts(BaseModel, frozen=True):
|
|
|
3869
3932
|
'''
|
|
3870
3933
|
|
|
3871
3934
|
total_count: int
|
|
3872
|
-
gifts: List[
|
|
3935
|
+
gifts: List[OwnedGift]
|
|
3873
3936
|
next_offset: Optional[str] = Field(default=None)
|
|
3874
3937
|
|
|
3875
3938
|
class AcceptedGiftTypes(BaseModel, frozen=True):
|
|
@@ -3884,7 +3947,8 @@ class AcceptedGiftTypes(BaseModel, frozen=True):
|
|
|
3884
3947
|
unlimited_gifts: bool
|
|
3885
3948
|
limited_gifts: bool
|
|
3886
3949
|
unique_gifts: bool
|
|
3887
|
-
premium_subscription: bool
|
|
3950
|
+
premium_subscription: bool
|
|
3951
|
+
gifts_from_channels: bool
|
|
3888
3952
|
|
|
3889
3953
|
class StarAmount(BaseModel, frozen=True):
|
|
3890
3954
|
'''
|
|
@@ -3943,7 +4007,7 @@ class ChatBoost(BaseModel, frozen=True):
|
|
|
3943
4007
|
boost_id: str
|
|
3944
4008
|
add_date: int
|
|
3945
4009
|
expiration_date: int
|
|
3946
|
-
source:
|
|
4010
|
+
source: ChatBoostSource
|
|
3947
4011
|
|
|
3948
4012
|
class ChatBoostUpdated(BaseModel, frozen=True):
|
|
3949
4013
|
'''
|
|
@@ -3967,7 +4031,7 @@ class ChatBoostRemoved(BaseModel, frozen=True):
|
|
|
3967
4031
|
chat: Chat
|
|
3968
4032
|
boost_id: str
|
|
3969
4033
|
remove_date: int
|
|
3970
|
-
source:
|
|
4034
|
+
source: ChatBoostSource
|
|
3971
4035
|
|
|
3972
4036
|
class UserChatBoosts(BaseModel, frozen=True):
|
|
3973
4037
|
'''
|
|
@@ -4348,8 +4412,8 @@ class StarTransaction(BaseModel, frozen=True):
|
|
|
4348
4412
|
amount: int
|
|
4349
4413
|
date: int
|
|
4350
4414
|
nanostar_amount: Optional[int] = Field(default=None)
|
|
4351
|
-
source: Optional[
|
|
4352
|
-
receiver: Optional[
|
|
4415
|
+
source: Optional[TransactionPartner] = Field(default=None)
|
|
4416
|
+
receiver: Optional[TransactionPartner] = Field(default=None)
|
|
4353
4417
|
|
|
4354
4418
|
class StarTransactions(BaseModel, frozen=True):
|
|
4355
4419
|
'''
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|