From 8c27fb7c3736c43f77d97aa8da364ceb2697403b Mon Sep 17 00:00:00 2001 From: Profitroll Date: Thu, 6 Jul 2023 15:21:21 +0300 Subject: [PATCH 1/2] Small fixes (#32) * `bot.max_concurrent_transmissions` reduced to only 1 * Fixed using UnauthorizedClient when not needed Co-authored-by: profitroll Reviewed-on: https://git.end-play.xyz/profitroll/TelegramPoster/pulls/32 --- config_example.json | 2 +- modules/cli.py | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/config_example.json b/config_example.json index 1f9671f..a19ae3c 100644 --- a/config_example.json +++ b/config_example.json @@ -6,7 +6,7 @@ "api_id": 0, "api_hash": "", "bot_token": "", - "max_concurrent_transmissions": 3, + "max_concurrent_transmissions": 1, "scoped_commands": true }, "database": { diff --git a/modules/cli.py b/modules/cli.py index e21ee0e..41dfb82 100644 --- a/modules/cli.py +++ b/modules/cli.py @@ -27,13 +27,14 @@ parser.add_argument("--create-album", action="store_true") args = parser.parse_args() -unauthorized_client = Client( - base_url=sync.config_get("address", "posting", "api"), - timeout=5.0, - verify_ssl=True, - raise_on_unexpected_status=True, - follow_redirects=False, -) +if args.create_user or args.create_album: + unauthorized_client = Client( + base_url=sync.config_get("address", "posting", "api"), + timeout=5.0, + verify_ssl=True, + raise_on_unexpected_status=True, + follow_redirects=False, + ) async def cli_create_user() -> None: -- 2.39.2 From 32e6c4e96f5e089541717434f5482ba5eaa6da97 Mon Sep 17 00:00:00 2001 From: Profitroll Date: Thu, 6 Jul 2023 15:24:46 +0300 Subject: [PATCH 2/2] Updated to 0.3 --- classes/pyroclient.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/pyroclient.py b/classes/pyroclient.py index 52dd38a..ac6e23b 100644 --- a/classes/pyroclient.py +++ b/classes/pyroclient.py @@ -50,7 +50,7 @@ class PyroClient(PyroClient): def __init__(self, scheduler: AsyncIOScheduler): super().__init__(locales_root=Path("locale"), scheduler=scheduler) - self.version: float = 0.2 + self.version: float = 0.3 self.owner: int = self.config["bot"]["owner"] self.admins: List[int] = self.config["bot"]["admins"] + [ -- 2.39.2