From e73797d8193c2097c0f3a068dd96c95d8d4d9b7e Mon Sep 17 00:00:00 2001 From: profitroll Date: Fri, 31 May 2024 00:03:24 +0200 Subject: [PATCH 01/14] Replaced "source code" with "learn more" --- locale/de.json | 4 ++-- locale/en.json | 2 +- locale/ru.json | 4 ++-- locale/uk.json | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/locale/de.json b/locale/de.json index 05115c7..732e457 100644 --- a/locale/de.json +++ b/locale/de.json @@ -8,7 +8,7 @@ }, "bot": { "name": "Garbage Reminder", - "about": "Nie wieder Müllabfuhrtermin verpassen. Quellcode: https://garbagebot.eu", + "about": "Nie wieder Müllabfuhrtermin verpassen. Mehr erfahren: https://garbagebot.eu", "description": "Sie können Erinnerungen an die Müllabfuhr für Orte Ihrer Wahl erhalten.\n\nVerwenden Sie /help, um die Funktionsweise des Bots besser zu verstehen, oder verwenden Sie /setup, um Ihre Erinnerungen zu konfigurieren." }, "formats": { @@ -100,4 +100,4 @@ "callbacks": { "locale_set": "Ihre Sprache ist jetzt: {locale}" } -} +} \ No newline at end of file diff --git a/locale/en.json b/locale/en.json index f4df4b6..4a662ec 100644 --- a/locale/en.json +++ b/locale/en.json @@ -8,7 +8,7 @@ }, "bot": { "name": "Garbage Reminder", - "about": "Never forget about garbage collection again. Source code: https://garbagebot.eu", + "about": "Never forget about garbage collection again. Learn more: https://garbagebot.eu", "description": "You can receive reminders about garbage collection for locations of your choice.\n\nUse /help to better understand how the bot works or use /setup to configure your reminders." }, "formats": { diff --git a/locale/ru.json b/locale/ru.json index 2d14cff..5d995bb 100644 --- a/locale/ru.json +++ b/locale/ru.json @@ -8,7 +8,7 @@ }, "bot": { "name": "Garbage Reminder 🇺🇦", - "about": "Більше ніколи не забувайте про вивезення сміття. Вихідний код: https://garbagebot.eu", + "about": "Більше ніколи не забувайте про вивезення сміття. Дізнатись більше: https://garbagebot.eu", "description": "Ви можете отримувати нагадування про вивезення сміття для обраних вами місць.\n\nВикористовуйте /help, щоб краще зрозуміти, як працює бот, або /setup, щоб налаштувати нагадування." }, "formats": { @@ -100,4 +100,4 @@ "set_offset": "Кількість днів", "set_time": "Час у вигляді ГГ:ХХ" } -} +} \ No newline at end of file diff --git a/locale/uk.json b/locale/uk.json index 513e748..bc52920 100644 --- a/locale/uk.json +++ b/locale/uk.json @@ -8,7 +8,7 @@ }, "bot": { "name": "Garbage Reminder 🇺🇦", - "about": "Більше ніколи не забувайте про вивезення сміття. Вихідний код: https://garbagebot.eu", + "about": "Більше ніколи не забувайте про вивезення сміття. Дізнатись більше: https://garbagebot.eu", "description": "Ви можете отримувати нагадування про вивезення сміття для обраних вами місць.\n\nВикористовуйте /help, щоб краще зрозуміти, як працює бот, або /setup, щоб налаштувати нагадування." }, "formats": { @@ -100,4 +100,4 @@ "set_offset": "Кількість днів", "set_time": "Час у вигляді ГГ:ХХ" } -} +} \ No newline at end of file From 852f4307f8e18948df9d7fc4a93f62f3e779e72c Mon Sep 17 00:00:00 2001 From: Renovate Date: Sat, 1 Jun 2024 15:32:20 +0300 Subject: [PATCH 02/14] Update dependency async_pymongo to v0.1.5 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 6ecfc8a..8fe019c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,6 +7,6 @@ tgcrypto==1.2.5 ujson>=5.0.0 uvloop==0.19.0 --extra-index-url https://git.end-play.xyz/api/packages/profitroll/pypi/simple -async_pymongo==0.1.4 +async_pymongo==0.1.5 libbot[speed,pyrogram]==3.2.2 pykeyboard==0.1.7 \ No newline at end of file From 6a6b4cd6cd284c29b2099d8ef00ba529967ead6d Mon Sep 17 00:00:00 2001 From: Profitroll Date: Sun, 2 Jun 2024 12:56:46 +0300 Subject: [PATCH 03/14] Selected async_pymongo from PyPi --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 8fe019c..ffb24b5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,6 @@ aiohttp~=3.9.5 apscheduler~=3.10.4 +async_pymongo==0.1.5 convopyro==0.5 mongodb-migrations==1.3.1 pytz>=2024.1 @@ -7,6 +8,5 @@ tgcrypto==1.2.5 ujson>=5.0.0 uvloop==0.19.0 --extra-index-url https://git.end-play.xyz/api/packages/profitroll/pypi/simple -async_pymongo==0.1.5 libbot[speed,pyrogram]==3.2.2 pykeyboard==0.1.7 \ No newline at end of file From d51fa1e04c4d86a6d2e4455b011acd86aaf339f2 Mon Sep 17 00:00:00 2001 From: Renovate Date: Sun, 23 Jun 2024 13:30:14 +0300 Subject: [PATCH 04/14] Update dependency async_pymongo to v0.1.6 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index ffb24b5..09653c5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ aiohttp~=3.9.5 apscheduler~=3.10.4 -async_pymongo==0.1.5 +async_pymongo==0.1.6 convopyro==0.5 mongodb-migrations==1.3.1 pytz>=2024.1 From 6b138126c1dd6e7f591d1e7f7c332b99cf780994 Mon Sep 17 00:00:00 2001 From: Renovate Date: Wed, 10 Jul 2024 00:43:50 +0300 Subject: [PATCH 05/14] Update dependency libbot to v3.2.3 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 09653c5..67d360f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,5 +8,5 @@ tgcrypto==1.2.5 ujson>=5.0.0 uvloop==0.19.0 --extra-index-url https://git.end-play.xyz/api/packages/profitroll/pypi/simple -libbot[speed,pyrogram]==3.2.2 +libbot[speed,pyrogram]==3.2.3 pykeyboard==0.1.7 \ No newline at end of file From 3fef2eb028667e6f5a68dc6c75803bc75023b923 Mon Sep 17 00:00:00 2001 From: Renovate Date: Wed, 31 Jul 2024 00:47:50 +0300 Subject: [PATCH 06/14] Update dependency aiohttp to ~=3.10.0 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 67d360f..0516595 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -aiohttp~=3.9.5 +aiohttp~=3.10.0 apscheduler~=3.10.4 async_pymongo==0.1.6 convopyro==0.5 From f42117e542cda8b09daf6cf56dca7d6a8875963c Mon Sep 17 00:00:00 2001 From: Profitroll Date: Thu, 1 Aug 2024 00:47:16 +0300 Subject: [PATCH 07/14] revert a5a513cb824ef5499303279aafbfe7a49fc0cc32 revert Merge pull request 'Update dependency aiohttp to ~=3.10.0' (#65) from renovate/aiohttp-3.x into dev Reviewed-on: https://git.end-play.xyz/GarbageReminder/TelegramBot/pulls/65 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 0516595..67d360f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -aiohttp~=3.10.0 +aiohttp~=3.9.5 apscheduler~=3.10.4 async_pymongo==0.1.6 convopyro==0.5 From 6867b64a187203fef89997ecbdbdd4e54bed9614 Mon Sep 17 00:00:00 2001 From: profitroll Date: Sat, 10 Aug 2024 14:10:59 +0200 Subject: [PATCH 08/14] Should resolve #87 --- classes/pyroclient.py | 2 +- classes/updater.py | 12 +++++++++--- main.py | 4 +++- requirements.txt | 2 +- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/classes/pyroclient.py b/classes/pyroclient.py index 118654a..8e49bf2 100644 --- a/classes/pyroclient.py +++ b/classes/pyroclient.py @@ -23,7 +23,7 @@ class PyroClient(LibPyroClient): super().__init__(**kwargs) - self.updater = Updater(ClientSession()) + self.updater = Updater() self.contexts = [] if self.scheduler is not None: diff --git a/classes/updater.py b/classes/updater.py index 0f06c59..d1a2930 100644 --- a/classes/updater.py +++ b/classes/updater.py @@ -1,5 +1,5 @@ import logging -from typing import Any, Dict, Tuple +from typing import Any, Dict, Tuple, Union from aiohttp import ClientSession @@ -7,12 +7,15 @@ logger = logging.getLogger(__name__) class Updater: - def __init__(self, client_session: ClientSession) -> None: - self.client_session: ClientSession = client_session + def __init__(self, client_session: Union[ClientSession, None] = None) -> None: + self.client_session: Union[ClientSession, None] = client_session async def check_updates( self, version_current: Tuple[int, int, int], api_url: str ) -> bool: + if not self.client_session: + self.client_session = ClientSession() + response = await self.client_session.get(api_url) if response.status != 200: @@ -30,6 +33,9 @@ class Updater: ) async def get_latest_release(self, api_url: str) -> Dict[str, Any]: + if not self.client_session: + self.client_session = ClientSession() + response = await self.client_session.get(api_url) if response.status != 200: diff --git a/main.py b/main.py index 2cb0e19..7818ff9 100644 --- a/main.py +++ b/main.py @@ -4,6 +4,7 @@ from argparse import ArgumentParser from os import getpid from pathlib import Path +from aiohttp import ClientSession from convopyro import Conversation from libbot import sync @@ -41,7 +42,8 @@ def main(): exit() client = PyroClient( - scheduler=scheduler, commands_source=sync.json_read(Path("commands.json")) + scheduler=scheduler, + commands_source=sync.json_read(Path("commands.json")), ) Conversation(client) diff --git a/requirements.txt b/requirements.txt index 67d360f..828d0c6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -aiohttp~=3.9.5 +aiohttp~=3.10.2 apscheduler~=3.10.4 async_pymongo==0.1.6 convopyro==0.5 From f6b1749408c2315465fff5a97e93cb8ab4e830f0 Mon Sep 17 00:00:00 2001 From: Renovate Date: Thu, 15 Aug 2024 23:25:25 +0300 Subject: [PATCH 09/14] Update dependency uvloop to v0.20.0 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 828d0c6..42b602a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,7 +6,7 @@ mongodb-migrations==1.3.1 pytz>=2024.1 tgcrypto==1.2.5 ujson>=5.0.0 -uvloop==0.19.0 +uvloop==0.20.0 --extra-index-url https://git.end-play.xyz/api/packages/profitroll/pypi/simple libbot[speed,pyrogram]==3.2.3 pykeyboard==0.1.7 \ No newline at end of file From c2ee35b3d9d7c010d07dabf3a8b4bc386a42a5cf Mon Sep 17 00:00:00 2001 From: Renovate Date: Fri, 20 Sep 2024 17:24:31 +0300 Subject: [PATCH 10/14] Update dependency async_pymongo to v0.1.7 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 42b602a..8706dca 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ aiohttp~=3.10.2 apscheduler~=3.10.4 -async_pymongo==0.1.6 +async_pymongo==0.1.7 convopyro==0.5 mongodb-migrations==1.3.1 pytz>=2024.1 From b5173a8dba7ffb87b977ab6f2ec8ccdeae2d004d Mon Sep 17 00:00:00 2001 From: Renovate Date: Wed, 25 Sep 2024 17:13:14 +0300 Subject: [PATCH 11/14] Update dependency async_pymongo to v0.1.8 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 8706dca..87e7c89 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ aiohttp~=3.10.2 apscheduler~=3.10.4 -async_pymongo==0.1.7 +async_pymongo==0.1.8 convopyro==0.5 mongodb-migrations==1.3.1 pytz>=2024.1 From cc66cc386bf8aea5e6d5687ad503627ebb56b199 Mon Sep 17 00:00:00 2001 From: Renovate Date: Tue, 8 Oct 2024 16:29:25 +0300 Subject: [PATCH 12/14] Update dependency async_pymongo to v0.1.9 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 87e7c89..a43cab0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ aiohttp~=3.10.2 apscheduler~=3.10.4 -async_pymongo==0.1.8 +async_pymongo==0.1.9 convopyro==0.5 mongodb-migrations==1.3.1 pytz>=2024.1 From 13be95f0f85d3038914be231415bf0ce5064decb Mon Sep 17 00:00:00 2001 From: Kostiantyn Kuleshov Date: Wed, 9 Oct 2024 15:10:55 +0000 Subject: [PATCH 13/14] Closes #70 --- plugins/commands/toggle.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/commands/toggle.py b/plugins/commands/toggle.py index c19e232..7531083 100644 --- a/plugins/commands/toggle.py +++ b/plugins/commands/toggle.py @@ -13,7 +13,7 @@ async def command_toggle(app: PyroClient, message: Message): await user.update_state(not user.enabled) - if user.enabled: + if not user.enabled: await message.reply_text( app._("toggle_disabled", "messages", locale=user.locale) ) From f8472b1b3fbe25b385f5cde8bc9c64639fda73d9 Mon Sep 17 00:00:00 2001 From: Profitroll Date: Thu, 10 Oct 2024 12:52:38 +0300 Subject: [PATCH 14/14] Bump version tp 0.1.3 --- classes/pyroclient.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/pyroclient.py b/classes/pyroclient.py index 8e49bf2..ff83727 100644 --- a/classes/pyroclient.py +++ b/classes/pyroclient.py @@ -19,7 +19,7 @@ logger = logging.getLogger(__name__) class PyroClient(LibPyroClient): def __init__(self, **kwargs): - self.__version__ = (0, 1, 2) + self.__version__ = (0, 1, 3) super().__init__(**kwargs)