botapi-py 1.5.6__tar.gz → 1.5.8__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.5.6 → botapi_py-1.5.8}/PKG-INFO +1 -1
- {botapi_py-1.5.6 → botapi_py-1.5.8}/pyproject.toml +1 -1
- {botapi_py-1.5.6 → botapi_py-1.5.8}/src/botapi/methods.py +153 -54
- {botapi_py-1.5.6 → botapi_py-1.5.8}/src/botapi/types.py +127 -28
- {botapi_py-1.5.6 → botapi_py-1.5.8}/src/botapi/__init__.py +0 -0
- {botapi_py-1.5.6 → botapi_py-1.5.8}/src/botapi/__init__.pyi +0 -0
- {botapi_py-1.5.6 → botapi_py-1.5.8}/src/botapi/bot.py +0 -0
- {botapi_py-1.5.6 → botapi_py-1.5.8}/src/botapi/core.py +0 -0
- {botapi_py-1.5.6 → botapi_py-1.5.8}/src/botapi/dispatchers/__init__.py +0 -0
- {botapi_py-1.5.6 → botapi_py-1.5.8}/src/botapi/dispatchers/__init__.pyi +0 -0
- {botapi_py-1.5.6 → botapi_py-1.5.8}/src/botapi/dispatchers/common.py +0 -0
- {botapi_py-1.5.6 → botapi_py-1.5.8}/src/botapi/dispatchers/get_updates_handler.py +0 -0
- {botapi_py-1.5.6 → botapi_py-1.5.8}/src/botapi/dispatchers/redis_pubsub_handler.py +0 -0
- {botapi_py-1.5.6 → botapi_py-1.5.8}/src/botapi/enums.py +0 -0
- {botapi_py-1.5.6 → botapi_py-1.5.8}/src/botapi/errors.py +0 -0
- {botapi_py-1.5.6 → botapi_py-1.5.8}/src/botapi/internals.py +0 -0
|
@@ -66,6 +66,10 @@ from .types import (
|
|
|
66
66
|
WebAppData,
|
|
67
67
|
ProximityAlertTriggered,
|
|
68
68
|
MessageAutoDeleteTimerChanged,
|
|
69
|
+
ManagedBotCreated,
|
|
70
|
+
ManagedBotUpdated,
|
|
71
|
+
PollOptionAdded,
|
|
72
|
+
PollOptionDeleted,
|
|
69
73
|
ChatBoostAdded,
|
|
70
74
|
BackgroundFill,
|
|
71
75
|
_BackgroundFill,
|
|
@@ -119,6 +123,7 @@ from .types import (
|
|
|
119
123
|
KeyboardButton,
|
|
120
124
|
KeyboardButtonRequestUsers,
|
|
121
125
|
KeyboardButtonRequestChat,
|
|
126
|
+
KeyboardButtonRequestManagedBot,
|
|
122
127
|
KeyboardButtonPollType,
|
|
123
128
|
ReplyKeyboardRemove,
|
|
124
129
|
InlineKeyboardMarkup,
|
|
@@ -225,6 +230,9 @@ from .types import (
|
|
|
225
230
|
BusinessBotRights,
|
|
226
231
|
BusinessConnection,
|
|
227
232
|
BusinessMessagesDeleted,
|
|
233
|
+
SentWebAppMessage,
|
|
234
|
+
PreparedInlineMessage,
|
|
235
|
+
PreparedKeyboardButton,
|
|
228
236
|
ResponseParameters,
|
|
229
237
|
InputMedia,
|
|
230
238
|
_InputMedia,
|
|
@@ -288,8 +296,6 @@ from .types import (
|
|
|
288
296
|
InputContactMessageContent,
|
|
289
297
|
InputInvoiceMessageContent,
|
|
290
298
|
ChosenInlineResult,
|
|
291
|
-
SentWebAppMessage,
|
|
292
|
-
PreparedInlineMessage,
|
|
293
299
|
LabeledPrice,
|
|
294
300
|
Invoice,
|
|
295
301
|
ShippingAddress,
|
|
@@ -1325,13 +1331,20 @@ class Methods(core.BaseBot):
|
|
|
1325
1331
|
is_anonymous: Optional[bool] = None,
|
|
1326
1332
|
type: Optional[str] = None,
|
|
1327
1333
|
allows_multiple_answers: Optional[bool] = None,
|
|
1328
|
-
|
|
1334
|
+
allows_revoting: Optional[bool] = None,
|
|
1335
|
+
shuffle_options: Optional[bool] = None,
|
|
1336
|
+
allow_adding_options: Optional[bool] = None,
|
|
1337
|
+
hide_results_until_closes: Optional[bool] = None,
|
|
1338
|
+
correct_option_ids: Optional[List[int]] = None,
|
|
1329
1339
|
explanation: Optional[str] = None,
|
|
1330
1340
|
explanation_parse_mode: Optional[str] = None,
|
|
1331
1341
|
explanation_entities: Optional[List[MessageEntity]] = None,
|
|
1332
1342
|
open_period: Optional[int] = None,
|
|
1333
1343
|
close_date: Optional[int] = None,
|
|
1334
1344
|
is_closed: Optional[bool] = None,
|
|
1345
|
+
description: Optional[str] = None,
|
|
1346
|
+
description_parse_mode: Optional[str] = None,
|
|
1347
|
+
description_entities: Optional[List[MessageEntity]] = None,
|
|
1335
1348
|
disable_notification: Optional[bool] = None,
|
|
1336
1349
|
protect_content: Optional[bool] = None,
|
|
1337
1350
|
allow_paid_broadcast: Optional[bool] = None,
|
|
@@ -1357,13 +1370,20 @@ class Methods(core.BaseBot):
|
|
|
1357
1370
|
'is_anonymous': is_anonymous,
|
|
1358
1371
|
'type': type,
|
|
1359
1372
|
'allows_multiple_answers': allows_multiple_answers,
|
|
1360
|
-
'
|
|
1373
|
+
'allows_revoting': allows_revoting,
|
|
1374
|
+
'shuffle_options': shuffle_options,
|
|
1375
|
+
'allow_adding_options': allow_adding_options,
|
|
1376
|
+
'hide_results_until_closes': hide_results_until_closes,
|
|
1377
|
+
'correct_option_ids': correct_option_ids,
|
|
1361
1378
|
'explanation': explanation,
|
|
1362
1379
|
'explanation_parse_mode': explanation_parse_mode,
|
|
1363
1380
|
'explanation_entities': explanation_entities,
|
|
1364
1381
|
'open_period': open_period,
|
|
1365
1382
|
'close_date': close_date,
|
|
1366
1383
|
'is_closed': is_closed,
|
|
1384
|
+
'description': description,
|
|
1385
|
+
'description_parse_mode': description_parse_mode,
|
|
1386
|
+
'description_entities': description_entities,
|
|
1367
1387
|
'disable_notification': disable_notification,
|
|
1368
1388
|
'protect_content': protect_content,
|
|
1369
1389
|
'allow_paid_broadcast': allow_paid_broadcast,
|
|
@@ -1455,8 +1475,7 @@ class Methods(core.BaseBot):
|
|
|
1455
1475
|
'''
|
|
1456
1476
|
Use this method to stream a partial message
|
|
1457
1477
|
to a user while the message is being
|
|
1458
|
-
generated
|
|
1459
|
-
mode enabled. Returns True on success.
|
|
1478
|
+
generated. Returns True on success.
|
|
1460
1479
|
|
|
1461
1480
|
Reference: https://core.telegram.org/bots/api#sendmessagedraft
|
|
1462
1481
|
'''
|
|
@@ -1720,6 +1739,7 @@ class Methods(core.BaseBot):
|
|
|
1720
1739
|
can_pin_messages: Optional[bool] = None,
|
|
1721
1740
|
can_manage_topics: Optional[bool] = None,
|
|
1722
1741
|
can_manage_direct_messages: Optional[bool] = None,
|
|
1742
|
+
can_manage_tags: Optional[bool] = None,
|
|
1723
1743
|
) -> bool:
|
|
1724
1744
|
'''
|
|
1725
1745
|
Use this method to promote or demote a
|
|
@@ -1752,6 +1772,7 @@ class Methods(core.BaseBot):
|
|
|
1752
1772
|
'can_pin_messages': can_pin_messages,
|
|
1753
1773
|
'can_manage_topics': can_manage_topics,
|
|
1754
1774
|
'can_manage_direct_messages': can_manage_direct_messages,
|
|
1775
|
+
'can_manage_tags': can_manage_tags,
|
|
1755
1776
|
})
|
|
1756
1777
|
return BoolAdapter.validate_python(response)
|
|
1757
1778
|
|
|
@@ -1776,6 +1797,30 @@ class Methods(core.BaseBot):
|
|
|
1776
1797
|
})
|
|
1777
1798
|
return BoolAdapter.validate_python(response)
|
|
1778
1799
|
|
|
1800
|
+
async def set_chat_member_tag(
|
|
1801
|
+
self,
|
|
1802
|
+
chat_id: Union[int, str],
|
|
1803
|
+
user_id: int,
|
|
1804
|
+
tag: Optional[str] = None,
|
|
1805
|
+
) -> bool:
|
|
1806
|
+
'''
|
|
1807
|
+
Use this method to set a tag for
|
|
1808
|
+
a regular member in a group or a
|
|
1809
|
+
supergroup. The bot must be an administrator in
|
|
1810
|
+
the chat for this to work and must
|
|
1811
|
+
have the can_manage_tags administrator right. Returns True on
|
|
1812
|
+
success.
|
|
1813
|
+
|
|
1814
|
+
Reference: https://core.telegram.org/bots/api#setchatmembertag
|
|
1815
|
+
'''
|
|
1816
|
+
|
|
1817
|
+
response = await self._send_request('setChatMemberTag', {
|
|
1818
|
+
'chat_id': chat_id,
|
|
1819
|
+
'user_id': user_id,
|
|
1820
|
+
'tag': tag,
|
|
1821
|
+
})
|
|
1822
|
+
return BoolAdapter.validate_python(response)
|
|
1823
|
+
|
|
1779
1824
|
async def ban_chat_sender_chat(
|
|
1780
1825
|
self,
|
|
1781
1826
|
chat_id: Union[int, str],
|
|
@@ -2671,6 +2716,41 @@ class Methods(core.BaseBot):
|
|
|
2671
2716
|
})
|
|
2672
2717
|
return BusinessConnection.model_validate(response)
|
|
2673
2718
|
|
|
2719
|
+
async def get_managed_bot_token(
|
|
2720
|
+
self,
|
|
2721
|
+
user_id: int,
|
|
2722
|
+
) -> str:
|
|
2723
|
+
'''
|
|
2724
|
+
Use this method to get the token of
|
|
2725
|
+
a managed bot. Returns the token as String
|
|
2726
|
+
on success.
|
|
2727
|
+
|
|
2728
|
+
Reference: https://core.telegram.org/bots/api#getmanagedbottoken
|
|
2729
|
+
'''
|
|
2730
|
+
|
|
2731
|
+
response = await self._send_request('getManagedBotToken', {
|
|
2732
|
+
'user_id': user_id,
|
|
2733
|
+
})
|
|
2734
|
+
return StrAdapter.validate_python(response)
|
|
2735
|
+
|
|
2736
|
+
async def replace_managed_bot_token(
|
|
2737
|
+
self,
|
|
2738
|
+
user_id: int,
|
|
2739
|
+
) -> str:
|
|
2740
|
+
'''
|
|
2741
|
+
Use this method to revoke the current token
|
|
2742
|
+
of a managed bot and generate a new
|
|
2743
|
+
one. Returns the new token as String on
|
|
2744
|
+
success.
|
|
2745
|
+
|
|
2746
|
+
Reference: https://core.telegram.org/bots/api#replacemanagedbottoken
|
|
2747
|
+
'''
|
|
2748
|
+
|
|
2749
|
+
response = await self._send_request('replaceManagedBotToken', {
|
|
2750
|
+
'user_id': user_id,
|
|
2751
|
+
})
|
|
2752
|
+
return StrAdapter.validate_python(response)
|
|
2753
|
+
|
|
2674
2754
|
async def set_my_commands(
|
|
2675
2755
|
self,
|
|
2676
2756
|
commands: List[BotCommand],
|
|
@@ -3575,6 +3655,73 @@ class Methods(core.BaseBot):
|
|
|
3575
3655
|
})
|
|
3576
3656
|
return BoolAdapter.validate_python(response)
|
|
3577
3657
|
|
|
3658
|
+
async def answer_web_app_query(
|
|
3659
|
+
self,
|
|
3660
|
+
web_app_query_id: str,
|
|
3661
|
+
result: _InlineQueryResult,
|
|
3662
|
+
) -> SentWebAppMessage:
|
|
3663
|
+
'''
|
|
3664
|
+
Use this method to set the result of
|
|
3665
|
+
an interaction with a Web App and send
|
|
3666
|
+
a corresponding message on behalf of the user
|
|
3667
|
+
to the chat from which the query originated.
|
|
3668
|
+
On success, a SentWebAppMessage object is returned.
|
|
3669
|
+
|
|
3670
|
+
Reference: https://core.telegram.org/bots/api#answerwebappquery
|
|
3671
|
+
'''
|
|
3672
|
+
|
|
3673
|
+
response = await self._send_request('answerWebAppQuery', {
|
|
3674
|
+
'web_app_query_id': web_app_query_id,
|
|
3675
|
+
'result': result,
|
|
3676
|
+
})
|
|
3677
|
+
return SentWebAppMessage.model_validate(response)
|
|
3678
|
+
|
|
3679
|
+
async def save_prepared_inline_message(
|
|
3680
|
+
self,
|
|
3681
|
+
user_id: int,
|
|
3682
|
+
result: _InlineQueryResult,
|
|
3683
|
+
allow_user_chats: Optional[bool] = None,
|
|
3684
|
+
allow_bot_chats: Optional[bool] = None,
|
|
3685
|
+
allow_group_chats: Optional[bool] = None,
|
|
3686
|
+
allow_channel_chats: Optional[bool] = None,
|
|
3687
|
+
) -> PreparedInlineMessage:
|
|
3688
|
+
'''
|
|
3689
|
+
Stores a message that can be sent by
|
|
3690
|
+
a user of a Mini App. Returns a
|
|
3691
|
+
PreparedInlineMessage object.
|
|
3692
|
+
|
|
3693
|
+
Reference: https://core.telegram.org/bots/api#savepreparedinlinemessage
|
|
3694
|
+
'''
|
|
3695
|
+
|
|
3696
|
+
response = await self._send_request('savePreparedInlineMessage', {
|
|
3697
|
+
'user_id': user_id,
|
|
3698
|
+
'result': result,
|
|
3699
|
+
'allow_user_chats': allow_user_chats,
|
|
3700
|
+
'allow_bot_chats': allow_bot_chats,
|
|
3701
|
+
'allow_group_chats': allow_group_chats,
|
|
3702
|
+
'allow_channel_chats': allow_channel_chats,
|
|
3703
|
+
})
|
|
3704
|
+
return PreparedInlineMessage.model_validate(response)
|
|
3705
|
+
|
|
3706
|
+
async def save_prepared_keyboard_button(
|
|
3707
|
+
self,
|
|
3708
|
+
user_id: int,
|
|
3709
|
+
button: KeyboardButton,
|
|
3710
|
+
) -> PreparedKeyboardButton:
|
|
3711
|
+
'''
|
|
3712
|
+
Stores a keyboard button that can be used
|
|
3713
|
+
by a user within a Mini App. Returns
|
|
3714
|
+
a PreparedKeyboardButton object.
|
|
3715
|
+
|
|
3716
|
+
Reference: https://core.telegram.org/bots/api#savepreparedkeyboardbutton
|
|
3717
|
+
'''
|
|
3718
|
+
|
|
3719
|
+
response = await self._send_request('savePreparedKeyboardButton', {
|
|
3720
|
+
'user_id': user_id,
|
|
3721
|
+
'button': button,
|
|
3722
|
+
})
|
|
3723
|
+
return PreparedKeyboardButton.model_validate(response)
|
|
3724
|
+
|
|
3578
3725
|
async def edit_message_text(
|
|
3579
3726
|
self,
|
|
3580
3727
|
text: str,
|
|
@@ -4327,54 +4474,6 @@ class Methods(core.BaseBot):
|
|
|
4327
4474
|
})
|
|
4328
4475
|
return BoolAdapter.validate_python(response)
|
|
4329
4476
|
|
|
4330
|
-
async def answer_web_app_query(
|
|
4331
|
-
self,
|
|
4332
|
-
web_app_query_id: str,
|
|
4333
|
-
result: _InlineQueryResult,
|
|
4334
|
-
) -> SentWebAppMessage:
|
|
4335
|
-
'''
|
|
4336
|
-
Use this method to set the result of
|
|
4337
|
-
an interaction with a Web App and send
|
|
4338
|
-
a corresponding message on behalf of the user
|
|
4339
|
-
to the chat from which the query originated.
|
|
4340
|
-
On success, a SentWebAppMessage object is returned.
|
|
4341
|
-
|
|
4342
|
-
Reference: https://core.telegram.org/bots/api#answerwebappquery
|
|
4343
|
-
'''
|
|
4344
|
-
|
|
4345
|
-
response = await self._send_request('answerWebAppQuery', {
|
|
4346
|
-
'web_app_query_id': web_app_query_id,
|
|
4347
|
-
'result': result,
|
|
4348
|
-
})
|
|
4349
|
-
return SentWebAppMessage.model_validate(response)
|
|
4350
|
-
|
|
4351
|
-
async def save_prepared_inline_message(
|
|
4352
|
-
self,
|
|
4353
|
-
user_id: int,
|
|
4354
|
-
result: _InlineQueryResult,
|
|
4355
|
-
allow_user_chats: Optional[bool] = None,
|
|
4356
|
-
allow_bot_chats: Optional[bool] = None,
|
|
4357
|
-
allow_group_chats: Optional[bool] = None,
|
|
4358
|
-
allow_channel_chats: Optional[bool] = None,
|
|
4359
|
-
) -> PreparedInlineMessage:
|
|
4360
|
-
'''
|
|
4361
|
-
Stores a message that can be sent by
|
|
4362
|
-
a user of a Mini App. Returns a
|
|
4363
|
-
PreparedInlineMessage object.
|
|
4364
|
-
|
|
4365
|
-
Reference: https://core.telegram.org/bots/api#savepreparedinlinemessage
|
|
4366
|
-
'''
|
|
4367
|
-
|
|
4368
|
-
response = await self._send_request('savePreparedInlineMessage', {
|
|
4369
|
-
'user_id': user_id,
|
|
4370
|
-
'result': result,
|
|
4371
|
-
'allow_user_chats': allow_user_chats,
|
|
4372
|
-
'allow_bot_chats': allow_bot_chats,
|
|
4373
|
-
'allow_group_chats': allow_group_chats,
|
|
4374
|
-
'allow_channel_chats': allow_channel_chats,
|
|
4375
|
-
})
|
|
4376
|
-
return PreparedInlineMessage.model_validate(response)
|
|
4377
|
-
|
|
4378
4477
|
async def send_invoice(
|
|
4379
4478
|
self,
|
|
4380
4479
|
chat_id: Union[int, str],
|
|
@@ -36,6 +36,7 @@ class Message(MaybeInaccessibleMessage):
|
|
|
36
36
|
sender_chat: Optional[Chat] = Field(default=None)
|
|
37
37
|
sender_boost_count: Optional[int] = Field(default=None)
|
|
38
38
|
sender_business_bot: Optional[User] = Field(default=None)
|
|
39
|
+
sender_tag: Optional[str] = Field(default=None)
|
|
39
40
|
business_connection_id: Optional[str] = Field(default=None)
|
|
40
41
|
forward_origin: Optional[_MessageOrigin] = Field(default=None)
|
|
41
42
|
is_topic_message: Optional[bool] = Field(default=None)
|
|
@@ -45,6 +46,7 @@ class Message(MaybeInaccessibleMessage):
|
|
|
45
46
|
quote: Optional[TextQuote] = Field(default=None)
|
|
46
47
|
reply_to_story: Optional[Story] = Field(default=None)
|
|
47
48
|
reply_to_checklist_task_id: Optional[int] = Field(default=None)
|
|
49
|
+
reply_to_poll_option_id: Optional[str] = Field(default=None)
|
|
48
50
|
via_bot: Optional[User] = Field(default=None)
|
|
49
51
|
edit_date: Optional[int] = Field(default=None)
|
|
50
52
|
has_protected_content: Optional[bool] = Field(default=None)
|
|
@@ -120,7 +122,10 @@ class Message(MaybeInaccessibleMessage):
|
|
|
120
122
|
giveaway: Optional[Giveaway] = Field(default=None)
|
|
121
123
|
giveaway_winners: Optional[GiveawayWinners] = Field(default=None)
|
|
122
124
|
giveaway_completed: Optional[GiveawayCompleted] = Field(default=None)
|
|
125
|
+
managed_bot_created: Optional[ManagedBotCreated] = Field(default=None)
|
|
123
126
|
paid_message_price_changed: Optional[PaidMessagePriceChanged] = Field(default=None)
|
|
127
|
+
poll_option_added: Optional[PollOptionAdded] = Field(default=None)
|
|
128
|
+
poll_option_deleted: Optional[PollOptionDeleted] = Field(default=None)
|
|
124
129
|
suggested_post_approved: Optional[SuggestedPostApproved] = Field(default=None)
|
|
125
130
|
suggested_post_approval_failed: Optional[SuggestedPostApprovalFailed] = Field(default=None)
|
|
126
131
|
suggested_post_declined: Optional[SuggestedPostDeclined] = Field(default=None)
|
|
@@ -769,6 +774,7 @@ class ChatMemberAdministrator(ChatMember):
|
|
|
769
774
|
can_pin_messages: Optional[bool] = Field(default=None)
|
|
770
775
|
can_manage_topics: Optional[bool] = Field(default=None)
|
|
771
776
|
can_manage_direct_messages: Optional[bool] = Field(default=None)
|
|
777
|
+
can_manage_tags: Optional[bool] = Field(default=None)
|
|
772
778
|
custom_title: Optional[str] = Field(default=None)
|
|
773
779
|
|
|
774
780
|
class ChatMemberMember(ChatMember):
|
|
@@ -781,6 +787,7 @@ class ChatMemberMember(ChatMember):
|
|
|
781
787
|
|
|
782
788
|
status: Literal['member'] = 'member' # pyright: ignore[reportIncompatibleVariableOverride]
|
|
783
789
|
user: User
|
|
790
|
+
tag: Optional[str] = Field(default=None)
|
|
784
791
|
until_date: Optional[int] = Field(default=None)
|
|
785
792
|
|
|
786
793
|
class ChatMemberRestricted(ChatMember):
|
|
@@ -804,11 +811,13 @@ class ChatMemberRestricted(ChatMember):
|
|
|
804
811
|
can_send_polls: bool
|
|
805
812
|
can_send_other_messages: bool
|
|
806
813
|
can_add_web_page_previews: bool
|
|
814
|
+
can_edit_tag: bool
|
|
807
815
|
can_change_info: bool
|
|
808
816
|
can_invite_users: bool
|
|
809
817
|
can_pin_messages: bool
|
|
810
818
|
can_manage_topics: bool
|
|
811
|
-
until_date: int
|
|
819
|
+
until_date: int
|
|
820
|
+
tag: Optional[str] = Field(default=None)
|
|
812
821
|
|
|
813
822
|
class ChatMemberLeft(ChatMember):
|
|
814
823
|
'''
|
|
@@ -2323,6 +2332,7 @@ class Update(BaseModel):
|
|
|
2323
2332
|
chat_join_request: Optional[ChatJoinRequest] = Field(default=None)
|
|
2324
2333
|
chat_boost: Optional[ChatBoostUpdated] = Field(default=None)
|
|
2325
2334
|
removed_chat_boost: Optional[ChatBoostRemoved] = Field(default=None)
|
|
2335
|
+
managed_bot: Optional[ManagedBotUpdated] = Field(default=None)
|
|
2326
2336
|
|
|
2327
2337
|
@staticmethod
|
|
2328
2338
|
def from_dict(
|
|
@@ -2372,7 +2382,8 @@ class User(BaseModel):
|
|
|
2372
2382
|
can_connect_to_business: Optional[bool] = Field(default=None)
|
|
2373
2383
|
has_main_web_app: Optional[bool] = Field(default=None)
|
|
2374
2384
|
has_topics_enabled: Optional[bool] = Field(default=None)
|
|
2375
|
-
allows_users_to_create_topics: Optional[bool] = Field(default=None)
|
|
2385
|
+
allows_users_to_create_topics: Optional[bool] = Field(default=None)
|
|
2386
|
+
can_manage_bots: Optional[bool] = Field(default=None)
|
|
2376
2387
|
|
|
2377
2388
|
class Chat(BaseModel):
|
|
2378
2389
|
'''
|
|
@@ -2473,6 +2484,8 @@ class MessageEntity(BaseModel):
|
|
|
2473
2484
|
user: Optional[User] = Field(default=None)
|
|
2474
2485
|
language: Optional[str] = Field(default=None)
|
|
2475
2486
|
custom_emoji_id: Optional[str] = Field(default=None)
|
|
2487
|
+
unix_time: Optional[int] = Field(default=None)
|
|
2488
|
+
date_time_format: Optional[str] = Field(default=None)
|
|
2476
2489
|
|
|
2477
2490
|
@staticmethod
|
|
2478
2491
|
def from_dict(
|
|
@@ -2557,7 +2570,8 @@ class ReplyParameters(BaseModel):
|
|
|
2557
2570
|
quote_parse_mode: Optional[str] = Field(default=None)
|
|
2558
2571
|
quote_entities: Optional[List[MessageEntity]] = Field(default=None)
|
|
2559
2572
|
quote_position: Optional[int] = Field(default=None)
|
|
2560
|
-
checklist_task_id: Optional[int] = Field(default=None)
|
|
2573
|
+
checklist_task_id: Optional[int] = Field(default=None)
|
|
2574
|
+
poll_option_id: Optional[str] = Field(default=None)
|
|
2561
2575
|
|
|
2562
2576
|
class PhotoSize(BaseModel):
|
|
2563
2577
|
'''
|
|
@@ -2739,9 +2753,13 @@ class PollOption(BaseModel):
|
|
|
2739
2753
|
Reference: https://core.telegram.org/bots/api#polloption
|
|
2740
2754
|
'''
|
|
2741
2755
|
|
|
2756
|
+
persistent_id: str
|
|
2742
2757
|
text: str
|
|
2743
2758
|
voter_count: int
|
|
2744
|
-
text_entities: Optional[List[MessageEntity]] = Field(default=None)
|
|
2759
|
+
text_entities: Optional[List[MessageEntity]] = Field(default=None)
|
|
2760
|
+
added_by_user: Optional[User] = Field(default=None)
|
|
2761
|
+
added_by_chat: Optional[Chat] = Field(default=None)
|
|
2762
|
+
addition_date: Optional[int] = Field(default=None)
|
|
2745
2763
|
|
|
2746
2764
|
class InputPollOption(BaseModel):
|
|
2747
2765
|
'''
|
|
@@ -2765,6 +2783,7 @@ class PollAnswer(BaseModel):
|
|
|
2765
2783
|
|
|
2766
2784
|
poll_id: str
|
|
2767
2785
|
option_ids: List[int]
|
|
2786
|
+
option_persistent_ids: List[str]
|
|
2768
2787
|
voter_chat: Optional[Chat] = Field(default=None)
|
|
2769
2788
|
user: Optional[User] = Field(default=None)
|
|
2770
2789
|
|
|
@@ -2783,12 +2802,15 @@ class Poll(BaseModel):
|
|
|
2783
2802
|
is_anonymous: bool
|
|
2784
2803
|
type: str
|
|
2785
2804
|
allows_multiple_answers: bool
|
|
2805
|
+
allows_revoting: bool
|
|
2786
2806
|
question_entities: Optional[List[MessageEntity]] = Field(default=None)
|
|
2787
|
-
|
|
2807
|
+
correct_option_ids: Optional[List[int]] = Field(default=None)
|
|
2788
2808
|
explanation: Optional[str] = Field(default=None)
|
|
2789
2809
|
explanation_entities: Optional[List[MessageEntity]] = Field(default=None)
|
|
2790
2810
|
open_period: Optional[int] = Field(default=None)
|
|
2791
|
-
close_date: Optional[int] = Field(default=None)
|
|
2811
|
+
close_date: Optional[int] = Field(default=None)
|
|
2812
|
+
description: Optional[str] = Field(default=None)
|
|
2813
|
+
description_entities: Optional[List[MessageEntity]] = Field(default=None)
|
|
2792
2814
|
|
|
2793
2815
|
class ChecklistTask(BaseModel):
|
|
2794
2816
|
'''
|
|
@@ -2929,6 +2951,55 @@ class MessageAutoDeleteTimerChanged(BaseModel):
|
|
|
2929
2951
|
|
|
2930
2952
|
message_auto_delete_time: int
|
|
2931
2953
|
|
|
2954
|
+
class ManagedBotCreated(BaseModel):
|
|
2955
|
+
'''
|
|
2956
|
+
This object contains information about the bot that
|
|
2957
|
+
was created to be managed by the current
|
|
2958
|
+
bot.
|
|
2959
|
+
|
|
2960
|
+
Reference: https://core.telegram.org/bots/api#managedbotcreated
|
|
2961
|
+
'''
|
|
2962
|
+
|
|
2963
|
+
bot: User
|
|
2964
|
+
|
|
2965
|
+
class ManagedBotUpdated(BaseModel):
|
|
2966
|
+
'''
|
|
2967
|
+
This object contains information about the creation, token
|
|
2968
|
+
update, or owner update of a bot that
|
|
2969
|
+
is managed by the current bot.
|
|
2970
|
+
|
|
2971
|
+
Reference: https://core.telegram.org/bots/api#managedbotupdated
|
|
2972
|
+
'''
|
|
2973
|
+
|
|
2974
|
+
user: User
|
|
2975
|
+
bot: User
|
|
2976
|
+
|
|
2977
|
+
class PollOptionAdded(BaseModel):
|
|
2978
|
+
'''
|
|
2979
|
+
Describes a service message about an option added
|
|
2980
|
+
to a poll.
|
|
2981
|
+
|
|
2982
|
+
Reference: https://core.telegram.org/bots/api#polloptionadded
|
|
2983
|
+
'''
|
|
2984
|
+
|
|
2985
|
+
option_persistent_id: str
|
|
2986
|
+
option_text: str
|
|
2987
|
+
poll_message: Optional[_MaybeInaccessibleMessage] = Field(default=None)
|
|
2988
|
+
option_text_entities: Optional[List[MessageEntity]] = Field(default=None)
|
|
2989
|
+
|
|
2990
|
+
class PollOptionDeleted(BaseModel):
|
|
2991
|
+
'''
|
|
2992
|
+
Describes a service message about an option deleted
|
|
2993
|
+
from a poll.
|
|
2994
|
+
|
|
2995
|
+
Reference: https://core.telegram.org/bots/api#polloptiondeleted
|
|
2996
|
+
'''
|
|
2997
|
+
|
|
2998
|
+
option_persistent_id: str
|
|
2999
|
+
option_text: str
|
|
3000
|
+
poll_message: Optional[_MaybeInaccessibleMessage] = Field(default=None)
|
|
3001
|
+
option_text_entities: Optional[List[MessageEntity]] = Field(default=None)
|
|
3002
|
+
|
|
2932
3003
|
class ChatBoostAdded(BaseModel):
|
|
2933
3004
|
'''
|
|
2934
3005
|
This object represents a service message about a
|
|
@@ -3443,6 +3514,7 @@ class KeyboardButton(BaseModel):
|
|
|
3443
3514
|
style: Optional[str] = Field(default=None)
|
|
3444
3515
|
request_users: Optional[KeyboardButtonRequestUsers] = Field(default=None)
|
|
3445
3516
|
request_chat: Optional[KeyboardButtonRequestChat] = Field(default=None)
|
|
3517
|
+
request_managed_bot: Optional[KeyboardButtonRequestManagedBot] = Field(default=None)
|
|
3446
3518
|
request_contact: Optional[bool] = Field(default=None)
|
|
3447
3519
|
request_location: Optional[bool] = Field(default=None)
|
|
3448
3520
|
request_poll: Optional[KeyboardButtonPollType] = Field(default=None)
|
|
@@ -3490,6 +3562,21 @@ class KeyboardButtonRequestChat(BaseModel):
|
|
|
3490
3562
|
request_username: Optional[bool] = Field(default=None)
|
|
3491
3563
|
request_photo: Optional[bool] = Field(default=None)
|
|
3492
3564
|
|
|
3565
|
+
class KeyboardButtonRequestManagedBot(BaseModel):
|
|
3566
|
+
'''
|
|
3567
|
+
This object defines the parameters for the creation
|
|
3568
|
+
of a managed bot. Information about the created
|
|
3569
|
+
bot will be shared with the bot using
|
|
3570
|
+
the update managed_bot and a Message with the
|
|
3571
|
+
field managed_bot_created.
|
|
3572
|
+
|
|
3573
|
+
Reference: https://core.telegram.org/bots/api#keyboardbuttonrequestmanagedbot
|
|
3574
|
+
'''
|
|
3575
|
+
|
|
3576
|
+
request_id: int
|
|
3577
|
+
suggested_name: Optional[str] = Field(default=None)
|
|
3578
|
+
suggested_username: Optional[str] = Field(default=None)
|
|
3579
|
+
|
|
3493
3580
|
class KeyboardButtonPollType(BaseModel):
|
|
3494
3581
|
'''
|
|
3495
3582
|
This object represents type of a poll, which
|
|
@@ -3706,7 +3793,8 @@ class ChatAdministratorRights(BaseModel):
|
|
|
3706
3793
|
can_edit_messages: Optional[bool] = Field(default=None)
|
|
3707
3794
|
can_pin_messages: Optional[bool] = Field(default=None)
|
|
3708
3795
|
can_manage_topics: Optional[bool] = Field(default=None)
|
|
3709
|
-
can_manage_direct_messages: Optional[bool] = Field(default=None)
|
|
3796
|
+
can_manage_direct_messages: Optional[bool] = Field(default=None)
|
|
3797
|
+
can_manage_tags: Optional[bool] = Field(default=None)
|
|
3710
3798
|
|
|
3711
3799
|
class ChatMemberUpdated(BaseModel):
|
|
3712
3800
|
'''
|
|
@@ -3782,6 +3870,7 @@ class ChatPermissions(BaseModel):
|
|
|
3782
3870
|
can_send_polls: Optional[bool] = Field(default=None)
|
|
3783
3871
|
can_send_other_messages: Optional[bool] = Field(default=None)
|
|
3784
3872
|
can_add_web_page_previews: Optional[bool] = Field(default=None)
|
|
3873
|
+
can_edit_tag: Optional[bool] = Field(default=None)
|
|
3785
3874
|
can_change_info: Optional[bool] = Field(default=None)
|
|
3786
3875
|
can_invite_users: Optional[bool] = Field(default=None)
|
|
3787
3876
|
can_pin_messages: Optional[bool] = Field(default=None)
|
|
@@ -4309,6 +4398,37 @@ class BusinessMessagesDeleted(BaseModel):
|
|
|
4309
4398
|
chat: Chat
|
|
4310
4399
|
message_ids: List[int]
|
|
4311
4400
|
|
|
4401
|
+
class SentWebAppMessage(BaseModel):
|
|
4402
|
+
'''
|
|
4403
|
+
Describes an inline message sent by a Web
|
|
4404
|
+
App on behalf of a user.
|
|
4405
|
+
|
|
4406
|
+
Reference: https://core.telegram.org/bots/api#sentwebappmessage
|
|
4407
|
+
'''
|
|
4408
|
+
|
|
4409
|
+
inline_message_id: Optional[str] = Field(default=None)
|
|
4410
|
+
|
|
4411
|
+
class PreparedInlineMessage(BaseModel):
|
|
4412
|
+
'''
|
|
4413
|
+
Describes an inline message to be sent by
|
|
4414
|
+
a user of a Mini App.
|
|
4415
|
+
|
|
4416
|
+
Reference: https://core.telegram.org/bots/api#preparedinlinemessage
|
|
4417
|
+
'''
|
|
4418
|
+
|
|
4419
|
+
id: str
|
|
4420
|
+
expiration_date: int
|
|
4421
|
+
|
|
4422
|
+
class PreparedKeyboardButton(BaseModel):
|
|
4423
|
+
'''
|
|
4424
|
+
Describes a keyboard button to be used by
|
|
4425
|
+
a user of a Mini App.
|
|
4426
|
+
|
|
4427
|
+
Reference: https://core.telegram.org/bots/api#preparedkeyboardbutton
|
|
4428
|
+
'''
|
|
4429
|
+
|
|
4430
|
+
id: str
|
|
4431
|
+
|
|
4312
4432
|
class ResponseParameters(BaseModel):
|
|
4313
4433
|
'''
|
|
4314
4434
|
Describes why a request was unsuccessful.
|
|
@@ -4464,27 +4584,6 @@ class ChosenInlineResult(BaseModel):
|
|
|
4464
4584
|
location: Optional[Location] = Field(default=None)
|
|
4465
4585
|
inline_message_id: Optional[str] = Field(default=None)
|
|
4466
4586
|
|
|
4467
|
-
class SentWebAppMessage(BaseModel):
|
|
4468
|
-
'''
|
|
4469
|
-
Describes an inline message sent by a Web
|
|
4470
|
-
App on behalf of a user.
|
|
4471
|
-
|
|
4472
|
-
Reference: https://core.telegram.org/bots/api#sentwebappmessage
|
|
4473
|
-
'''
|
|
4474
|
-
|
|
4475
|
-
inline_message_id: Optional[str] = Field(default=None)
|
|
4476
|
-
|
|
4477
|
-
class PreparedInlineMessage(BaseModel):
|
|
4478
|
-
'''
|
|
4479
|
-
Describes an inline message to be sent by
|
|
4480
|
-
a user of a Mini App.
|
|
4481
|
-
|
|
4482
|
-
Reference: https://core.telegram.org/bots/api#preparedinlinemessage
|
|
4483
|
-
'''
|
|
4484
|
-
|
|
4485
|
-
id: str
|
|
4486
|
-
expiration_date: int
|
|
4487
|
-
|
|
4488
4587
|
class LabeledPrice(BaseModel):
|
|
4489
4588
|
'''
|
|
4490
4589
|
This object represents a portion of the price
|
|
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
|
|
File without changes
|