Skip to content

Commit

Permalink
🪥Fix logs blocking the bot from starting
Browse files Browse the repository at this point in the history
  • Loading branch information
Aluerie committed Nov 10, 2024
1 parent fa81151 commit 85997ea
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ext/logs_via_webhook.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ class LogsViaWebhook(IrenesComponent):
"twitchio.websocket": const.Logo.Twitch,
}

def __init__(self, *args: Any, **kwargs: Any) -> None:
super().__init__(*args, **kwargs)
def __init__(self, bot: IrenesBot) -> None:
super().__init__(bot)
self._logging_queue = asyncio.Queue()

# cooldown attrs
Expand All @@ -69,11 +69,11 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
self._most_recent: datetime.datetime | None = None

@override
def component_load(self) -> None:
async def component_load(self) -> None:
self.logging_worker.start()

@override
def component_teardown(self) -> None:
async def component_teardown(self) -> None:
self.logging_worker.stop()

@discord.utils.cached_property
Expand Down Expand Up @@ -122,6 +122,6 @@ async def setup(bot: IrenesBot) -> None:
return

cog = LogsViaWebhook(bot)
await bot.add_component(cog)
await bot.add_component(LogsViaWebhook(bot))
bot.logs_via_webhook_handler = handler = LoggingHandler(cog)
logging.getLogger().addHandler(handler)

0 comments on commit 85997ea

Please sign in to comment.