Closed branhoff closed 3 months ago
Cogs evidently also include listeners which I'm calling "events" in my code. For now, I think I'm just intending to encapsulate the command logic into cogs.
https://discordpy.readthedocs.io/en/stable/ext/commands/cogs.html
Refactor bot structure to use Discord.py cogs
Description
Currently, our bot's commands and functionality are centralized in a single
commands.py
file. To improve modularity, maintainability, and scalability, we should refactor our bot structure to use Discord.py cogs.Objectives
Tasks
cogs
directory in the project rootgeneral.py
for general-purpose commands (e.g.,reintroduce
)streaks.py
leetcode.py
commands.py
Implementation Details
commands.Cog
setup
function in each cog file for easy loadingbot.load_extension()
method in the main file to load cogsExample Cog Structure