Pytdbot 0.9.2.dev4__tar.gz → 0.9.3__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.
Files changed (43) hide show
  1. {pytdbot-0.9.2.dev4 → pytdbot-0.9.3}/PKG-INFO +2 -2
  2. {pytdbot-0.9.2.dev4 → pytdbot-0.9.3}/Pytdbot.egg-info/PKG-INFO +2 -2
  3. {pytdbot-0.9.2.dev4 → pytdbot-0.9.3}/README.md +1 -1
  4. {pytdbot-0.9.2.dev4 → pytdbot-0.9.3}/pytdbot/__init__.py +1 -1
  5. {pytdbot-0.9.2.dev4 → pytdbot-0.9.3}/pytdbot/client_manager.py +2 -2
  6. {pytdbot-0.9.2.dev4 → pytdbot-0.9.3}/pytdbot/handlers/decorators.py +3 -2
  7. {pytdbot-0.9.2.dev4 → pytdbot-0.9.3}/pytdbot/handlers/handler.py +3 -1
  8. {pytdbot-0.9.2.dev4 → pytdbot-0.9.3}/pytdbot/handlers/td_updates.py +90 -10
  9. {pytdbot-0.9.2.dev4 → pytdbot-0.9.3}/pytdbot/methods/methods.py +2 -3
  10. {pytdbot-0.9.2.dev4 → pytdbot-0.9.3}/pytdbot/methods/td_functions.py +444 -144
  11. {pytdbot-0.9.2.dev4 → pytdbot-0.9.3}/pytdbot/tdjson/tdjson.py +4 -5
  12. {pytdbot-0.9.2.dev4 → pytdbot-0.9.3}/pytdbot/types/__init__.py +109 -33
  13. {pytdbot-0.9.2.dev4 → pytdbot-0.9.3}/pytdbot/types/td_types/bound_methods/chatActions.py +2 -1
  14. {pytdbot-0.9.2.dev4 → pytdbot-0.9.3}/pytdbot/types/td_types/bound_methods/file.py +1 -0
  15. {pytdbot-0.9.2.dev4 → pytdbot-0.9.3}/pytdbot/types/td_types/bound_methods/message.py +32 -3
  16. {pytdbot-0.9.2.dev4 → pytdbot-0.9.3}/pytdbot/types/td_types/types.py +1955 -368
  17. {pytdbot-0.9.2.dev4 → pytdbot-0.9.3}/pytdbot/utils/text_format.py +39 -37
  18. {pytdbot-0.9.2.dev4 → pytdbot-0.9.3}/setup.py +1 -1
  19. {pytdbot-0.9.2.dev4 → pytdbot-0.9.3}/LICENSE +0 -0
  20. {pytdbot-0.9.2.dev4 → pytdbot-0.9.3}/MANIFEST.in +0 -0
  21. {pytdbot-0.9.2.dev4 → pytdbot-0.9.3}/Pytdbot.egg-info/SOURCES.txt +0 -0
  22. {pytdbot-0.9.2.dev4 → pytdbot-0.9.3}/Pytdbot.egg-info/dependency_links.txt +0 -0
  23. {pytdbot-0.9.2.dev4 → pytdbot-0.9.3}/Pytdbot.egg-info/requires.txt +0 -0
  24. {pytdbot-0.9.2.dev4 → pytdbot-0.9.3}/Pytdbot.egg-info/top_level.txt +0 -0
  25. {pytdbot-0.9.2.dev4 → pytdbot-0.9.3}/pytdbot/client.py +0 -0
  26. {pytdbot-0.9.2.dev4 → pytdbot-0.9.3}/pytdbot/exception/__init__.py +0 -0
  27. {pytdbot-0.9.2.dev4 → pytdbot-0.9.3}/pytdbot/filters.py +0 -0
  28. {pytdbot-0.9.2.dev4 → pytdbot-0.9.3}/pytdbot/handlers/__init__.py +0 -0
  29. {pytdbot-0.9.2.dev4 → pytdbot-0.9.3}/pytdbot/methods/__init__.py +0 -0
  30. {pytdbot-0.9.2.dev4 → pytdbot-0.9.3}/pytdbot/tdjson/__init__.py +0 -0
  31. {pytdbot-0.9.2.dev4 → pytdbot-0.9.3}/pytdbot/types/plugins/__init__.py +0 -0
  32. {pytdbot-0.9.2.dev4 → pytdbot-0.9.3}/pytdbot/types/td_types/__init__.py +0 -0
  33. {pytdbot-0.9.2.dev4 → pytdbot-0.9.3}/pytdbot/types/td_types/bound_methods/__init__.py +0 -0
  34. {pytdbot-0.9.2.dev4 → pytdbot-0.9.3}/pytdbot/types/td_types/bound_methods/callback_query.py +0 -0
  35. {pytdbot-0.9.2.dev4 → pytdbot-0.9.3}/pytdbot/utils/__init__.py +0 -0
  36. {pytdbot-0.9.2.dev4 → pytdbot-0.9.3}/pytdbot/utils/asyncio_utils.py +0 -0
  37. {pytdbot-0.9.2.dev4 → pytdbot-0.9.3}/pytdbot/utils/escape.py +0 -0
  38. {pytdbot-0.9.2.dev4 → pytdbot-0.9.3}/pytdbot/utils/json_utils.py +0 -0
  39. {pytdbot-0.9.2.dev4 → pytdbot-0.9.3}/pytdbot/utils/obj_encoder.py +1 -1
  40. {pytdbot-0.9.2.dev4 → pytdbot-0.9.3}/pytdbot/utils/strings.py +0 -0
  41. {pytdbot-0.9.2.dev4 → pytdbot-0.9.3}/pytdbot/utils/webapps.py +0 -0
  42. {pytdbot-0.9.2.dev4 → pytdbot-0.9.3}/requirements.txt +0 -0
  43. {pytdbot-0.9.2.dev4 → pytdbot-0.9.3}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: Pytdbot
3
- Version: 0.9.2.dev4
3
+ Version: 0.9.3
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 [![Version](https://img.shields.io/pypi/v/Pytdbot?style=flat&logo=pypi)](https://pypi.org/project/Pytdbot) [![TDLib version](https://img.shields.io/badge/TDLib-v1.8.47-blue?logo=telegram)](https://github.com/tdlib/td) [![Downloads](https://static.pepy.tech/personalized-badge/pytdbot?period=month&units=none&left_color=grey&right_color=brightgreen&left_text=Downloads)](https://pepy.tech/project/pytdbot) [![Telegram Chat](https://img.shields.io/badge/Pytdbot%20chat-blue?logo=telegram&label=Telegram)](https://t.me/pytdbotchat)
33
+ # Pytdbot [![Version](https://img.shields.io/pypi/v/Pytdbot?style=flat&logo=pypi)](https://pypi.org/project/Pytdbot) [![TDLib version](https://img.shields.io/badge/TDLib-v1.8.49-blue?logo=telegram)](https://github.com/tdlib/td) [![Downloads](https://static.pepy.tech/personalized-badge/pytdbot?period=month&units=none&left_color=grey&right_color=brightgreen&left_text=Downloads)](https://pepy.tech/project/pytdbot) [![Telegram Chat](https://img.shields.io/badge/Pytdbot%20chat-blue?logo=telegram&label=Telegram)](https://t.me/pytdbotchat)
34
34
 
35
35
  Pytdbot (Python TDLib) is an asynchronous [**TDLib**](https://github.com/tdlib/td) wrapper for **Telegram** users/bots written in **Python**.
36
36
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: Pytdbot
3
- Version: 0.9.2.dev4
3
+ Version: 0.9.3
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 [![Version](https://img.shields.io/pypi/v/Pytdbot?style=flat&logo=pypi)](https://pypi.org/project/Pytdbot) [![TDLib version](https://img.shields.io/badge/TDLib-v1.8.47-blue?logo=telegram)](https://github.com/tdlib/td) [![Downloads](https://static.pepy.tech/personalized-badge/pytdbot?period=month&units=none&left_color=grey&right_color=brightgreen&left_text=Downloads)](https://pepy.tech/project/pytdbot) [![Telegram Chat](https://img.shields.io/badge/Pytdbot%20chat-blue?logo=telegram&label=Telegram)](https://t.me/pytdbotchat)
33
+ # Pytdbot [![Version](https://img.shields.io/pypi/v/Pytdbot?style=flat&logo=pypi)](https://pypi.org/project/Pytdbot) [![TDLib version](https://img.shields.io/badge/TDLib-v1.8.49-blue?logo=telegram)](https://github.com/tdlib/td) [![Downloads](https://static.pepy.tech/personalized-badge/pytdbot?period=month&units=none&left_color=grey&right_color=brightgreen&left_text=Downloads)](https://pepy.tech/project/pytdbot) [![Telegram Chat](https://img.shields.io/badge/Pytdbot%20chat-blue?logo=telegram&label=Telegram)](https://t.me/pytdbotchat)
34
34
 
35
35
  Pytdbot (Python TDLib) is an asynchronous [**TDLib**](https://github.com/tdlib/td) wrapper for **Telegram** users/bots written in **Python**.
36
36
 
@@ -1,4 +1,4 @@
1
- # Pytdbot [![Version](https://img.shields.io/pypi/v/Pytdbot?style=flat&logo=pypi)](https://pypi.org/project/Pytdbot) [![TDLib version](https://img.shields.io/badge/TDLib-v1.8.47-blue?logo=telegram)](https://github.com/tdlib/td) [![Downloads](https://static.pepy.tech/personalized-badge/pytdbot?period=month&units=none&left_color=grey&right_color=brightgreen&left_text=Downloads)](https://pepy.tech/project/pytdbot) [![Telegram Chat](https://img.shields.io/badge/Pytdbot%20chat-blue?logo=telegram&label=Telegram)](https://t.me/pytdbotchat)
1
+ # Pytdbot [![Version](https://img.shields.io/pypi/v/Pytdbot?style=flat&logo=pypi)](https://pypi.org/project/Pytdbot) [![TDLib version](https://img.shields.io/badge/TDLib-v1.8.49-blue?logo=telegram)](https://github.com/tdlib/td) [![Downloads](https://static.pepy.tech/personalized-badge/pytdbot?period=month&units=none&left_color=grey&right_color=brightgreen&left_text=Downloads)](https://pepy.tech/project/pytdbot) [![Telegram Chat](https://img.shields.io/badge/Pytdbot%20chat-blue?logo=telegram&label=Telegram)](https://t.me/pytdbotchat)
2
2
 
3
3
  Pytdbot (Python TDLib) is an asynchronous [**TDLib**](https://github.com/tdlib/td) wrapper for **Telegram** users/bots written in **Python**.
4
4
 
@@ -13,7 +13,7 @@ __all__ = [
13
13
  "Client",
14
14
  ]
15
15
 
16
- __version__ = "0.9.2.dev4"
16
+ __version__ = "0.9.3"
17
17
  __copyright__ = "Copyright (c) 2022-2025 Pytdbot, AYMENJD"
18
18
  __license__ = "MIT License"
19
19
 
@@ -79,7 +79,7 @@ class ClientManager:
79
79
  self.__pending_clients = None
80
80
 
81
81
  async def add_client(
82
- self, client: pytdbot.Client, start_client: bool = False
82
+ self, client: "pytdbot.Client", start_client: bool = False
83
83
  ) -> None:
84
84
  """Add a client to the manager
85
85
 
@@ -189,7 +189,7 @@ class ClientManager:
189
189
  await self.delete_client(client_id, close_client=True)
190
190
 
191
191
  # Send dummy request to wake up receiver
192
- self.send(1, {"@type": "getOption", "name": "version"})
192
+ self.send(0, {"@type": "getOption", "name": "version"})
193
193
 
194
194
  await self.__receiver_task
195
195
 
@@ -1,8 +1,9 @@
1
1
  import logging
2
+ from asyncio import iscoroutinefunction
3
+ from typing import Callable
4
+
2
5
  import pytdbot
3
6
 
4
- from typing import Callable
5
- from asyncio import iscoroutinefunction
6
7
  from .handler import Handler
7
8
  from .td_updates import Updates
8
9
 
@@ -1,7 +1,9 @@
1
1
  from typing import Callable
2
- from ..filters import Filter
2
+
3
3
  import pytdbot
4
4
 
5
+ from ..filters import Filter
6
+
5
7
 
6
8
  class Handler:
7
9
  r"""A handler class."""
@@ -3256,6 +3256,86 @@ class Updates:
3256
3256
 
3257
3257
  return decorator
3258
3258
 
3259
+ def on_updateGroupCallParticipants(
3260
+ self: "pytdbot.Client" = None,
3261
+ filters: "pytdbot.filters.Filter" = None,
3262
+ position: int = None,
3263
+ ) -> Callable:
3264
+ r"""The list of group call participants that can send and receive encrypted call data has changed; for group calls not bound to a chat only
3265
+
3266
+ Parameters:
3267
+ filters (:class:`pytdbot.filters.Filter`, *optional*):
3268
+ An update filter
3269
+
3270
+ position (``int``, *optional*):
3271
+ The function position in handlers list. Default is ``None`` (append)
3272
+
3273
+ Raises:
3274
+ :py:class:`TypeError`
3275
+ """
3276
+
3277
+ def decorator(func: Callable) -> Callable:
3278
+ if hasattr(func, "_handler"):
3279
+ return func
3280
+ elif isinstance(self, pytdbot.Client):
3281
+ if iscoroutinefunction(func):
3282
+ self.add_handler(
3283
+ "updateGroupCallParticipants", func, filters, position
3284
+ )
3285
+ else:
3286
+ raise TypeError("Handler must be async")
3287
+ elif isinstance(self, pytdbot.filters.Filter):
3288
+ func._handler = Handler(
3289
+ func, "updateGroupCallParticipants", self, position
3290
+ )
3291
+ else:
3292
+ func._handler = Handler(
3293
+ func, "updateGroupCallParticipants", filters, position
3294
+ )
3295
+ return func
3296
+
3297
+ return decorator
3298
+
3299
+ def on_updateGroupCallVerificationState(
3300
+ self: "pytdbot.Client" = None,
3301
+ filters: "pytdbot.filters.Filter" = None,
3302
+ position: int = None,
3303
+ ) -> Callable:
3304
+ r"""The verification state of an encrypted group call has changed; for group calls not bound to a chat only
3305
+
3306
+ Parameters:
3307
+ filters (:class:`pytdbot.filters.Filter`, *optional*):
3308
+ An update filter
3309
+
3310
+ position (``int``, *optional*):
3311
+ The function position in handlers list. Default is ``None`` (append)
3312
+
3313
+ Raises:
3314
+ :py:class:`TypeError`
3315
+ """
3316
+
3317
+ def decorator(func: Callable) -> Callable:
3318
+ if hasattr(func, "_handler"):
3319
+ return func
3320
+ elif isinstance(self, pytdbot.Client):
3321
+ if iscoroutinefunction(func):
3322
+ self.add_handler(
3323
+ "updateGroupCallVerificationState", func, filters, position
3324
+ )
3325
+ else:
3326
+ raise TypeError("Handler must be async")
3327
+ elif isinstance(self, pytdbot.filters.Filter):
3328
+ func._handler = Handler(
3329
+ func, "updateGroupCallVerificationState", self, position
3330
+ )
3331
+ else:
3332
+ func._handler = Handler(
3333
+ func, "updateGroupCallVerificationState", filters, position
3334
+ )
3335
+ return func
3336
+
3337
+ return decorator
3338
+
3259
3339
  def on_updateNewCallSignalingData(
3260
3340
  self: "pytdbot.Client" = None,
3261
3341
  filters: "pytdbot.filters.Filter" = None,
@@ -3480,12 +3560,12 @@ class Updates:
3480
3560
 
3481
3561
  return decorator
3482
3562
 
3483
- def on_updateStorySendSucceeded(
3563
+ def on_updateStoryPostSucceeded(
3484
3564
  self: "pytdbot.Client" = None,
3485
3565
  filters: "pytdbot.filters.Filter" = None,
3486
3566
  position: int = None,
3487
3567
  ) -> Callable:
3488
- r"""A story has been successfully sent
3568
+ r"""A story has been successfully posted
3489
3569
 
3490
3570
  Parameters:
3491
3571
  filters (:class:`pytdbot.filters.Filter`, *optional*):
@@ -3504,28 +3584,28 @@ class Updates:
3504
3584
  elif isinstance(self, pytdbot.Client):
3505
3585
  if iscoroutinefunction(func):
3506
3586
  self.add_handler(
3507
- "updateStorySendSucceeded", func, filters, position
3587
+ "updateStoryPostSucceeded", func, filters, position
3508
3588
  )
3509
3589
  else:
3510
3590
  raise TypeError("Handler must be async")
3511
3591
  elif isinstance(self, pytdbot.filters.Filter):
3512
3592
  func._handler = Handler(
3513
- func, "updateStorySendSucceeded", self, position
3593
+ func, "updateStoryPostSucceeded", self, position
3514
3594
  )
3515
3595
  else:
3516
3596
  func._handler = Handler(
3517
- func, "updateStorySendSucceeded", filters, position
3597
+ func, "updateStoryPostSucceeded", filters, position
3518
3598
  )
3519
3599
  return func
3520
3600
 
3521
3601
  return decorator
3522
3602
 
3523
- def on_updateStorySendFailed(
3603
+ def on_updateStoryPostFailed(
3524
3604
  self: "pytdbot.Client" = None,
3525
3605
  filters: "pytdbot.filters.Filter" = None,
3526
3606
  position: int = None,
3527
3607
  ) -> Callable:
3528
- r"""A story failed to send\. If the story sending is canceled, then updateStoryDeleted will be received instead of this update
3608
+ r"""A story failed to post\. If the story posting is canceled, then updateStoryDeleted will be received instead of this update
3529
3609
 
3530
3610
  Parameters:
3531
3611
  filters (:class:`pytdbot.filters.Filter`, *optional*):
@@ -3543,14 +3623,14 @@ class Updates:
3543
3623
  return func
3544
3624
  elif isinstance(self, pytdbot.Client):
3545
3625
  if iscoroutinefunction(func):
3546
- self.add_handler("updateStorySendFailed", func, filters, position)
3626
+ self.add_handler("updateStoryPostFailed", func, filters, position)
3547
3627
  else:
3548
3628
  raise TypeError("Handler must be async")
3549
3629
  elif isinstance(self, pytdbot.filters.Filter):
3550
- func._handler = Handler(func, "updateStorySendFailed", self, position)
3630
+ func._handler = Handler(func, "updateStoryPostFailed", self, position)
3551
3631
  else:
3552
3632
  func._handler = Handler(
3553
- func, "updateStorySendFailed", filters, position
3633
+ func, "updateStoryPostFailed", filters, position
3554
3634
  )
3555
3635
  return func
3556
3636
 
@@ -1,7 +1,7 @@
1
- import pytdbot
2
-
3
1
  from typing import List, Union
4
2
 
3
+ import pytdbot
4
+
5
5
  from ..types import (
6
6
  ChatTypeSupergroup,
7
7
  Error,
@@ -37,7 +37,6 @@ from ..types import (
37
37
  TextParseModeHTML,
38
38
  TextParseModeMarkdown,
39
39
  )
40
-
41
40
  from .td_functions import TDLibFunctions
42
41
 
43
42