-
-
Notifications
You must be signed in to change notification settings - Fork 3
Description
After hearing you state you wished to reorganize the code, I was reminded of a feature discordjs has and read up on the docs for discordpy and was happy to find out it does also implement a similar feature.
Discordpy extensions allow separating out sections of code into sub-modules as you had indicated you thought about doing, and allow for hot reloading and loading of new code without needing to shut the bot down in order to do so (assuming the main bot process has been coded in a sufficient manner to allow this)
Discordpy cogs allow grouping of functions into a shared class space inside of modules which provide skeleton for a framework to run commands and bind listeners to event emitted from the discord api.
Cogs can be the basis for organizing of slash commands into groups.
Cogs would also simplify parameter passing between classes and functions as cogs classes can be referenced externally via the get_cog() function call.