Repository navigation
Extend AchoBot
The project is designed to be easily extensible. It uses the command pattern to define the list of commands. You can extend this list using different strategies depending on what you aim to achieve:
To do this, simply add a new row in your Notion Database. The new command will be loaded the next time you start the service or if you call !refresh from the chat when the server is running (only the Broadcaster or Moderator can do this).
Suppose you don't want to use Notion and prefer to store your command somewhere else. In that case, you should build your own CommandLoader and include it when the TmiCommandManageris instantiated.
A CommandLoader retrieves commands from anywhere and makes sure the commands fit the ITmiCommand contract.
Take a look at NotionCommandsLoader to see a working example.
Commands that require some logic (E.g: clearing the cache) should be included as a Built-in command.
- Create a new class that extends
BaseTmiCommandand add your logic within theexecuteLogicmethod. - Then include your command in the dictionary defined in
BuiltInCommandsLoader.