Pytdbot 0.8.6.dev0__tar.gz → 0.8.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.
- {Pytdbot-0.8.6.dev0 → Pytdbot-0.8.8}/PKG-INFO +3 -3
- {Pytdbot-0.8.6.dev0 → Pytdbot-0.8.8}/Pytdbot.egg-info/PKG-INFO +3 -3
- {Pytdbot-0.8.6.dev0 → Pytdbot-0.8.8}/README.md +2 -2
- {Pytdbot-0.8.6.dev0 → Pytdbot-0.8.8}/pytdbot/__init__.py +1 -1
- {Pytdbot-0.8.6.dev0 → Pytdbot-0.8.8}/pytdbot/client.py +7 -23
- {Pytdbot-0.8.6.dev0 → Pytdbot-0.8.8}/pytdbot/exception/__init__.py +1 -1
- {Pytdbot-0.8.6.dev0 → Pytdbot-0.8.8}/pytdbot/handlers/updates.py +1420 -388
- {Pytdbot-0.8.6.dev0 → Pytdbot-0.8.8}/pytdbot/methods/methods.py +145 -50
- {Pytdbot-0.8.6.dev0 → Pytdbot-0.8.8}/pytdbot/methods/tdlibfunctions.py +6513 -3899
- {Pytdbot-0.8.6.dev0 → Pytdbot-0.8.8}/pytdbot/td_api.json +13570 -7686
- {Pytdbot-0.8.6.dev0 → Pytdbot-0.8.8}/pytdbot/td_api.tl +2672 -794
- {Pytdbot-0.8.6.dev0 → Pytdbot-0.8.8}/pytdbot/types/update/update.py +112 -31
- {Pytdbot-0.8.6.dev0 → Pytdbot-0.8.8}/LICENSE +0 -0
- {Pytdbot-0.8.6.dev0 → Pytdbot-0.8.8}/MANIFEST.in +0 -0
- {Pytdbot-0.8.6.dev0 → Pytdbot-0.8.8}/Pytdbot.egg-info/SOURCES.txt +0 -0
- {Pytdbot-0.8.6.dev0 → Pytdbot-0.8.8}/Pytdbot.egg-info/dependency_links.txt +0 -0
- {Pytdbot-0.8.6.dev0 → Pytdbot-0.8.8}/Pytdbot.egg-info/requires.txt +0 -0
- {Pytdbot-0.8.6.dev0 → Pytdbot-0.8.8}/Pytdbot.egg-info/top_level.txt +0 -0
- {Pytdbot-0.8.6.dev0 → Pytdbot-0.8.8}/pytdbot/filters.py +0 -0
- {Pytdbot-0.8.6.dev0 → Pytdbot-0.8.8}/pytdbot/generate_files.py +0 -0
- {Pytdbot-0.8.6.dev0 → Pytdbot-0.8.8}/pytdbot/generate_json.py +0 -0
- {Pytdbot-0.8.6.dev0 → Pytdbot-0.8.8}/pytdbot/handlers/__init__.py +0 -0
- {Pytdbot-0.8.6.dev0 → Pytdbot-0.8.8}/pytdbot/handlers/decorators.py +0 -0
- {Pytdbot-0.8.6.dev0 → Pytdbot-0.8.8}/pytdbot/handlers/handler.py +0 -0
- {Pytdbot-0.8.6.dev0 → Pytdbot-0.8.8}/pytdbot/methods/__init__.py +0 -0
- {Pytdbot-0.8.6.dev0 → Pytdbot-0.8.8}/pytdbot/tdjson/__init__.py +0 -0
- {Pytdbot-0.8.6.dev0 → Pytdbot-0.8.8}/pytdbot/tdjson/tdjson.py +0 -0
- {Pytdbot-0.8.6.dev0 → Pytdbot-0.8.8}/pytdbot/types/__init__.py +0 -0
- {Pytdbot-0.8.6.dev0 → Pytdbot-0.8.8}/pytdbot/types/buttons/__init__.py +0 -0
- {Pytdbot-0.8.6.dev0 → Pytdbot-0.8.8}/pytdbot/types/buttons/base.py +0 -0
- {Pytdbot-0.8.6.dev0 → Pytdbot-0.8.8}/pytdbot/types/buttons/force_reply.py +0 -0
- {Pytdbot-0.8.6.dev0 → Pytdbot-0.8.8}/pytdbot/types/buttons/inline_keyboard.py +0 -0
- {Pytdbot-0.8.6.dev0 → Pytdbot-0.8.8}/pytdbot/types/buttons/remove_keyboard.py +0 -0
- {Pytdbot-0.8.6.dev0 → Pytdbot-0.8.8}/pytdbot/types/buttons/show_keyboard.py +0 -0
- {Pytdbot-0.8.6.dev0 → Pytdbot-0.8.8}/pytdbot/types/inputfile/__init__.py +0 -0
- {Pytdbot-0.8.6.dev0 → Pytdbot-0.8.8}/pytdbot/types/inputfile/base.py +0 -0
- {Pytdbot-0.8.6.dev0 → Pytdbot-0.8.8}/pytdbot/types/inputfile/input_file_generated.py +0 -0
- {Pytdbot-0.8.6.dev0 → Pytdbot-0.8.8}/pytdbot/types/inputfile/input_file_id.py +0 -0
- {Pytdbot-0.8.6.dev0 → Pytdbot-0.8.8}/pytdbot/types/inputfile/input_file_local.py +0 -0
- {Pytdbot-0.8.6.dev0 → Pytdbot-0.8.8}/pytdbot/types/inputfile/input_file_remote.py +0 -0
- {Pytdbot-0.8.6.dev0 → Pytdbot-0.8.8}/pytdbot/types/inputfile/input_thumbnail.py +0 -0
- {Pytdbot-0.8.6.dev0 → Pytdbot-0.8.8}/pytdbot/types/logstream/__init__.py +0 -0
- {Pytdbot-0.8.6.dev0 → Pytdbot-0.8.8}/pytdbot/types/logstream/base.py +0 -0
- {Pytdbot-0.8.6.dev0 → Pytdbot-0.8.8}/pytdbot/types/logstream/log_stream_default.py +0 -0
- {Pytdbot-0.8.6.dev0 → Pytdbot-0.8.8}/pytdbot/types/logstream/log_stream_empty.py +0 -0
- {Pytdbot-0.8.6.dev0 → Pytdbot-0.8.8}/pytdbot/types/logstream/log_stream_file.py +0 -0
- {Pytdbot-0.8.6.dev0 → Pytdbot-0.8.8}/pytdbot/types/plugins/__init__.py +0 -0
- {Pytdbot-0.8.6.dev0 → Pytdbot-0.8.8}/pytdbot/types/result/__init__.py +0 -0
- {Pytdbot-0.8.6.dev0 → Pytdbot-0.8.8}/pytdbot/types/result/result.py +0 -0
- {Pytdbot-0.8.6.dev0 → Pytdbot-0.8.8}/pytdbot/types/update/__init__.py +0 -0
- {Pytdbot-0.8.6.dev0 → Pytdbot-0.8.8}/pytdbot/types/update/chatActions.py +0 -0
- {Pytdbot-0.8.6.dev0 → Pytdbot-0.8.8}/pytdbot/utils/__init__.py +0 -0
- {Pytdbot-0.8.6.dev0 → Pytdbot-0.8.8}/pytdbot/utils/escape.py +0 -0
- {Pytdbot-0.8.6.dev0 → Pytdbot-0.8.8}/pytdbot/utils/text_format.py +0 -0
- {Pytdbot-0.8.6.dev0 → Pytdbot-0.8.8}/requirements.txt +0 -0
- {Pytdbot-0.8.6.dev0 → Pytdbot-0.8.8}/setup.cfg +0 -0
- {Pytdbot-0.8.6.dev0 → Pytdbot-0.8.8}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: Pytdbot
|
|
3
|
-
Version: 0.8.
|
|
3
|
+
Version: 0.8.8
|
|
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
|
|
@@ -14,7 +14,7 @@ Requires-Python: >=3.9
|
|
|
14
14
|
Description-Content-Type: text/markdown
|
|
15
15
|
License-File: LICENSE
|
|
16
16
|
|
|
17
|
-
# Pytdbot [](https://pypi.org/project/Pytdbot) [](https://pypi.org/project/Pytdbot) [](https://github.com/tdlib/td) [](https://pepy.tech/project/pytdbot)
|
|
18
18
|
|
|
19
19
|
Pytdbot (Python TDLib) is an asynchronous [**TDLib**](https://github.com/tdlib/td) wrapper for **Telegram** users/bots written in **Python**.
|
|
20
20
|
|
|
@@ -58,7 +58,7 @@ client = Client(
|
|
|
58
58
|
database_encryption_key="1234echobot$",
|
|
59
59
|
token="1088394097:AAQX2DnWiw4ihwiJUhIHOGog8gGOI", # Your bot token or phone number if you want to login as user
|
|
60
60
|
files_directory="BotDB", # Path where to store TDLib files
|
|
61
|
-
lib_path="/path/to/libtdjson.so" # Path to TDjson shared library
|
|
61
|
+
lib_path="/path/to/libtdjson.so", # Path to TDjson shared library
|
|
62
62
|
td_log=LogStreamFile("tdlib.log"), # Set TDLib log file path
|
|
63
63
|
td_verbosity=2, # TDLib verbosity level
|
|
64
64
|
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: Pytdbot
|
|
3
|
-
Version: 0.8.
|
|
3
|
+
Version: 0.8.8
|
|
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
|
|
@@ -14,7 +14,7 @@ Requires-Python: >=3.9
|
|
|
14
14
|
Description-Content-Type: text/markdown
|
|
15
15
|
License-File: LICENSE
|
|
16
16
|
|
|
17
|
-
# Pytdbot [](https://pypi.org/project/Pytdbot) [](https://pypi.org/project/Pytdbot) [](https://github.com/tdlib/td) [](https://pepy.tech/project/pytdbot)
|
|
18
18
|
|
|
19
19
|
Pytdbot (Python TDLib) is an asynchronous [**TDLib**](https://github.com/tdlib/td) wrapper for **Telegram** users/bots written in **Python**.
|
|
20
20
|
|
|
@@ -58,7 +58,7 @@ client = Client(
|
|
|
58
58
|
database_encryption_key="1234echobot$",
|
|
59
59
|
token="1088394097:AAQX2DnWiw4ihwiJUhIHOGog8gGOI", # Your bot token or phone number if you want to login as user
|
|
60
60
|
files_directory="BotDB", # Path where to store TDLib files
|
|
61
|
-
lib_path="/path/to/libtdjson.so" # Path to TDjson shared library
|
|
61
|
+
lib_path="/path/to/libtdjson.so", # Path to TDjson shared library
|
|
62
62
|
td_log=LogStreamFile("tdlib.log"), # Set TDLib log file path
|
|
63
63
|
td_verbosity=2, # TDLib verbosity level
|
|
64
64
|
)
|
|
@@ -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)
|
|
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
|
|
|
@@ -42,7 +42,7 @@ client = Client(
|
|
|
42
42
|
database_encryption_key="1234echobot$",
|
|
43
43
|
token="1088394097:AAQX2DnWiw4ihwiJUhIHOGog8gGOI", # Your bot token or phone number if you want to login as user
|
|
44
44
|
files_directory="BotDB", # Path where to store TDLib files
|
|
45
|
-
lib_path="/path/to/libtdjson.so" # Path to TDjson shared library
|
|
45
|
+
lib_path="/path/to/libtdjson.so", # Path to TDjson shared library
|
|
46
46
|
td_log=LogStreamFile("tdlib.log"), # Set TDLib log file path
|
|
47
47
|
td_verbosity=2, # TDLib verbosity level
|
|
48
48
|
)
|
|
@@ -2,7 +2,7 @@ from . import types, utils, filters, exception
|
|
|
2
2
|
from .tdjson import TdJson
|
|
3
3
|
from .client import Client
|
|
4
4
|
|
|
5
|
-
__version__ = "0.8.
|
|
5
|
+
__version__ = "0.8.8"
|
|
6
6
|
__copyright__ = "Copyright (c) 2022-2023 AYMEN Mohammed ~ https://github.com/AYMENJD"
|
|
7
7
|
__license__ = "MIT License"
|
|
8
8
|
|
|
@@ -77,12 +77,6 @@ class Client(Decorators, Methods):
|
|
|
77
77
|
use_message_database (``bool``, *optional*):
|
|
78
78
|
If set to true, the library will maintain a cache of chats and messages. Implies use_chat_info_database. Default is ``True``
|
|
79
79
|
|
|
80
|
-
enable_storage_optimizer (``bool``, *optional*):
|
|
81
|
-
If set to true, old files will automatically be deleted. Default is ``True``
|
|
82
|
-
|
|
83
|
-
ignore_file_names (``bool``, *optional*):
|
|
84
|
-
If set to true, original file names will be ignored. Otherwise, downloaded files will be saved under names as close as possible to the original name. Default is ``False``
|
|
85
|
-
|
|
86
80
|
loop (:py:class:`asyncio.AbstractEventLoop`, *optional*):
|
|
87
81
|
Event loop. Default is ``None`` (auto-detect)
|
|
88
82
|
|
|
@@ -120,8 +114,6 @@ class Client(Decorators, Methods):
|
|
|
120
114
|
use_file_database: bool = True,
|
|
121
115
|
use_chat_info_database: bool = True,
|
|
122
116
|
use_message_database: bool = True,
|
|
123
|
-
enable_storage_optimizer: bool = True,
|
|
124
|
-
ignore_file_names: bool = False,
|
|
125
117
|
loop: asyncio.AbstractEventLoop = None,
|
|
126
118
|
options: dict = None,
|
|
127
119
|
sleep_threshold: int = None,
|
|
@@ -149,8 +141,6 @@ class Client(Decorators, Methods):
|
|
|
149
141
|
self.use_file_database = use_file_database
|
|
150
142
|
self.use_chat_info_database = use_chat_info_database
|
|
151
143
|
self.use_message_database = use_message_database
|
|
152
|
-
self.enable_storage_optimizer = enable_storage_optimizer
|
|
153
|
-
self.ignore_file_names = ignore_file_names
|
|
154
144
|
self.td_options = options
|
|
155
145
|
self.sleep_threshold = (
|
|
156
146
|
sleep_threshold if isinstance(sleep_threshold, int) else 0
|
|
@@ -632,7 +622,9 @@ class Client(Decorators, Methods):
|
|
|
632
622
|
|
|
633
623
|
while self.is_running:
|
|
634
624
|
update = await self.loop.run_in_executor(
|
|
635
|
-
thread,
|
|
625
|
+
thread,
|
|
626
|
+
self._tdjson.receive,
|
|
627
|
+
100000.0, # Seconds
|
|
636
628
|
)
|
|
637
629
|
if update is None:
|
|
638
630
|
continue
|
|
@@ -753,7 +745,7 @@ class Client(Decorators, Methods):
|
|
|
753
745
|
except Exception:
|
|
754
746
|
logger.exception("Got worker exception")
|
|
755
747
|
|
|
756
|
-
async def
|
|
748
|
+
async def set_td_parameters(self):
|
|
757
749
|
"""Make a call to :meth:`~pytdbot.Client.setTdlibParameters` with the current client init parameters
|
|
758
750
|
|
|
759
751
|
Raises:
|
|
@@ -775,8 +767,6 @@ class Client(Decorators, Methods):
|
|
|
775
767
|
use_message_database=self.use_message_database,
|
|
776
768
|
use_secret_chats=False,
|
|
777
769
|
system_version=None,
|
|
778
|
-
enable_storage_optimizer=self.enable_storage_optimizer,
|
|
779
|
-
ignore_file_names=self.ignore_file_names,
|
|
780
770
|
files_directory=self.files_directory,
|
|
781
771
|
database_encryption_key=b64encode(self.__database_encryption_key).decode(
|
|
782
772
|
"utf-8"
|
|
@@ -831,7 +821,7 @@ class Client(Decorators, Methods):
|
|
|
831
821
|
if self.__login:
|
|
832
822
|
if self.authorization_state == "authorizationStateWaitTdlibParameters":
|
|
833
823
|
await self._set_options()
|
|
834
|
-
await self.
|
|
824
|
+
await self.set_td_parameters()
|
|
835
825
|
elif self.authorization_state == "authorizationStateWaitPhoneNumber":
|
|
836
826
|
self._print_welcome()
|
|
837
827
|
await self.__handle_authorization_state_wait_phone_number()
|
|
@@ -872,7 +862,7 @@ class Client(Decorators, Methods):
|
|
|
872
862
|
m_id = f'{update["old_message_id"]}{update["message"]["chat_id"]}'
|
|
873
863
|
|
|
874
864
|
if m_id in self._results:
|
|
875
|
-
if update["
|
|
865
|
+
if update["error"]["code"] == 429:
|
|
876
866
|
retry_after = update["message"]["sending_state"]["retry_after"]
|
|
877
867
|
|
|
878
868
|
if retry_after <= self.sleep_threshold:
|
|
@@ -890,13 +880,7 @@ class Client(Decorators, Methods):
|
|
|
890
880
|
] = result
|
|
891
881
|
else:
|
|
892
882
|
result: Result = self._results.pop(m_id)
|
|
893
|
-
result.set_result(
|
|
894
|
-
{
|
|
895
|
-
"@type": "error",
|
|
896
|
-
"code": update["error_code"],
|
|
897
|
-
"message": update["error_message"],
|
|
898
|
-
}
|
|
899
|
-
)
|
|
883
|
+
result.set_result(update["error"])
|
|
900
884
|
|
|
901
885
|
async def __handle_update_option(self, update):
|
|
902
886
|
if update["value"]["@type"] == "optionValueBoolean":
|