Closed padraignix closed 1 week ago
Further discussion with @ropeadope62 - going to adjust this to not have any cogs loaded by default, avoiding additional variable introduction, and letting individuals use /cog commands to load whichever cogs wanted.
I addressed this by removing the code to run the QCAdmin.load_cogs method on bot start. commit https://github.com/quantumlyconfused/qcadmin-discord-bot/commit/141735f7ed54de4fbb560602162c8a101747b56c
async def main():
bot = commands.Bot(command_prefix="/", intents=intents)
qc_admin = QCAdmin(bot)
bot.logger = qc_admin.logger
**await qc_admin.load_cogs()** # Removed,
await bot.add_cog(qc_admin)
await bot.start(os.getenv('DISCORD_API_TOKEN'))
Cogs can be loaded and unloaded as needed with QCAdmin.load_cog which will load cogs by name.
I propose we keep QCAdmin.load_cogs for now, to repurpose into a command to load all available cog. (Remove any references to cog names, simply detect all available cogs and load them. )
Cogs are no longer automatically loading when the bot client is started. I will create another issue to make required changes for QCAdmin.load_cogs.
Done
While there are load/unload cog commands once started, it would be nice to have a blank slate when loading. Load no cogs by default, but also provide optional variables to chose which cogs to load on start.
For the Ptero cogs (most recent one we are working on) - something like
- PTERO_ACTIVE=true
Loading the ptero cog on start.
This behaviour would avoid default failures and ensure a cleaner startup process.