mirror of
https://github.com/pacnpal/Pac-cogs.git
synced 2025-12-20 10:51:05 -05:00
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
This commit is contained in:
@@ -43,8 +43,13 @@ def setup_events(cog: "VideoArchiver") -> None:
|
|||||||
if message.guild is None or message.author.bot:
|
if message.guild is None or message.author.bot:
|
||||||
return
|
return
|
||||||
|
|
||||||
# Check if this is a command - if so, let it process normally
|
# Check if this is a command by checking against all possible prefixes
|
||||||
if message.content.startswith(await cog.bot.get_prefix(message)):
|
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
|
return
|
||||||
|
|
||||||
# Only process videos if initialization is complete
|
# Only process videos if initialization is complete
|
||||||
|
|||||||
Reference in New Issue
Block a user