Pytdbot 0.9.1__tar.gz → 0.9.2.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.
Files changed (41) hide show
  1. {pytdbot-0.9.1 → pytdbot-0.9.2.dev0}/PKG-INFO +1 -1
  2. {pytdbot-0.9.1 → pytdbot-0.9.2.dev0}/Pytdbot.egg-info/PKG-INFO +1 -1
  3. {pytdbot-0.9.1 → pytdbot-0.9.2.dev0}/pytdbot/__init__.py +1 -1
  4. {pytdbot-0.9.1 → pytdbot-0.9.2.dev0}/pytdbot/client.py +18 -2
  5. {pytdbot-0.9.1 → pytdbot-0.9.2.dev0}/pytdbot/types/td_types/bound_methods/message.py +2 -2
  6. {pytdbot-0.9.1 → pytdbot-0.9.2.dev0}/LICENSE +0 -0
  7. {pytdbot-0.9.1 → pytdbot-0.9.2.dev0}/MANIFEST.in +0 -0
  8. {pytdbot-0.9.1 → pytdbot-0.9.2.dev0}/Pytdbot.egg-info/SOURCES.txt +0 -0
  9. {pytdbot-0.9.1 → pytdbot-0.9.2.dev0}/Pytdbot.egg-info/dependency_links.txt +0 -0
  10. {pytdbot-0.9.1 → pytdbot-0.9.2.dev0}/Pytdbot.egg-info/requires.txt +0 -0
  11. {pytdbot-0.9.1 → pytdbot-0.9.2.dev0}/Pytdbot.egg-info/top_level.txt +0 -0
  12. {pytdbot-0.9.1 → pytdbot-0.9.2.dev0}/README.md +0 -0
  13. {pytdbot-0.9.1 → pytdbot-0.9.2.dev0}/pytdbot/exception/__init__.py +0 -0
  14. {pytdbot-0.9.1 → pytdbot-0.9.2.dev0}/pytdbot/filters.py +0 -0
  15. {pytdbot-0.9.1 → pytdbot-0.9.2.dev0}/pytdbot/handlers/__init__.py +0 -0
  16. {pytdbot-0.9.1 → pytdbot-0.9.2.dev0}/pytdbot/handlers/decorators.py +0 -0
  17. {pytdbot-0.9.1 → pytdbot-0.9.2.dev0}/pytdbot/handlers/handler.py +0 -0
  18. {pytdbot-0.9.1 → pytdbot-0.9.2.dev0}/pytdbot/handlers/td_updates.py +0 -0
  19. {pytdbot-0.9.1 → pytdbot-0.9.2.dev0}/pytdbot/methods/__init__.py +0 -0
  20. {pytdbot-0.9.1 → pytdbot-0.9.2.dev0}/pytdbot/methods/methods.py +0 -0
  21. {pytdbot-0.9.1 → pytdbot-0.9.2.dev0}/pytdbot/methods/td_functions.py +0 -0
  22. {pytdbot-0.9.1 → pytdbot-0.9.2.dev0}/pytdbot/tdjson/__init__.py +0 -0
  23. {pytdbot-0.9.1 → pytdbot-0.9.2.dev0}/pytdbot/tdjson/tdjson.py +0 -0
  24. {pytdbot-0.9.1 → pytdbot-0.9.2.dev0}/pytdbot/types/__init__.py +0 -0
  25. {pytdbot-0.9.1 → pytdbot-0.9.2.dev0}/pytdbot/types/plugins/__init__.py +0 -0
  26. {pytdbot-0.9.1 → pytdbot-0.9.2.dev0}/pytdbot/types/td_types/__init__.py +0 -0
  27. {pytdbot-0.9.1 → pytdbot-0.9.2.dev0}/pytdbot/types/td_types/bound_methods/__init__.py +0 -0
  28. {pytdbot-0.9.1 → pytdbot-0.9.2.dev0}/pytdbot/types/td_types/bound_methods/callback_query.py +0 -0
  29. {pytdbot-0.9.1 → pytdbot-0.9.2.dev0}/pytdbot/types/td_types/bound_methods/chatActions.py +0 -0
  30. {pytdbot-0.9.1 → pytdbot-0.9.2.dev0}/pytdbot/types/td_types/bound_methods/file.py +0 -0
  31. {pytdbot-0.9.1 → pytdbot-0.9.2.dev0}/pytdbot/types/td_types/types.py +0 -0
  32. {pytdbot-0.9.1 → pytdbot-0.9.2.dev0}/pytdbot/utils/__init__.py +0 -0
  33. {pytdbot-0.9.1 → pytdbot-0.9.2.dev0}/pytdbot/utils/escape.py +0 -0
  34. {pytdbot-0.9.1 → pytdbot-0.9.2.dev0}/pytdbot/utils/json_utils.py +0 -0
  35. {pytdbot-0.9.1 → pytdbot-0.9.2.dev0}/pytdbot/utils/obj_encoder.py +0 -0
  36. {pytdbot-0.9.1 → pytdbot-0.9.2.dev0}/pytdbot/utils/strings.py +0 -0
  37. {pytdbot-0.9.1 → pytdbot-0.9.2.dev0}/pytdbot/utils/text_format.py +0 -0
  38. {pytdbot-0.9.1 → pytdbot-0.9.2.dev0}/pytdbot/utils/webapps.py +0 -0
  39. {pytdbot-0.9.1 → pytdbot-0.9.2.dev0}/requirements.txt +0 -0
  40. {pytdbot-0.9.1 → pytdbot-0.9.2.dev0}/setup.cfg +0 -0
  41. {pytdbot-0.9.1 → pytdbot-0.9.2.dev0}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: Pytdbot
3
- Version: 0.9.1
3
+ Version: 0.9.2.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
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: Pytdbot
3
- Version: 0.9.1
3
+ Version: 0.9.2.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
@@ -4,7 +4,7 @@ from .client import Client
4
4
 
5
5
  __all__ = ["types", "utils", "filters", "exception", "TdJson", "Client"]
6
6
 
7
- __version__ = "0.9.1"
7
+ __version__ = "0.9.2.dev0"
8
8
  __copyright__ = "Copyright (c) 2022-2025 Pytdbot, AYMENJD"
9
9
  __license__ = "MIT License"
10
10
 
@@ -136,6 +136,7 @@ class Client(Decorators, Methods):
136
136
  no_updates: bool = False,
137
137
  td_verbosity: int = 2,
138
138
  td_log: LogStream = None,
139
+ user_bot: bool = False,
139
140
  ) -> None:
140
141
  self.__api_id = api_id
141
142
  self.__api_hash = api_hash
@@ -164,7 +165,12 @@ class Client(Decorators, Methods):
164
165
  self.workers = workers
165
166
  self.no_updates = no_updates
166
167
  self.queue = asyncio.Queue()
167
- self.my_id = get_bot_id_from_token(self.__token)
168
+ self.user_bot = user_bot
169
+ self.my_id = (
170
+ get_bot_id_from_token(self.__token)
171
+ if isinstance(self.__token, str)
172
+ else None
173
+ )
168
174
  self.logger = getLogger(f"{__name__}:{self.my_id or 0}")
169
175
  self.td_verbosity = td_verbosity
170
176
  self.connection_state: str = None
@@ -233,6 +239,9 @@ class Client(Decorators, Methods):
233
239
  Login after start. Default is ``True``
234
240
  """
235
241
 
242
+ if self.user_bot:
243
+ login = False
244
+
236
245
  if not self.is_running:
237
246
  self.logger.info("Starting pytdbot client...")
238
247
 
@@ -259,7 +268,11 @@ class Client(Decorators, Methods):
259
268
  async def login(self) -> None:
260
269
  r"""Login to Telegram."""
261
270
 
262
- if not self.__token or (self.is_authenticated or self.is_rabbitmq):
271
+ if (
272
+ not self.__token
273
+ or self.user_bot
274
+ or (self.is_authenticated or self.is_rabbitmq)
275
+ ):
263
276
  return
264
277
 
265
278
  self.__login = True
@@ -566,6 +579,9 @@ class Client(Decorators, Methods):
566
579
  )
567
580
 
568
581
  def _check_init_args(self):
582
+ if self.user_bot:
583
+ return
584
+
569
585
  if not self.is_rabbitmq:
570
586
  if not isinstance(self.__api_id, int):
571
587
  raise TypeError("api_id must be an int")
@@ -64,7 +64,7 @@ class MessageBoundMethods:
64
64
 
65
65
  @property
66
66
  @lru_cache(1)
67
- def caption_entities(self) -> Union[str, None]:
67
+ def caption_entities(self) -> Union[List["pytdbot.types.TextEntity"], None]:
68
68
  r"""Caption entities of the received media"""
69
69
 
70
70
  if isinstance(
@@ -130,7 +130,7 @@ class MessageBoundMethods:
130
130
 
131
131
  return unique_file_id
132
132
 
133
- async def mention(self, parse_mode: str = "html") -> str:
133
+ async def mention(self, parse_mode: str = "html") -> Union[str, None]:
134
134
  r"""Get the text_mention of the message sender
135
135
 
136
136
  Parameters:
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes