feat: conditionally load dev_tools cog when not in prod

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Cal Corum 2026-04-09 07:54:33 -05:00
parent 9257852c3e
commit c683e36daf

View File

@ -131,6 +131,14 @@ async def main():
logger.error(f"Failed to load cog: {c}")
logger.error(f"{e}")
# Load dev-only cogs when not in production
if "prod" not in os.getenv("DATABASE", "dev").lower():
try:
await bot.load_extension("cogs.dev_tools")
logger.info("Loaded dev-only cog: dev_tools")
except Exception as e:
logger.warning(f"Failed to load dev_tools cog: {e}")
# Start health server and bot concurrently
async with bot:
# Create health server task