Using a Public Tennu Plugin
Some Tennu plugins are hosted on npm
for everybody to use.
Using them is really easy. There are four simple steps to using them.
For this example, we'll be using tennu-admin
and tennu-control
to allow you to use commands like !join
and !part
to control your bot from IRC while it is running.
1) Find the Plugin
You can search npmjs.org for plugins, or look at the tennu-plugin tag for various plugins.
You can also see the list of plugins documented on this site.
Their package name will always start with "tennu-"
.
For our example, you can find their respective packages at tennu-admin & tennu-control.
2) Install the Plugin
In your bot's project directory, use npm install %package-name%
.
This will place the package in ./node_modules/%package-name%
.
For our example, we need to install both of them.
npm install tennu-admin
npm install tennu-control
3) Add the plugins to your configuration.
In your configuration file, append the names of the plugins
to the "plugins"
array.
The name of the plugin is the package name without the "tennu-"
prefix.
For our example, we have this line in your config.json
:
4) Add configuration if needed.
Not all plugins need configuration, but for those that do, add it. Check the plugin's documentation for what configuration is required and available.
For our example, tennu-control
takes no configuration, but tennu-admin
does.
Specifically, we need to add an "admins" property to our configuration. A basic example for this property is as follows.
If you get the configuration wrong, you will not be able to use any of the commands provided by tennu-control
, since they'll respond with "Permission denied.".