Villager-Bot
Villager-Bot copied to clipboard
Separate commands into their own cogs
- Each command should get their own cog, but the file structure should stay relatively the same:
bot/cogs/commands/
config/
config.py
prefix.py
...
econ/
profile.py
balance.py
mine.py
...
fun/
...
- This should also be accompanied by command cogs being automatically detected and loaded
idk chief
idk chief
wat
you mean to tell me i don't have to go searching far and wide in a single file anymore? 👀
unsubscribe
doesn't seem like a great idea to me
doesn't seem like a great idea to me
With the introduction of slash commands, there will be "view" classes and extra boilerplate littered everywhere. When commands are not self-contained within one method, I think they should get their own files.
I feel the fact that each command having its own file will
- Unnecessarily increase the codebase of the bot
- Make it harder for some people to contribute and maintain as it can get harder to read
- Will worsen if you ever plan on adding more commands. 40 files for 40 commands seems extremely prolix to me
So perhaps all of these (and maybe even other things) outweigh the pros
I feel the fact that each command having its own file will
Unnecessarily increase the codebase of the bot
Make it harder for some people to contribute and maintain as it can get harder to read
Will worsen if you ever plan on adding more commands. 40 files for 40 commands seems extremely prolix to me
So perhaps all of these (and maybe even other things) outweigh the pros
Disagreed. Point 1 says increasing the code base but the only difference will be less lines per file. There may potentially be very little of an increase in lines, but this heavily depends on what the cog is importing and from where.
Point 2 and 3 are self-contradictory, since if each cog has its own file and code in that file, it'd make it much easier to find rather than having to scroll through hundreds (if not thousands) of lines in a single file. More files does not mean more clutter.
You might have misunderstood my points. Firstly there will for sure be an increase in the number of lines because each command will require it's own setup function and a subclass of commands.Cog, but anyways I was pointing towards the increase in the number of FILES not LINES, files too are included in the codebase of a program.
Again, was referring to the number of FILES, forty different files spread across 5 folders with a single command in each is extremely verbose. I'm not talking about the number of lines. And yeah sure I won't disagree that more files is not equal to more clutter, that was purely my opinion as switching between files and looking for a specific file might get annoying/difficult with so many files
Also you can just use the search option to not have to scroll through anything