From 271f5b24e153f4f807f1bd8ddedb31d3cf533591 Mon Sep 17 00:00:00 2001 From: perforat Date: Mon, 9 Mar 2026 14:07:16 +0500 Subject: [PATCH 1/3] Update config.py --- config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.py b/config.py index 41a1842..f275d69 100644 --- a/config.py +++ b/config.py @@ -1,4 +1,3 @@ -python import os from dotenv import load_dotenv @@ -41,3 +40,4 @@ HELP_TEXT = ( "префикс: `!`\n" "в лс отпишите по предложениям че в бота докинуть" ) + -- 2.49.1 From 05fed8e10b51af53833770aa5facf4a831b9dff3 Mon Sep 17 00:00:00 2001 From: perforat Date: Mon, 9 Mar 2026 14:07:42 +0500 Subject: [PATCH 2/3] Update config.py --- config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.py b/config.py index 41a1842..f275d69 100644 --- a/config.py +++ b/config.py @@ -1,4 +1,3 @@ -python import os from dotenv import load_dotenv @@ -41,3 +40,4 @@ HELP_TEXT = ( "префикс: `!`\n" "в лс отпишите по предложениям че в бота докинуть" ) + -- 2.49.1 From f5b41f181705b897b25832961a39e39f10bda51c Mon Sep 17 00:00:00 2001 From: rejnronuz Date: Mon, 9 Mar 2026 14:17:50 +0500 Subject: [PATCH 3/3] bugfixes; touching a 5 month old projects code was n ot a good idea --- .gitignore | 1 + cogs/funchosa_parser.py | 3 +++ config.py | 1 - data/funchosa.db | Bin 1 -> 40960 bytes data/role_message_id.json | 1 + utils/data_manager.py | 9 +++++---- 6 files changed, 10 insertions(+), 5 deletions(-) create mode 100644 data/role_message_id.json diff --git a/.gitignore b/.gitignore index d550652..1352deb 100644 --- a/.gitignore +++ b/.gitignore @@ -27,5 +27,6 @@ wheels/ .idea/ *.swp *.swo +*.db *.log diff --git a/cogs/funchosa_parser.py b/cogs/funchosa_parser.py index 12d0b15..19a57be 100644 --- a/cogs/funchosa_parser.py +++ b/cogs/funchosa_parser.py @@ -83,6 +83,9 @@ class FunchosaParser(commands.Cog): async def cog_load(self): await self.db.init_db() logger.info("FunchosaParser initialized") + asyncio.ensure_future(self._startup()) + + async def _startup(self): await self.bot.wait_until_ready() await self.auto_parse_on_startup() diff --git a/config.py b/config.py index f275d69..6418072 100644 --- a/config.py +++ b/config.py @@ -6,7 +6,6 @@ load_dotenv() TOKEN = os.getenv('DISCORD_TOKEN') CHANNEL_ID = 1454107749028855971 # roles channel -roles_message_id = 1454128857102680187 FUNCHOSA_CHANNEL_ID = 1379127661095551048 REACTION_ROLES = { diff --git a/data/funchosa.db b/data/funchosa.db index 8b137891791fe96927ad78e64b0aad7bded08bdc..2ad90bb277f8025bfbe69f30d8ae774ad7e64eab 100644 GIT binary patch literal 40960 zcmeI&U2D@&7{KvFXS!9&yt3XD4h&g?LmlF!U{}v(S(nZ%g$;xd+sqaFqD=1PN+=bqRf1u6VIZtzb&y$3Z9z1FGLSGz@#se=D_q1!8u4@m4 z&@|0ZpQ8H2(`0=qUQu&BwY+H2&~AVFSz7&}t*m_0N}pH1l%8JwUb69WHfer-MI0}T+F0NCT6nLY!{5OS!IH#dfL6_%(&e~+6 z&NiFxZWx8KY3lD^gx<5h|I!<)UwG~+fbcZPt`(-?o!VAYitIj7Es8T!udBoyxg%|{ zZ#VX8_L10?N22~%)^|l!?R_9N&5gNk$Gve7x|8U>+Z_#kvDIodWz7@N%2ajs%cij9wzQ>Hmj_9~Pm*Y6$?jh<%8fN$i;6UO)mKkUt}5Z* zCzqSjaW_*d#{OlaeCw8e6gf}31^%m3f7tQQtS)7|&+M#DMz*1Pnjfy~g>t2$e|!_g zoQ@=j=a({3;;sK9Wxs3i?|JE*c*CLJS7-CIY|qJIa#6T&(T+>Go_ImJFfMYscgDUK`d!s6bujVeq29JtojUG|EC5JKmY**5I_I{1Q0*~0R#}pzX0$5^PgizhyVfzAb1#XH_D6v literal 1 Icmd-A000XB3jhEB diff --git a/data/role_message_id.json b/data/role_message_id.json new file mode 100644 index 0000000..178aefd --- /dev/null +++ b/data/role_message_id.json @@ -0,0 +1 @@ +{"message_id": 1454128857102680187} \ No newline at end of file diff --git a/utils/data_manager.py b/utils/data_manager.py index 4c519e2..834bc73 100644 --- a/utils/data_manager.py +++ b/utils/data_manager.py @@ -1,17 +1,18 @@ import json import os -from config import roles_message_id + +DATA_FILE = 'data/role_message_id.json' def save_message_id(message_id): os.makedirs('data', exist_ok=True) - with open(roles_message_id, 'w') as f: + with open(DATA_FILE, 'w') as f: json.dump({'message_id': message_id}, f) def load_message_id(): try: - with open(roles_message_id, 'r') as f: + with open(DATA_FILE, 'r') as f: data = json.load(f) - return data.get('message_id') + return data.get('message_id') except FileNotFoundError: return None except json.JSONDecodeError: -- 2.49.1