Pytdbot 0.9.1__tar.gz → 0.9.2.dev1__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.1 → pytdbot-0.9.2.dev1}/PKG-INFO +3 -2
- {pytdbot-0.9.1 → pytdbot-0.9.2.dev1}/Pytdbot.egg-info/PKG-INFO +3 -2
- {pytdbot-0.9.1 → pytdbot-0.9.2.dev1}/pytdbot/__init__.py +1 -1
- {pytdbot-0.9.1 → pytdbot-0.9.2.dev1}/pytdbot/client.py +22 -4
- {pytdbot-0.9.1 → pytdbot-0.9.2.dev1}/pytdbot/types/td_types/bound_methods/message.py +2 -2
- {pytdbot-0.9.1 → pytdbot-0.9.2.dev1}/LICENSE +0 -0
- {pytdbot-0.9.1 → pytdbot-0.9.2.dev1}/MANIFEST.in +0 -0
- {pytdbot-0.9.1 → pytdbot-0.9.2.dev1}/Pytdbot.egg-info/SOURCES.txt +0 -0
- {pytdbot-0.9.1 → pytdbot-0.9.2.dev1}/Pytdbot.egg-info/dependency_links.txt +0 -0
- {pytdbot-0.9.1 → pytdbot-0.9.2.dev1}/Pytdbot.egg-info/requires.txt +0 -0
- {pytdbot-0.9.1 → pytdbot-0.9.2.dev1}/Pytdbot.egg-info/top_level.txt +0 -0
- {pytdbot-0.9.1 → pytdbot-0.9.2.dev1}/README.md +0 -0
- {pytdbot-0.9.1 → pytdbot-0.9.2.dev1}/pytdbot/exception/__init__.py +0 -0
- {pytdbot-0.9.1 → pytdbot-0.9.2.dev1}/pytdbot/filters.py +0 -0
- {pytdbot-0.9.1 → pytdbot-0.9.2.dev1}/pytdbot/handlers/__init__.py +0 -0
- {pytdbot-0.9.1 → pytdbot-0.9.2.dev1}/pytdbot/handlers/decorators.py +0 -0
- {pytdbot-0.9.1 → pytdbot-0.9.2.dev1}/pytdbot/handlers/handler.py +0 -0
- {pytdbot-0.9.1 → pytdbot-0.9.2.dev1}/pytdbot/handlers/td_updates.py +0 -0
- {pytdbot-0.9.1 → pytdbot-0.9.2.dev1}/pytdbot/methods/__init__.py +0 -0
- {pytdbot-0.9.1 → pytdbot-0.9.2.dev1}/pytdbot/methods/methods.py +0 -0
- {pytdbot-0.9.1 → pytdbot-0.9.2.dev1}/pytdbot/methods/td_functions.py +0 -0
- {pytdbot-0.9.1 → pytdbot-0.9.2.dev1}/pytdbot/tdjson/__init__.py +0 -0
- {pytdbot-0.9.1 → pytdbot-0.9.2.dev1}/pytdbot/tdjson/tdjson.py +0 -0
- {pytdbot-0.9.1 → pytdbot-0.9.2.dev1}/pytdbot/types/__init__.py +0 -0
- {pytdbot-0.9.1 → pytdbot-0.9.2.dev1}/pytdbot/types/plugins/__init__.py +0 -0
- {pytdbot-0.9.1 → pytdbot-0.9.2.dev1}/pytdbot/types/td_types/__init__.py +0 -0
- {pytdbot-0.9.1 → pytdbot-0.9.2.dev1}/pytdbot/types/td_types/bound_methods/__init__.py +0 -0
- {pytdbot-0.9.1 → pytdbot-0.9.2.dev1}/pytdbot/types/td_types/bound_methods/callback_query.py +0 -0
- {pytdbot-0.9.1 → pytdbot-0.9.2.dev1}/pytdbot/types/td_types/bound_methods/chatActions.py +0 -0
- {pytdbot-0.9.1 → pytdbot-0.9.2.dev1}/pytdbot/types/td_types/bound_methods/file.py +0 -0
- {pytdbot-0.9.1 → pytdbot-0.9.2.dev1}/pytdbot/types/td_types/types.py +0 -0
- {pytdbot-0.9.1 → pytdbot-0.9.2.dev1}/pytdbot/utils/__init__.py +0 -0
- {pytdbot-0.9.1 → pytdbot-0.9.2.dev1}/pytdbot/utils/escape.py +0 -0
- {pytdbot-0.9.1 → pytdbot-0.9.2.dev1}/pytdbot/utils/json_utils.py +0 -0
- {pytdbot-0.9.1 → pytdbot-0.9.2.dev1}/pytdbot/utils/obj_encoder.py +0 -0
- {pytdbot-0.9.1 → pytdbot-0.9.2.dev1}/pytdbot/utils/strings.py +0 -0
- {pytdbot-0.9.1 → pytdbot-0.9.2.dev1}/pytdbot/utils/text_format.py +0 -0
- {pytdbot-0.9.1 → pytdbot-0.9.2.dev1}/pytdbot/utils/webapps.py +0 -0
- {pytdbot-0.9.1 → pytdbot-0.9.2.dev1}/requirements.txt +0 -0
- {pytdbot-0.9.1 → pytdbot-0.9.2.dev1}/setup.cfg +0 -0
- {pytdbot-0.9.1 → pytdbot-0.9.2.dev1}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: Pytdbot
|
|
3
|
-
Version: 0.9.
|
|
3
|
+
Version: 0.9.2.dev1
|
|
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
|
|
@@ -23,6 +23,7 @@ Dynamic: description-content-type
|
|
|
23
23
|
Dynamic: home-page
|
|
24
24
|
Dynamic: keywords
|
|
25
25
|
Dynamic: license
|
|
26
|
+
Dynamic: license-file
|
|
26
27
|
Dynamic: project-url
|
|
27
28
|
Dynamic: provides-extra
|
|
28
29
|
Dynamic: requires-dist
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: Pytdbot
|
|
3
|
-
Version: 0.9.
|
|
3
|
+
Version: 0.9.2.dev1
|
|
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
|
|
@@ -23,6 +23,7 @@ Dynamic: description-content-type
|
|
|
23
23
|
Dynamic: home-page
|
|
24
24
|
Dynamic: keywords
|
|
25
25
|
Dynamic: license
|
|
26
|
+
Dynamic: license-file
|
|
26
27
|
Dynamic: project-url
|
|
27
28
|
Dynamic: provides-extra
|
|
28
29
|
Dynamic: requires-dist
|
|
@@ -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.
|
|
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
|
|
|
@@ -253,19 +262,25 @@ class Client(Decorators, Methods):
|
|
|
253
262
|
else:
|
|
254
263
|
self.__listen_loop_task = self.loop.create_task(self.__listen_loop())
|
|
255
264
|
|
|
265
|
+
self.loop.create_task(
|
|
266
|
+
self.getOption("version")
|
|
267
|
+
) # Ping TDLib to start processing updates
|
|
268
|
+
|
|
256
269
|
if login:
|
|
257
270
|
await self.login()
|
|
258
271
|
|
|
259
272
|
async def login(self) -> None:
|
|
260
273
|
r"""Login to Telegram."""
|
|
261
274
|
|
|
262
|
-
if
|
|
275
|
+
if (
|
|
276
|
+
not self.__token
|
|
277
|
+
or self.user_bot
|
|
278
|
+
or (self.is_authenticated or self.is_rabbitmq)
|
|
279
|
+
):
|
|
263
280
|
return
|
|
264
281
|
|
|
265
282
|
self.__login = True
|
|
266
283
|
|
|
267
|
-
await self.getOption("version") # Ping TDLib to start authorization process
|
|
268
|
-
|
|
269
284
|
while self.authorization_state != "authorizationStateReady":
|
|
270
285
|
await asyncio.sleep(0.1)
|
|
271
286
|
if self.authorization_state == "authorizationStateClosed":
|
|
@@ -566,6 +581,9 @@ class Client(Decorators, Methods):
|
|
|
566
581
|
)
|
|
567
582
|
|
|
568
583
|
def _check_init_args(self):
|
|
584
|
+
if self.user_bot:
|
|
585
|
+
return
|
|
586
|
+
|
|
569
587
|
if not self.is_rabbitmq:
|
|
570
588
|
if not isinstance(self.__api_id, int):
|
|
571
589
|
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[
|
|
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
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|