diff --git a/birthday/__init__.py b/birthday/__init__.py index 604e2a7..49a0b85 100644 --- a/birthday/__init__.py +++ b/birthday/__init__.py @@ -5,26 +5,9 @@ from .birthday import Birthday async def setup(bot: Red) -> None: """Load Birthday cog.""" cog = Birthday(bot) - # Add cog first await bot.add_cog(cog) - # Then sync commands after cog is loaded - if hasattr(bot, "tree"): - try: - # Only sync guild commands to avoid rate limits - await bot.tree.sync(guild=None) - except Exception as e: - # Log error but don't fail cog load - bot.log.error(f"Failed to sync commands: {str(e)}") async def teardown(bot: Red) -> None: """Clean up when unloading.""" - if hasattr(bot, "tree"): - try: - # Remove all commands from this cog - for command in bot.tree.get_commands(): - bot.tree.remove_command(command.name) - # Sync to remove commands from Discord - await bot.tree.sync(guild=None) - except Exception as e: - # Log error but don't fail cog unload - bot.log.error(f"Failed to cleanup commands: {str(e)}") + # Let Red handle command cleanup + pass diff --git a/overseerr/__init__.py b/overseerr/__init__.py index 3cf17e8..371371e 100644 --- a/overseerr/__init__.py +++ b/overseerr/__init__.py @@ -5,26 +5,9 @@ from .overseerr import Overseerr async def setup(bot: Red) -> None: """Load Overseerr cog.""" cog = Overseerr(bot) - # Add cog first await bot.add_cog(cog) - # Then sync commands after cog is loaded - if hasattr(bot, "tree"): - try: - # Only sync guild commands to avoid rate limits - await bot.tree.sync(guild=None) - except Exception as e: - # Log error but don't fail cog load - bot.log.error(f"Failed to sync commands: {str(e)}") async def teardown(bot: Red) -> None: """Clean up when unloading.""" - if hasattr(bot, "tree"): - try: - # Remove all commands from this cog - for command in bot.tree.get_commands(): - bot.tree.remove_command(command.name) - # Sync to remove commands from Discord - await bot.tree.sync(guild=None) - except Exception as e: - # Log error but don't fail cog unload - bot.log.error(f"Failed to cleanup commands: {str(e)}") + # Let Red handle command cleanup + pass diff --git a/videoarchiver/__init__.py b/videoarchiver/__init__.py index 1fb558c..db6fd9f 100644 --- a/videoarchiver/__init__.py +++ b/videoarchiver/__init__.py @@ -5,26 +5,9 @@ from .video_archiver import VideoArchiver async def setup(bot: Red) -> None: """Load VideoArchiver.""" cog = VideoArchiver(bot) - # Add cog first await bot.add_cog(cog) - # Then sync commands after cog is loaded - if hasattr(bot, "tree"): - try: - # Only sync guild commands to avoid rate limits - await bot.tree.sync(guild=None) - except Exception as e: - # Log error but don't fail cog load - bot.log.error(f"Failed to sync commands: {str(e)}") async def teardown(bot: Red) -> None: """Clean up when unloading.""" - if hasattr(bot, "tree"): - try: - # Remove all commands from this cog - for command in bot.tree.get_commands(): - bot.tree.remove_command(command.name) - # Sync to remove commands from Discord - await bot.tree.sync(guild=None) - except Exception as e: - # Log error but don't fail cog unload - bot.log.error(f"Failed to cleanup commands: {str(e)}") + # Let Red handle command cleanup + pass