From 46250b14d0f7ad2c9fdbb144f6308650f63b5729 Mon Sep 17 00:00:00 2001 From: pacnpal <183241239+pacnpal@users.noreply.github.com> Date: Sat, 16 Nov 2024 00:42:31 +0000 Subject: [PATCH] Fixed the prefix checking logic to properly handle multiple prefixes Commands will now work correctly during initialization Video processing features still wait for full initialization Properly handle both single string and list prefixes --- videoarchiver/core/events.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/videoarchiver/core/events.py b/videoarchiver/core/events.py index 5014722..a0397a4 100644 --- a/videoarchiver/core/events.py +++ b/videoarchiver/core/events.py @@ -43,8 +43,13 @@ def setup_events(cog: "VideoArchiver") -> None: 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)): + # Check if this is a command by checking against all possible prefixes + prefixes = await cog.bot.get_prefix(message) + if isinstance(prefixes, str): + prefixes = [prefixes] + + # Check if message starts with any of the prefixes + if any(message.content.startswith(prefix) for prefix in prefixes): return # Only process videos if initialization is complete