From 18b5d305f386dea1154f5e6cbb9d66c5dfeae730 Mon Sep 17 00:00:00 2001 From: pacnpal <183241239+pacnpal@users.noreply.github.com> Date: Sat, 16 Nov 2024 00:39:40 +0000 Subject: [PATCH] Commands will now work even during initialization Only video processing features are blocked until initialization completes The on_message event handler now checks if a message is a command first and lets it process normally --- videoarchiver/core/events.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/videoarchiver/core/events.py b/videoarchiver/core/events.py index b6e3737..5014722 100644 --- a/videoarchiver/core/events.py +++ b/videoarchiver/core/events.py @@ -39,7 +39,17 @@ def setup_events(cog: "VideoArchiver") -> None: @cog.bot.event async def on_message(message: discord.Message) -> None: """Handle new messages for video processing""" - if not cog.ready.is_set() or message.guild is None or message.author.bot: + # Only block video processing features, not command processing + if message.guild is None or message.author.bot: + return + + # Check if this is a command - if so, let it process normally + if message.content.startswith(await cog.bot.get_prefix(message)): + return + + # Only process videos if initialization is complete + if not cog.ready.is_set(): + logger.debug("Skipping video processing - initialization not complete") return try: