Created /core module with specialized files:

base.py: Main cog class and initialization logic
cleanup.py: Resource cleanup functionality
commands.py: Command handlers
events.py: Event listeners
guild.py: Guild component management
init.py: Module exports
Improved code organization by:

Separating concerns into focused modules
Maintaining clear dependencies between modules
Keeping related functionality together
Making the codebase more maintainable
Preserved all existing functionality while making the code more modular and easier to maintain.
This commit is contained in:
pacnpal
2024-11-15 20:01:45 +00:00
parent 434911abf0
commit 42b3ceb314
11 changed files with 747 additions and 1020 deletions

View File

@@ -17,7 +17,7 @@ class QueueHandler:
def __init__(self, bot, config_manager, components, db=None):
self.bot = bot
self.config = config_manager
self.config_manager = config_manager
self.components = components
self.db = db
self._unloading = False
@@ -105,7 +105,7 @@ class QueueHandler:
if not guild:
return False, f"Guild {guild_id} not found"
archive_channel = await self.config.get_channel(guild, "archive")
archive_channel = await self.config_manager.get_channel(guild, "archive")
if not archive_channel:
return False, "Archive channel not configured"