Open AstroOrbis opened 3 years ago
This information is already included in main.py
, which is only ~120 lines. It includes the bot token, the default command prefix, the list of cogs enabled (which is all of them by default), the default guild and user information, and a few global functions essential to basic bot functionality. There are definitely ways to make this even more explicit, e.g. by entirely separating them from the code entirely, but there are far more important cleanups to preform first, like reducing the size of the actual cogs themselves (some of which are nearing the 1000-lines range).
As for global variables, there shouldn't be any outside of absolute requirements like the instance of the Bot and the token that enables communication with the Discord API. Everything else is designed to be done in a self-contained manner and async so as to not cause massive failure if an error occurs or connection is lost. Each command within a given cog has an input and an output and often pulls information from the database, and that's more or less all it does.
Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
It’s hard to check exactly which cogs are loaded and what global variables
Describe the solution you'd like A clear and concise description of what you want to happen.
Add
config.py
, like in this discord bot template (This is just an example and what I used to get started)Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.
Looking through the entire code... kinda boring ngl
Additional context Add any other context or screenshots about the feature request here.