From 8c89a465771b3e71d4f2628e8830a3c0e00b5cbf Mon Sep 17 00:00:00 2001 From: esefxdz Date: Sun, 5 Jul 2026 14:46:50 +0300 Subject: [PATCH] credentials issue --- cogs/roles.py | 1 - cogs/statchannel.py | 13 ++++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/cogs/roles.py b/cogs/roles.py index add6701..6af05fb 100644 --- a/cogs/roles.py +++ b/cogs/roles.py @@ -48,7 +48,6 @@ COLOR_PRESETS: dict[str, int] = { PANEL_TEXT = ( "**custom roles**\n\n" "you can give yourself a role with your own name and color. " - "it's purely decorative — no permissions, just looks.\n\n" "click the button below and the bot will message you to set it up." ) diff --git a/cogs/statchannel.py b/cogs/statchannel.py index a09f0bf..c4f5707 100644 --- a/cogs/statchannel.py +++ b/cogs/statchannel.py @@ -5,10 +5,17 @@ import os class StatChannel(commands.Cog): def __init__(self, bot): self.bot = bot - self.channel_id = int(os.getenv('STRINOVA_STAT_CHANNEL_ID')) - self.channel_id_mao = int(os.getenv('STRINOVA_STAT_CHANNEL_ID_MAO')) + + def _parse_id(key: str) -> int | None: + val = os.getenv(key, "") + return int(val) if val.isdigit() else None + + self.channel_id = _parse_id('STRINOVA_STAT_CHANNEL_ID') + self.channel_id_mao = _parse_id('STRINOVA_STAT_CHANNEL_ID_MAO') + self.update_stat.start() - self.update_stat_mao.start() + if self.channel_id_mao is not None: + self.update_stat_mao.start() def cog_unload(self): self.update_stat.cancel()