Open-Assistant icon indicating copy to clipboard operation
Open-Assistant copied to clipboard

Refactor discord-bot to use Cogs for improved code structure

Open shroominic opened this issue 2 years ago • 2 comments

Hello,

I am submitting this pull request to improve the code structure of the discord-bot. To do this, I refactored the main instance from Client to Bot, which inherits from Client. This allows us to use .add_cog(), which helps to outsource code by organizing it into Cogs. (more info: Client vs Bot, Cogs )

I have created Cogs for the following events:

  • on_ready()
  • on_message() Using Cogs will allow us to better structure and organize the code in the future, particularly for larger features like the CommandTree and its associated commands.

I hope this makes sense and I would welcome any feedback on how to improve this workflow or my commits. This is my first contribution to an open source project, so I am excited to learn and improve my skills.

Thanks for considering this pull request!

shroominic avatar Dec 27 '22 23:12 shroominic

@shroominic Thanks for your PR and great that you want to help us with the project. We are currently in the process of completely restructuring the bot and AlexanderHOtt leads an effort for a rewrite of the bot using hikari (see #95). If you are interested in helping with the new bot please come to the LAION discord and ping me with a DM.

andreaskoepf avatar Dec 28 '22 09:12 andreaskoepf

@shroominic thanks a lot! I'll leave this PR open for now. if the coordination works out such that this code should get merged, ping me again. If we'll do the bot entirely new, as planned so far, feel free to close this.

yk avatar Dec 28 '22 12:12 yk

closing this in favor of #135

andreaskoepf avatar Dec 29 '22 15:12 andreaskoepf