from discord.ext import commands from discord.ext import tasks import config from cogs.music.main import music cogs = [ music ] class Astro(commands.Bot): async def on_ready(self): # Set status await self.change_presence(activity=config.get_status()) # Load cogs print(f"Loading {len(cogs)} cogs...") for cog in cogs: try: print(f"Attempting to load: {cog.__name__}") await self.add_cog(cog(self)) print(f"✅ Loaded {cog.__name__}") except Exception as e: print(f"❌ Failed to load {cog.__name__}: {e}") import traceback traceback.print_exc() # Sync slash commands with Discord print("🔄 Syncing slash commands...") try: synced = await self.tree.sync() print(f"✅ Synced {len(synced)} slash command(s)") except Exception as e: print(f"❌ Failed to sync commands: {e}") # Start inactivity checker if not self.inactivity_checker.is_running(): self.inactivity_checker.start() print(f"✅ {self.user} is ready and online!") @tasks.loop(seconds=30) async def inactivity_checker(self): """Check for inactive voice connections""" from cogs.music import util await util.check_inactivity(self) @inactivity_checker.before_loop async def before_inactivity_checker(self): await self.wait_until_ready()