Pytdbot 0.9.9__tar.gz → 0.9.10.dev0__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.
- {pytdbot-0.9.9 → pytdbot-0.9.10.dev0}/LICENSE +1 -1
- {pytdbot-0.9.9 → pytdbot-0.9.10.dev0}/PKG-INFO +2 -2
- {pytdbot-0.9.9 → pytdbot-0.9.10.dev0}/Pytdbot.egg-info/PKG-INFO +2 -2
- {pytdbot-0.9.9 → pytdbot-0.9.10.dev0}/README.md +1 -1
- {pytdbot-0.9.9 → pytdbot-0.9.10.dev0}/pytdbot/__init__.py +2 -2
- {pytdbot-0.9.9 → pytdbot-0.9.10.dev0}/pytdbot/client.py +16 -2
- {pytdbot-0.9.9 → pytdbot-0.9.10.dev0}/pytdbot/handlers/td_updates.py +59 -0
- {pytdbot-0.9.9 → pytdbot-0.9.10.dev0}/pytdbot/methods/td_functions.py +312 -11
- {pytdbot-0.9.9 → pytdbot-0.9.10.dev0}/pytdbot/types/__init__.py +41 -1
- {pytdbot-0.9.9 → pytdbot-0.9.10.dev0}/pytdbot/types/bound_methods/message.py +30 -0
- {pytdbot-0.9.9 → pytdbot-0.9.10.dev0}/pytdbot/types/td_types.py +1223 -125
- {pytdbot-0.9.9 → pytdbot-0.9.10.dev0}/MANIFEST.in +0 -0
- {pytdbot-0.9.9 → pytdbot-0.9.10.dev0}/Pytdbot.egg-info/SOURCES.txt +0 -0
- {pytdbot-0.9.9 → pytdbot-0.9.10.dev0}/Pytdbot.egg-info/dependency_links.txt +0 -0
- {pytdbot-0.9.9 → pytdbot-0.9.10.dev0}/Pytdbot.egg-info/requires.txt +0 -0
- {pytdbot-0.9.9 → pytdbot-0.9.10.dev0}/Pytdbot.egg-info/top_level.txt +0 -0
- {pytdbot-0.9.9 → pytdbot-0.9.10.dev0}/pytdbot/client_manager.py +0 -0
- {pytdbot-0.9.9 → pytdbot-0.9.10.dev0}/pytdbot/exception/__init__.py +0 -0
- {pytdbot-0.9.9 → pytdbot-0.9.10.dev0}/pytdbot/filters.py +0 -0
- {pytdbot-0.9.9 → pytdbot-0.9.10.dev0}/pytdbot/handlers/__init__.py +0 -0
- {pytdbot-0.9.9 → pytdbot-0.9.10.dev0}/pytdbot/handlers/decorators.py +0 -0
- {pytdbot-0.9.9 → pytdbot-0.9.10.dev0}/pytdbot/handlers/handler.py +0 -0
- {pytdbot-0.9.9 → pytdbot-0.9.10.dev0}/pytdbot/methods/__init__.py +0 -0
- {pytdbot-0.9.9 → pytdbot-0.9.10.dev0}/pytdbot/methods/methods.py +0 -0
- {pytdbot-0.9.9 → pytdbot-0.9.10.dev0}/pytdbot/tdjson/__init__.py +0 -0
- {pytdbot-0.9.9 → pytdbot-0.9.10.dev0}/pytdbot/tdjson/tdjson.py +0 -0
- {pytdbot-0.9.9 → pytdbot-0.9.10.dev0}/pytdbot/types/bound_methods/__init__.py +0 -0
- {pytdbot-0.9.9 → pytdbot-0.9.10.dev0}/pytdbot/types/bound_methods/callback_query.py +0 -0
- {pytdbot-0.9.9 → pytdbot-0.9.10.dev0}/pytdbot/types/bound_methods/chatActions.py +0 -0
- {pytdbot-0.9.9 → pytdbot-0.9.10.dev0}/pytdbot/types/bound_methods/file.py +0 -0
- {pytdbot-0.9.9 → pytdbot-0.9.10.dev0}/pytdbot/types/bound_methods/sender_id.py +0 -0
- {pytdbot-0.9.9 → pytdbot-0.9.10.dev0}/pytdbot/types/plugins/__init__.py +0 -0
- {pytdbot-0.9.9 → pytdbot-0.9.10.dev0}/pytdbot/types/tdserver/__init__.py +0 -0
- {pytdbot-0.9.9 → pytdbot-0.9.10.dev0}/pytdbot/types/tdserver/schedule.py +0 -0
- {pytdbot-0.9.9 → pytdbot-0.9.10.dev0}/pytdbot/types/tdserver/stats.py +0 -0
- {pytdbot-0.9.9 → pytdbot-0.9.10.dev0}/pytdbot/utils/__init__.py +0 -0
- {pytdbot-0.9.9 → pytdbot-0.9.10.dev0}/pytdbot/utils/asyncio_utils.py +0 -0
- {pytdbot-0.9.9 → pytdbot-0.9.10.dev0}/pytdbot/utils/escape.py +0 -0
- {pytdbot-0.9.9 → pytdbot-0.9.10.dev0}/pytdbot/utils/json_utils.py +0 -0
- {pytdbot-0.9.9 → pytdbot-0.9.10.dev0}/pytdbot/utils/obj_encoder.py +0 -0
- {pytdbot-0.9.9 → pytdbot-0.9.10.dev0}/pytdbot/utils/strings.py +0 -0
- {pytdbot-0.9.9 → pytdbot-0.9.10.dev0}/pytdbot/utils/text_format.py +0 -0
- {pytdbot-0.9.9 → pytdbot-0.9.10.dev0}/pytdbot/utils/webapps.py +0 -0
- {pytdbot-0.9.9 → pytdbot-0.9.10.dev0}/requirements.txt +0 -0
- {pytdbot-0.9.9 → pytdbot-0.9.10.dev0}/setup.cfg +0 -0
- {pytdbot-0.9.9 → pytdbot-0.9.10.dev0}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: Pytdbot
|
|
3
|
-
Version: 0.9.
|
|
3
|
+
Version: 0.9.10.dev0
|
|
4
4
|
Summary: Easy-to-use asynchronous TDLib wrapper for Python.
|
|
5
5
|
Home-page: https://github.com/pytdbot/client
|
|
6
6
|
Author: AYMEN Mohammed
|
|
@@ -30,7 +30,7 @@ Dynamic: requires-dist
|
|
|
30
30
|
Dynamic: requires-python
|
|
31
31
|
Dynamic: summary
|
|
32
32
|
|
|
33
|
-
# Pytdbot [](https://pypi.org/project/Pytdbot) [](https://pypi.org/project/Pytdbot) [](https://github.com/tdlib/td) [](https://pepy.tech/project/pytdbot) [](https://t.me/pytdbotchat)
|
|
34
34
|
|
|
35
35
|
<a href="https://cupofton.pages.dev/donate?a=UQCeySURtYxvqF2jNXlsFrXuTEqPjJhGx8uoev6tUbD_HELL&n=AYMEN&t=5&c=You+deserve+a+Cup+of+TON+for+Pytdbot%2521" target="_blank" rel="noopener">
|
|
36
36
|
<img src="https://cupofton.pages.dev/assets/badge-1.svg" alt="Buy me a Cup of TON" style="width: 600px; height: auto;">
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: Pytdbot
|
|
3
|
-
Version: 0.9.
|
|
3
|
+
Version: 0.9.10.dev0
|
|
4
4
|
Summary: Easy-to-use asynchronous TDLib wrapper for Python.
|
|
5
5
|
Home-page: https://github.com/pytdbot/client
|
|
6
6
|
Author: AYMEN Mohammed
|
|
@@ -30,7 +30,7 @@ Dynamic: requires-dist
|
|
|
30
30
|
Dynamic: requires-python
|
|
31
31
|
Dynamic: summary
|
|
32
32
|
|
|
33
|
-
# Pytdbot [](https://pypi.org/project/Pytdbot) [](https://pypi.org/project/Pytdbot) [](https://github.com/tdlib/td) [](https://pepy.tech/project/pytdbot) [](https://t.me/pytdbotchat)
|
|
34
34
|
|
|
35
35
|
<a href="https://cupofton.pages.dev/donate?a=UQCeySURtYxvqF2jNXlsFrXuTEqPjJhGx8uoev6tUbD_HELL&n=AYMEN&t=5&c=You+deserve+a+Cup+of+TON+for+Pytdbot%2521" target="_blank" rel="noopener">
|
|
36
36
|
<img src="https://cupofton.pages.dev/assets/badge-1.svg" alt="Buy me a Cup of TON" style="width: 600px; height: auto;">
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Pytdbot [](https://pypi.org/project/Pytdbot) [](https://pypi.org/project/Pytdbot) [](https://github.com/tdlib/td) [](https://pepy.tech/project/pytdbot) [](https://t.me/pytdbotchat)
|
|
2
2
|
|
|
3
3
|
<a href="https://cupofton.pages.dev/donate?a=UQCeySURtYxvqF2jNXlsFrXuTEqPjJhGx8uoev6tUbD_HELL&n=AYMEN&t=5&c=You+deserve+a+Cup+of+TON+for+Pytdbot%2521" target="_blank" rel="noopener">
|
|
4
4
|
<img src="https://cupofton.pages.dev/assets/badge-1.svg" alt="Buy me a Cup of TON" style="width: 600px; height: auto;">
|
|
@@ -13,8 +13,8 @@ __all__ = [
|
|
|
13
13
|
"Client",
|
|
14
14
|
]
|
|
15
15
|
|
|
16
|
-
__version__ = "0.9.
|
|
17
|
-
__copyright__ = "Copyright (c) 2022-
|
|
16
|
+
__version__ = "0.9.10dev0"
|
|
17
|
+
__copyright__ = "Copyright (c) 2022-2026 Pytdbot, AYMENJD"
|
|
18
18
|
__license__ = "MIT License"
|
|
19
19
|
|
|
20
20
|
VERSION = __version__
|
|
@@ -203,6 +203,7 @@ class Client(Decorators, Methods):
|
|
|
203
203
|
self._current_handlers = {}
|
|
204
204
|
self._results: Dict[str, asyncio.Future] = {}
|
|
205
205
|
self._workers_tasks = None
|
|
206
|
+
self.__wait_login: asyncio.Event = None
|
|
206
207
|
self.__rabbitmq_iterator_task = None
|
|
207
208
|
self.__authorization_state = None
|
|
208
209
|
self.__cache = {"is_coro_filter": {}}
|
|
@@ -309,8 +310,13 @@ class Client(Decorators, Methods):
|
|
|
309
310
|
{"@type": "cancelScheduledEvent", "event_id": event_id}
|
|
310
311
|
)
|
|
311
312
|
|
|
312
|
-
async def start(self) -> None:
|
|
313
|
-
r"""Start pytdbot client
|
|
313
|
+
async def start(self, wait_login: bool = True) -> None:
|
|
314
|
+
r"""Start pytdbot client
|
|
315
|
+
|
|
316
|
+
Parameters:
|
|
317
|
+
wait_login (``bool``, *optional*):
|
|
318
|
+
Whether to wait until the client is logged in. For bots only. Default is ``True``
|
|
319
|
+
"""
|
|
314
320
|
|
|
315
321
|
if not self.is_running:
|
|
316
322
|
self.logger.info("Starting pytdbot client...")
|
|
@@ -318,6 +324,8 @@ class Client(Decorators, Methods):
|
|
|
318
324
|
if self.is_rabbitmq:
|
|
319
325
|
await self.__start_rabbitmq()
|
|
320
326
|
elif not self.client_manager:
|
|
327
|
+
self.__wait_login = asyncio.Event() if not self.user_bot else None
|
|
328
|
+
|
|
321
329
|
self.client_manager = ClientManager(
|
|
322
330
|
self, self.lib_path, self.td_verbosity, loop=self.loop
|
|
323
331
|
)
|
|
@@ -351,6 +359,9 @@ class Client(Decorators, Methods):
|
|
|
351
359
|
self.getOption("version")
|
|
352
360
|
) # Ping TDLib to start processing updates
|
|
353
361
|
|
|
362
|
+
if wait_login and self.__wait_login:
|
|
363
|
+
await self.__wait_login.wait()
|
|
364
|
+
|
|
354
365
|
def add_handler(
|
|
355
366
|
self,
|
|
356
367
|
update_type: Union[Type["pytdbot.types.Update"], str],
|
|
@@ -1048,6 +1059,9 @@ class Client(Decorators, Methods):
|
|
|
1048
1059
|
if isinstance(self.me, types.Error):
|
|
1049
1060
|
self.logger.error(f"Get me error: {self.me.message}")
|
|
1050
1061
|
|
|
1062
|
+
if self.__wait_login:
|
|
1063
|
+
self.__wait_login.set()
|
|
1064
|
+
|
|
1051
1065
|
self.logger.info(
|
|
1052
1066
|
f"Logged in as {self.me.first_name} "
|
|
1053
1067
|
f"{str(self.me.id) if not self.me.usernames else '@' + self.me.usernames.editable_username}"
|
|
@@ -8625,6 +8625,65 @@ class Updates:
|
|
|
8625
8625
|
|
|
8626
8626
|
return decorator
|
|
8627
8627
|
|
|
8628
|
+
def on_updateStakeDiceState(
|
|
8629
|
+
self: "pytdbot.Client" = None,
|
|
8630
|
+
filters: "pytdbot.filters.Filter" = None,
|
|
8631
|
+
position: int = None,
|
|
8632
|
+
timeout: float = None,
|
|
8633
|
+
) -> Callable:
|
|
8634
|
+
r"""The stake dice state has changed
|
|
8635
|
+
|
|
8636
|
+
Parameters:
|
|
8637
|
+
filters (:class:`pytdbot.filters.Filter`, *optional*):
|
|
8638
|
+
An update filter
|
|
8639
|
+
|
|
8640
|
+
position (``int``, *optional*):
|
|
8641
|
+
The function position in handlers list. Default is ``None`` (append)
|
|
8642
|
+
|
|
8643
|
+
timeout (``float``, *optional*):
|
|
8644
|
+
Max execution time for the handler before it timeout. Default is ``None``
|
|
8645
|
+
|
|
8646
|
+
Raises:
|
|
8647
|
+
:py:class:`TypeError`
|
|
8648
|
+
"""
|
|
8649
|
+
|
|
8650
|
+
def decorator(func: Callable) -> Callable:
|
|
8651
|
+
if hasattr(func, "_handler"):
|
|
8652
|
+
return func
|
|
8653
|
+
elif isinstance(self, pytdbot.Client):
|
|
8654
|
+
if iscoroutinefunction(func):
|
|
8655
|
+
self.add_handler(
|
|
8656
|
+
update_type="updateStakeDiceState",
|
|
8657
|
+
func=func,
|
|
8658
|
+
filters=filters,
|
|
8659
|
+
position=position,
|
|
8660
|
+
inner_object=False,
|
|
8661
|
+
timeout=timeout,
|
|
8662
|
+
)
|
|
8663
|
+
else:
|
|
8664
|
+
raise TypeError("Handler must be async")
|
|
8665
|
+
elif isinstance(self, pytdbot.filters.Filter):
|
|
8666
|
+
func._handler = Handler(
|
|
8667
|
+
func=func,
|
|
8668
|
+
update_type="updateStakeDiceState",
|
|
8669
|
+
filter=self,
|
|
8670
|
+
position=position,
|
|
8671
|
+
inner_object=False,
|
|
8672
|
+
timeout=timeout,
|
|
8673
|
+
)
|
|
8674
|
+
else:
|
|
8675
|
+
func._handler = Handler(
|
|
8676
|
+
func=func,
|
|
8677
|
+
update_type="updateStakeDiceState",
|
|
8678
|
+
filter=filters,
|
|
8679
|
+
position=position,
|
|
8680
|
+
inner_object=False,
|
|
8681
|
+
timeout=timeout,
|
|
8682
|
+
)
|
|
8683
|
+
return func
|
|
8684
|
+
|
|
8685
|
+
return decorator
|
|
8686
|
+
|
|
8628
8687
|
def on_updateAnimatedEmojiMessageClicked(
|
|
8629
8688
|
self: "pytdbot.Client" = None,
|
|
8630
8689
|
filters: "pytdbot.filters.Filter" = None,
|
|
@@ -275,6 +275,62 @@ class TDLibFunctions:
|
|
|
275
275
|
{"@type": "requestQrCodeAuthentication", "other_user_ids": other_user_ids}
|
|
276
276
|
)
|
|
277
277
|
|
|
278
|
+
async def getAuthenticationPasskeyParameters(
|
|
279
|
+
self,
|
|
280
|
+
) -> Union["pytdbot.types.Error", "pytdbot.types.Text"]:
|
|
281
|
+
r"""Returns parameters for authentication using a passkey as JSON\-serialized string
|
|
282
|
+
|
|
283
|
+
Returns:
|
|
284
|
+
:class:`~pytdbot.types.Text`
|
|
285
|
+
"""
|
|
286
|
+
|
|
287
|
+
return await self.invoke(
|
|
288
|
+
{
|
|
289
|
+
"@type": "getAuthenticationPasskeyParameters",
|
|
290
|
+
}
|
|
291
|
+
)
|
|
292
|
+
|
|
293
|
+
async def checkAuthenticationPasskey(
|
|
294
|
+
self,
|
|
295
|
+
credential_id: str = "",
|
|
296
|
+
client_data: str = "",
|
|
297
|
+
authenticator_data: bytes = b"",
|
|
298
|
+
signature: bytes = b"",
|
|
299
|
+
user_handle: bytes = b"",
|
|
300
|
+
) -> Union["pytdbot.types.Error", "pytdbot.types.Ok"]:
|
|
301
|
+
r"""Checks a passkey to log in to the corresponding account\. Call getAuthenticationPasskeyParameters to get parameters for the passkey\. Works only when the current authorization state is authorizationStateWaitPhoneNumber or authorizationStateWaitOtherDeviceConfirmation, or if there is no pending authentication query and the current authorization state is authorizationStateWaitPremiumPurchase, authorizationStateWaitEmailAddress, authorizationStateWaitEmailCode, authorizationStateWaitCode, authorizationStateWaitRegistration, or authorizationStateWaitPassword
|
|
302
|
+
|
|
303
|
+
Parameters:
|
|
304
|
+
credential_id (:class:`str`):
|
|
305
|
+
Base64url\-encoded identifier of the credential
|
|
306
|
+
|
|
307
|
+
client_data (:class:`str`):
|
|
308
|
+
JSON\-encoded client data
|
|
309
|
+
|
|
310
|
+
authenticator_data (:class:`bytes`):
|
|
311
|
+
Authenticator data of the application that created the credential
|
|
312
|
+
|
|
313
|
+
signature (:class:`bytes`):
|
|
314
|
+
Cryptographic signature of the credential
|
|
315
|
+
|
|
316
|
+
user_handle (:class:`bytes`):
|
|
317
|
+
User handle of the passkey
|
|
318
|
+
|
|
319
|
+
Returns:
|
|
320
|
+
:class:`~pytdbot.types.Ok`
|
|
321
|
+
"""
|
|
322
|
+
|
|
323
|
+
return await self.invoke(
|
|
324
|
+
{
|
|
325
|
+
"@type": "checkAuthenticationPasskey",
|
|
326
|
+
"credential_id": credential_id,
|
|
327
|
+
"client_data": client_data,
|
|
328
|
+
"authenticator_data": authenticator_data,
|
|
329
|
+
"signature": signature,
|
|
330
|
+
"user_handle": user_handle,
|
|
331
|
+
}
|
|
332
|
+
)
|
|
333
|
+
|
|
278
334
|
async def registerUser(
|
|
279
335
|
self,
|
|
280
336
|
first_name: str = "",
|
|
@@ -1074,7 +1130,7 @@ class TDLibFunctions:
|
|
|
1074
1130
|
async def getRepliedMessage(
|
|
1075
1131
|
self, chat_id: int = 0, message_id: int = 0
|
|
1076
1132
|
) -> Union["pytdbot.types.Error", "pytdbot.types.Message"]:
|
|
1077
|
-
r"""Returns information about a non\-bundled message that is replied by a given message\. Also, returns the pinned message for messagePinMessage, the game message for messageGameScore, the invoice message for messagePaymentSuccessful, the message with a previously set same background for messageChatSetBackground, the giveaway message for messageGiveawayCompleted, the checklist message for messageChecklistTasksDone, messageChecklistTasksAdded, the message with suggested post information for messageSuggestedPostApprovalFailed, messageSuggestedPostApproved, messageSuggestedPostDeclined, messageSuggestedPostPaid, messageSuggestedPostRefunded, the message with the regular gift that was upgraded for messageUpgradedGift with origin of the type upgradedGiftOriginUpgrade, and the topic creation message for topic messages without non\-bundled replied message\. Returns a 404 error if the message doesn't exist
|
|
1133
|
+
r"""Returns information about a non\-bundled message that is replied by a given message\. Also, returns the pinned message for messagePinMessage, the game message for messageGameScore, the invoice message for messagePaymentSuccessful, the message with a previously set same background for messageChatSetBackground, the giveaway message for messageGiveawayCompleted, the checklist message for messageChecklistTasksDone, messageChecklistTasksAdded, the message with suggested post information for messageSuggestedPostApprovalFailed, messageSuggestedPostApproved, messageSuggestedPostDeclined, messageSuggestedPostPaid, messageSuggestedPostRefunded, the message with the regular gift that was upgraded for messageUpgradedGift with origin of the type upgradedGiftOriginUpgrade, the message with gift purchase offer for messageUpgradedGiftPurchaseOfferRejected, and the topic creation message for topic messages without non\-bundled replied message\. Returns a 404 error if the message doesn't exist
|
|
1078
1134
|
|
|
1079
1135
|
Parameters:
|
|
1080
1136
|
chat_id (:class:`int`):
|
|
@@ -3524,7 +3580,7 @@ class TDLibFunctions:
|
|
|
3524
3580
|
Identifier of the message
|
|
3525
3581
|
|
|
3526
3582
|
to_language_code (:class:`str`):
|
|
3527
|
-
Language code of the language to which the message is translated\.
|
|
3583
|
+
Language code of the language to which the message is translated\. See translateText\.to\_language\_code for the list of supported values
|
|
3528
3584
|
|
|
3529
3585
|
Returns:
|
|
3530
3586
|
:class:`~pytdbot.types.FormattedText`
|
|
@@ -3539,6 +3595,37 @@ class TDLibFunctions:
|
|
|
3539
3595
|
}
|
|
3540
3596
|
)
|
|
3541
3597
|
|
|
3598
|
+
async def summarizeMessage(
|
|
3599
|
+
self,
|
|
3600
|
+
chat_id: int = 0,
|
|
3601
|
+
message_id: int = 0,
|
|
3602
|
+
translate_to_language_code: str = "",
|
|
3603
|
+
) -> Union["pytdbot.types.Error", "pytdbot.types.FormattedText"]:
|
|
3604
|
+
r"""Summarizes content of the message with non\-empty summary\_language\_code
|
|
3605
|
+
|
|
3606
|
+
Parameters:
|
|
3607
|
+
chat_id (:class:`int`):
|
|
3608
|
+
Identifier of the chat to which the message belongs
|
|
3609
|
+
|
|
3610
|
+
message_id (:class:`int`):
|
|
3611
|
+
Identifier of the message
|
|
3612
|
+
|
|
3613
|
+
translate_to_language_code (:class:`str`):
|
|
3614
|
+
Pass a language code to which the summary will be translated; may be empty if translation isn't needed\. See translateText\.to\_language\_code for the list of supported values
|
|
3615
|
+
|
|
3616
|
+
Returns:
|
|
3617
|
+
:class:`~pytdbot.types.FormattedText`
|
|
3618
|
+
"""
|
|
3619
|
+
|
|
3620
|
+
return await self.invoke(
|
|
3621
|
+
{
|
|
3622
|
+
"@type": "summarizeMessage",
|
|
3623
|
+
"chat_id": chat_id,
|
|
3624
|
+
"message_id": message_id,
|
|
3625
|
+
"translate_to_language_code": translate_to_language_code,
|
|
3626
|
+
}
|
|
3627
|
+
)
|
|
3628
|
+
|
|
3542
3629
|
async def recognizeSpeech(
|
|
3543
3630
|
self, chat_id: int = 0, message_id: int = 0
|
|
3544
3631
|
) -> Union["pytdbot.types.Error", "pytdbot.types.Ok"]:
|
|
@@ -5222,7 +5309,7 @@ class TDLibFunctions:
|
|
|
5222
5309
|
async def transferBusinessAccountStars(
|
|
5223
5310
|
self, business_connection_id: str = "", star_count: int = 0
|
|
5224
5311
|
) -> Union["pytdbot.types.Error", "pytdbot.types.Ok"]:
|
|
5225
|
-
r"""
|
|
5312
|
+
r"""Transfers Telegram Stars from the business account to the business bot; for bots only
|
|
5226
5313
|
|
|
5227
5314
|
Parameters:
|
|
5228
5315
|
business_connection_id (:class:`str`):
|
|
@@ -5988,6 +6075,77 @@ class TDLibFunctions:
|
|
|
5988
6075
|
}
|
|
5989
6076
|
)
|
|
5990
6077
|
|
|
6078
|
+
async def getPasskeyParameters(
|
|
6079
|
+
self,
|
|
6080
|
+
) -> Union["pytdbot.types.Error", "pytdbot.types.Text"]:
|
|
6081
|
+
r"""Returns parameters for creating of a new passkey as JSON\-serialized string
|
|
6082
|
+
|
|
6083
|
+
Returns:
|
|
6084
|
+
:class:`~pytdbot.types.Text`
|
|
6085
|
+
"""
|
|
6086
|
+
|
|
6087
|
+
return await self.invoke(
|
|
6088
|
+
{
|
|
6089
|
+
"@type": "getPasskeyParameters",
|
|
6090
|
+
}
|
|
6091
|
+
)
|
|
6092
|
+
|
|
6093
|
+
async def addLoginPasskey(
|
|
6094
|
+
self, client_data: str = "", attestation_object: bytes = b""
|
|
6095
|
+
) -> Union["pytdbot.types.Error", "pytdbot.types.Passkey"]:
|
|
6096
|
+
r"""Adds a passkey allowed to be used for the login by the current user and returns the added passkey\. Call getPasskeyParameters to get parameters for creating of the passkey
|
|
6097
|
+
|
|
6098
|
+
Parameters:
|
|
6099
|
+
client_data (:class:`str`):
|
|
6100
|
+
JSON\-encoded client data
|
|
6101
|
+
|
|
6102
|
+
attestation_object (:class:`bytes`):
|
|
6103
|
+
Passkey attestation object
|
|
6104
|
+
|
|
6105
|
+
Returns:
|
|
6106
|
+
:class:`~pytdbot.types.Passkey`
|
|
6107
|
+
"""
|
|
6108
|
+
|
|
6109
|
+
return await self.invoke(
|
|
6110
|
+
{
|
|
6111
|
+
"@type": "addLoginPasskey",
|
|
6112
|
+
"client_data": client_data,
|
|
6113
|
+
"attestation_object": attestation_object,
|
|
6114
|
+
}
|
|
6115
|
+
)
|
|
6116
|
+
|
|
6117
|
+
async def getLoginPasskeys(
|
|
6118
|
+
self,
|
|
6119
|
+
) -> Union["pytdbot.types.Error", "pytdbot.types.Passkeys"]:
|
|
6120
|
+
r"""Returns the list of passkeys allowed to be used for the login by the current user
|
|
6121
|
+
|
|
6122
|
+
Returns:
|
|
6123
|
+
:class:`~pytdbot.types.Passkeys`
|
|
6124
|
+
"""
|
|
6125
|
+
|
|
6126
|
+
return await self.invoke(
|
|
6127
|
+
{
|
|
6128
|
+
"@type": "getLoginPasskeys",
|
|
6129
|
+
}
|
|
6130
|
+
)
|
|
6131
|
+
|
|
6132
|
+
async def removeLoginPasskey(
|
|
6133
|
+
self, passkey_id: str = ""
|
|
6134
|
+
) -> Union["pytdbot.types.Error", "pytdbot.types.Ok"]:
|
|
6135
|
+
r"""Removes a passkey from the list of passkeys allowed to be used for the login by the current user
|
|
6136
|
+
|
|
6137
|
+
Parameters:
|
|
6138
|
+
passkey_id (:class:`str`):
|
|
6139
|
+
Unique identifier of the passkey to remove
|
|
6140
|
+
|
|
6141
|
+
Returns:
|
|
6142
|
+
:class:`~pytdbot.types.Ok`
|
|
6143
|
+
"""
|
|
6144
|
+
|
|
6145
|
+
return await self.invoke(
|
|
6146
|
+
{"@type": "removeLoginPasskey", "passkey_id": passkey_id}
|
|
6147
|
+
)
|
|
6148
|
+
|
|
5991
6149
|
async def getEmojiReaction(
|
|
5992
6150
|
self, emoji: str = ""
|
|
5993
6151
|
) -> Union["pytdbot.types.Error", "pytdbot.types.EmojiReaction"]:
|
|
@@ -9693,6 +9851,21 @@ class TDLibFunctions:
|
|
|
9693
9851
|
}
|
|
9694
9852
|
)
|
|
9695
9853
|
|
|
9854
|
+
async def getStakeDiceState(
|
|
9855
|
+
self,
|
|
9856
|
+
) -> Union["pytdbot.types.Error", "pytdbot.types.StakeDiceState"]:
|
|
9857
|
+
r"""Returns the current state of stake dice
|
|
9858
|
+
|
|
9859
|
+
Returns:
|
|
9860
|
+
:class:`~pytdbot.types.StakeDiceState`
|
|
9861
|
+
"""
|
|
9862
|
+
|
|
9863
|
+
return await self.invoke(
|
|
9864
|
+
{
|
|
9865
|
+
"@type": "getStakeDiceState",
|
|
9866
|
+
}
|
|
9867
|
+
)
|
|
9868
|
+
|
|
9696
9869
|
async def getSavedNotificationSound(
|
|
9697
9870
|
self, notification_sound_id: int = 0
|
|
9698
9871
|
) -> Union["pytdbot.types.Error", "pytdbot.types.NotificationSounds"]:
|
|
@@ -9921,7 +10094,7 @@ class TDLibFunctions:
|
|
|
9921
10094
|
async def readChatList(
|
|
9922
10095
|
self, chat_list: "pytdbot.types.ChatList" = None
|
|
9923
10096
|
) -> Union["pytdbot.types.Error", "pytdbot.types.Ok"]:
|
|
9924
|
-
r"""
|
|
10097
|
+
r"""Traverses all chats in a chat list and marks all messages in the chats as read
|
|
9925
10098
|
|
|
9926
10099
|
Parameters:
|
|
9927
10100
|
chat_list (:class:`~pytdbot.types.ChatList`):
|
|
@@ -11406,7 +11579,7 @@ class TDLibFunctions:
|
|
|
11406
11579
|
file_type: "pytdbot.types.FileType" = None,
|
|
11407
11580
|
priority: int = 0,
|
|
11408
11581
|
) -> Union["pytdbot.types.Error", "pytdbot.types.File"]:
|
|
11409
|
-
r"""
|
|
11582
|
+
r"""Preliminarily uploads a file to the cloud before sending it in a message, which can be useful for uploading of being recorded voice and video notes\. In all other cases there is no need to preliminary upload a file\. Updates updateFile will be used to notify about upload progress\. The upload will not be completed until the file is sent in a message
|
|
11410
11583
|
|
|
11411
11584
|
Parameters:
|
|
11412
11585
|
file (:class:`~pytdbot.types.InputFile`):
|
|
@@ -11743,7 +11916,7 @@ class TDLibFunctions:
|
|
|
11743
11916
|
async def setApplicationVerificationToken(
|
|
11744
11917
|
self, verification_id: int = 0, token: str = ""
|
|
11745
11918
|
) -> Union["pytdbot.types.Error", "pytdbot.types.Ok"]:
|
|
11746
|
-
r"""
|
|
11919
|
+
r"""Informs TDLib that application or reCAPTCHA verification has been completed\. Can be called before authorization
|
|
11747
11920
|
|
|
11748
11921
|
Parameters:
|
|
11749
11922
|
verification_id (:class:`int`):
|
|
@@ -14475,6 +14648,37 @@ class TDLibFunctions:
|
|
|
14475
14648
|
}
|
|
14476
14649
|
)
|
|
14477
14650
|
|
|
14651
|
+
async def getStickerOutlineSvgPath(
|
|
14652
|
+
self,
|
|
14653
|
+
sticker_file_id: int = 0,
|
|
14654
|
+
for_animated_emoji: bool = False,
|
|
14655
|
+
for_clicked_animated_emoji_message: bool = False,
|
|
14656
|
+
) -> Union["pytdbot.types.Error", "pytdbot.types.Text"]:
|
|
14657
|
+
r"""Returns outline of a sticker as an SVG path\. This is an offline method\. Returns an empty string if the outline isn't known
|
|
14658
|
+
|
|
14659
|
+
Parameters:
|
|
14660
|
+
sticker_file_id (:class:`int`):
|
|
14661
|
+
File identifier of the sticker
|
|
14662
|
+
|
|
14663
|
+
for_animated_emoji (:class:`bool`):
|
|
14664
|
+
Pass true to get the outline scaled for animated emoji
|
|
14665
|
+
|
|
14666
|
+
for_clicked_animated_emoji_message (:class:`bool`):
|
|
14667
|
+
Pass true to get the outline scaled for clicked animated emoji message
|
|
14668
|
+
|
|
14669
|
+
Returns:
|
|
14670
|
+
:class:`~pytdbot.types.Text`
|
|
14671
|
+
"""
|
|
14672
|
+
|
|
14673
|
+
return await self.invoke(
|
|
14674
|
+
{
|
|
14675
|
+
"@type": "getStickerOutlineSvgPath",
|
|
14676
|
+
"sticker_file_id": sticker_file_id,
|
|
14677
|
+
"for_animated_emoji": for_animated_emoji,
|
|
14678
|
+
"for_clicked_animated_emoji_message": for_clicked_animated_emoji_message,
|
|
14679
|
+
}
|
|
14680
|
+
)
|
|
14681
|
+
|
|
14478
14682
|
async def getStickers(
|
|
14479
14683
|
self,
|
|
14480
14684
|
sticker_type: "pytdbot.types.StickerType" = None,
|
|
@@ -15060,7 +15264,7 @@ class TDLibFunctions:
|
|
|
15060
15264
|
async def getKeywordEmojis(
|
|
15061
15265
|
self, text: str = "", input_language_codes: List[str] = None
|
|
15062
15266
|
) -> Union["pytdbot.types.Error", "pytdbot.types.Emojis"]:
|
|
15063
|
-
r"""
|
|
15267
|
+
r"""Returns emojis matching the keyword\. Supported only if the file database is enabled\. Order of results is unspecified
|
|
15064
15268
|
|
|
15065
15269
|
Parameters:
|
|
15066
15270
|
text (:class:`str`):
|
|
@@ -15804,7 +16008,7 @@ class TDLibFunctions:
|
|
|
15804
16008
|
async def checkPhoneNumberCode(
|
|
15805
16009
|
self, code: str = ""
|
|
15806
16010
|
) -> Union["pytdbot.types.Error", "pytdbot.types.Ok"]:
|
|
15807
|
-
r"""
|
|
16011
|
+
r"""Checks the authentication code and completes the request for which the code was sent if appropriate
|
|
15808
16012
|
|
|
15809
16013
|
Parameters:
|
|
15810
16014
|
code (:class:`str`):
|
|
@@ -16367,7 +16571,7 @@ class TDLibFunctions:
|
|
|
16367
16571
|
async def deleteBotMediaPreviews(
|
|
16368
16572
|
self, bot_user_id: int = 0, language_code: str = "", file_ids: List[int] = None
|
|
16369
16573
|
) -> Union["pytdbot.types.Error", "pytdbot.types.Ok"]:
|
|
16370
|
-
r"""
|
|
16574
|
+
r"""Deletes media previews from the list of media previews of a bot
|
|
16371
16575
|
|
|
16372
16576
|
Parameters:
|
|
16373
16577
|
bot_user_id (:class:`int`):
|
|
@@ -17947,6 +18151,23 @@ class TDLibFunctions:
|
|
|
17947
18151
|
|
|
17948
18152
|
return await self.invoke({"@type": "getGiftUpgradePreview", "gift_id": gift_id})
|
|
17949
18153
|
|
|
18154
|
+
async def getGiftUpgradeVariants(
|
|
18155
|
+
self, gift_id: int = 0
|
|
18156
|
+
) -> Union["pytdbot.types.Error", "pytdbot.types.GiftUpgradeVariants"]:
|
|
18157
|
+
r"""Returns all possible variants of upgraded gifts for a regular gift
|
|
18158
|
+
|
|
18159
|
+
Parameters:
|
|
18160
|
+
gift_id (:class:`int`):
|
|
18161
|
+
Identifier of the gift
|
|
18162
|
+
|
|
18163
|
+
Returns:
|
|
18164
|
+
:class:`~pytdbot.types.GiftUpgradeVariants`
|
|
18165
|
+
"""
|
|
18166
|
+
|
|
18167
|
+
return await self.invoke(
|
|
18168
|
+
{"@type": "getGiftUpgradeVariants", "gift_id": gift_id}
|
|
18169
|
+
)
|
|
18170
|
+
|
|
17950
18171
|
async def upgradeGift(
|
|
17951
18172
|
self,
|
|
17952
18173
|
business_connection_id: str = "",
|
|
@@ -18105,6 +18326,71 @@ class TDLibFunctions:
|
|
|
18105
18326
|
}
|
|
18106
18327
|
)
|
|
18107
18328
|
|
|
18329
|
+
async def sendGiftPurchaseOffer(
|
|
18330
|
+
self,
|
|
18331
|
+
owner_id: "pytdbot.types.MessageSender" = None,
|
|
18332
|
+
gift_name: str = "",
|
|
18333
|
+
price: "pytdbot.types.GiftResalePrice" = None,
|
|
18334
|
+
duration: int = 0,
|
|
18335
|
+
paid_message_star_count: int = 0,
|
|
18336
|
+
) -> Union["pytdbot.types.Error", "pytdbot.types.Ok"]:
|
|
18337
|
+
r"""Sends an offer to purchase an upgraded gift
|
|
18338
|
+
|
|
18339
|
+
Parameters:
|
|
18340
|
+
owner_id (:class:`~pytdbot.types.MessageSender`):
|
|
18341
|
+
Identifier of the user or the channel chat that currently owns the gift and will receive the offer
|
|
18342
|
+
|
|
18343
|
+
gift_name (:class:`str`):
|
|
18344
|
+
Name of the upgraded gift
|
|
18345
|
+
|
|
18346
|
+
price (:class:`~pytdbot.types.GiftResalePrice`):
|
|
18347
|
+
The price that the user agreed to pay for the gift
|
|
18348
|
+
|
|
18349
|
+
duration (:class:`int`):
|
|
18350
|
+
Duration of the offer, in seconds; must be one of 21600, 43200, 86400, 129600, 172800, or 259200\. Can also be 120 if Telegram test environment is used
|
|
18351
|
+
|
|
18352
|
+
paid_message_star_count (:class:`int`):
|
|
18353
|
+
The number of Telegram Stars the user agreed to pay additionally for sending of the offer message to the current gift owner; pass userFullInfo\.outgoing\_paid\_message\_star\_count for users and 0 otherwise
|
|
18354
|
+
|
|
18355
|
+
Returns:
|
|
18356
|
+
:class:`~pytdbot.types.Ok`
|
|
18357
|
+
"""
|
|
18358
|
+
|
|
18359
|
+
return await self.invoke(
|
|
18360
|
+
{
|
|
18361
|
+
"@type": "sendGiftPurchaseOffer",
|
|
18362
|
+
"owner_id": owner_id,
|
|
18363
|
+
"gift_name": gift_name,
|
|
18364
|
+
"price": price,
|
|
18365
|
+
"duration": duration,
|
|
18366
|
+
"paid_message_star_count": paid_message_star_count,
|
|
18367
|
+
}
|
|
18368
|
+
)
|
|
18369
|
+
|
|
18370
|
+
async def processGiftPurchaseOffer(
|
|
18371
|
+
self, message_id: int = 0, accept: bool = False
|
|
18372
|
+
) -> Union["pytdbot.types.Error", "pytdbot.types.Ok"]:
|
|
18373
|
+
r"""Handles a pending gift purchase offer
|
|
18374
|
+
|
|
18375
|
+
Parameters:
|
|
18376
|
+
message_id (:class:`int`):
|
|
18377
|
+
Identifier of the message with the gift purchase offer
|
|
18378
|
+
|
|
18379
|
+
accept (:class:`bool`):
|
|
18380
|
+
Pass true to accept the request; pass false to reject it
|
|
18381
|
+
|
|
18382
|
+
Returns:
|
|
18383
|
+
:class:`~pytdbot.types.Ok`
|
|
18384
|
+
"""
|
|
18385
|
+
|
|
18386
|
+
return await self.invoke(
|
|
18387
|
+
{
|
|
18388
|
+
"@type": "processGiftPurchaseOffer",
|
|
18389
|
+
"message_id": message_id,
|
|
18390
|
+
"accept": accept,
|
|
18391
|
+
}
|
|
18392
|
+
)
|
|
18393
|
+
|
|
18108
18394
|
async def getReceivedGifts(
|
|
18109
18395
|
self,
|
|
18110
18396
|
business_connection_id: str = "",
|
|
@@ -18262,6 +18548,21 @@ class TDLibFunctions:
|
|
|
18262
18548
|
}
|
|
18263
18549
|
)
|
|
18264
18550
|
|
|
18551
|
+
async def getUpgradedGiftsPromotionalAnimation(
|
|
18552
|
+
self,
|
|
18553
|
+
) -> Union["pytdbot.types.Error", "pytdbot.types.Animation"]:
|
|
18554
|
+
r"""Returns promotional anumation for upgraded gifts
|
|
18555
|
+
|
|
18556
|
+
Returns:
|
|
18557
|
+
:class:`~pytdbot.types.Animation`
|
|
18558
|
+
"""
|
|
18559
|
+
|
|
18560
|
+
return await self.invoke(
|
|
18561
|
+
{
|
|
18562
|
+
"@type": "getUpgradedGiftsPromotionalAnimation",
|
|
18563
|
+
}
|
|
18564
|
+
)
|
|
18565
|
+
|
|
18265
18566
|
async def setGiftResalePrice(
|
|
18266
18567
|
self, received_gift_id: str = "", price: "pytdbot.types.GiftResalePrice" = None
|
|
18267
18568
|
) -> Union["pytdbot.types.Error", "pytdbot.types.Ok"]:
|
|
@@ -19163,7 +19464,7 @@ class TDLibFunctions:
|
|
|
19163
19464
|
async def canSendMessageToUser(
|
|
19164
19465
|
self, user_id: int = 0, only_local: bool = False
|
|
19165
19466
|
) -> Union["pytdbot.types.Error", "pytdbot.types.CanSendMessageToUserResult"]:
|
|
19166
|
-
r"""
|
|
19467
|
+
r"""Checks whether the current user can message another user or try to create a chat with them
|
|
19167
19468
|
|
|
19168
19469
|
Parameters:
|
|
19169
19470
|
user_id (:class:`int`):
|
|
@@ -20909,7 +21210,7 @@ class TDLibFunctions:
|
|
|
20909
21210
|
async def checkPremiumGiftCode(
|
|
20910
21211
|
self, code: str = ""
|
|
20911
21212
|
) -> Union["pytdbot.types.Error", "pytdbot.types.PremiumGiftCodeInfo"]:
|
|
20912
|
-
r"""
|
|
21213
|
+
r"""Returns information about a Telegram Premium gift code
|
|
20913
21214
|
|
|
20914
21215
|
Parameters:
|
|
20915
21216
|
code (:class:`str`):
|