Understanding the Basics
The Bootstrap
The autobots is a framework built on dynamically loading "modules". On startup the bot class checks for modules in the node_modules/@autobot
directory that starts with module-*
.
https://github.com/autobots-rocks/autobot-common/blob/master/src/Common/Bot.ts#L110
The Module
A module consists of an index.ts
that exports your command class(es) and extends CommandBase. Each module is required to have a public run(command: CommandParser)
method which is invoked by the underlying Bot.ts when a command matches your name
parameter.
Here is an example of a simple test command which is invoked with you type >test
in your discord servers channel:
https://github.com/autobots-rocks/autbot-module-test/blob/master/src/index.ts
What's Next
Now that we understand how modules are loaded and what a basic one looks like let's create a more complex module...
Last updated