The setup_profile_commands() function was returning None instead of the expected (successful, failed, failed_modules) tuple, causing bot startup to log "Failed to load profile package: cannot unpack non-iterable NoneType". Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
41 lines
1.1 KiB
Python
41 lines
1.1 KiB
Python
"""
|
|
Profile management commands package.
|
|
|
|
Handles user-facing profile management including player image updates.
|
|
"""
|
|
import logging
|
|
|
|
from discord.ext import commands
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
|
|
async def setup_profile_commands(bot: commands.Bot):
|
|
"""
|
|
Load profile management commands.
|
|
|
|
Returns:
|
|
tuple: (successful_count, failed_count, failed_modules)
|
|
"""
|
|
from commands.profile.images import ImageCommands
|
|
|
|
successful = 0
|
|
failed = 0
|
|
failed_modules = []
|
|
|
|
try:
|
|
await bot.add_cog(ImageCommands(bot))
|
|
logger.info("✅ Loaded ImageCommands")
|
|
successful += 1
|
|
except Exception as e:
|
|
logger.error(f"❌ Failed to load ImageCommands: {e}", exc_info=True)
|
|
failed += 1
|
|
failed_modules.append("ImageCommands")
|
|
|
|
if failed == 0:
|
|
logger.info(f"🎉 All {successful} profile command modules loaded successfully")
|
|
else:
|
|
logger.warning(f"⚠️ Profile commands loaded with issues: {successful} successful, {failed} failed")
|
|
|
|
return successful, failed, failed_modules
|