Source code can be found on the github repository.
This moderation bot started as a tool for a discord server for a minecraft network I worked for.
When I left that network, I converted it to be a more generic bot and finally I decided to add something bold.
With a few clever techniques, I added code to allow the end user to dynamically add commands and event handlers to the bot and reload them on the fly.
In theory, this bot is FULLY modular, it could be completely changed without ever needing to stop the program.
The event handlers are added to the main script using python "reflection" and some clever techniques that enable my code to be an order of magnitude smaller compared to implementing each event function.
It takes some info provided by the handler class and creates a function in the bot using a template renamed on_<event>
. Effectively ~40 lines of code can handle what could have been upwards of thousands of lines and is completely future proof. When new events are added, I don't even need to write any new code to handle their addition.
To see more of my projects, visit my projects page.