/ababot

🤖

Primary LanguageJavaScriptMIT LicenseMIT

Ababot

Running hubot Locally

You can test your hubot by running the following, however some plugins will not behave as expected unless the environment variables they rely upon have been set.

OBS: A lot of the environment variables are pointing at the local cluster and will not work locally.

You can start hubot locally by running:

% bin/hubot

You'll see some start up output and a prompt:

[Sat Feb 28 2015 12:38:27 GMT+0000 (GMT)] INFO Using default redis on localhost:6379
hubot>

Then you can interact with hubot by typing hubot help.

hubot> hubot help
hubot help - Displays all of the help commands that hubot knows about.
...

Adapters

We are running the Slack adapter to allow hubot to integrate with slack. we therefore run hubot with the -a slack argument

$ bin/hubot -a <adapter>

external-scripts

There will inevitably be functionality that everyone will want. Instead of writing it yourself, you can use existing plugins.

Hubot is able to load plugins from third-party npm packages. This is the recommended way to add functionality to your hubot. You can get a list of available hubot plugins on [npmjs.com][npmjs] or by using npm search:

% npm search hubot-scripts panda
NAME             DESCRIPTION                        AUTHOR DATE       VERSION KEYWORDS
hubot-pandapanda a hubot script for panda responses =missu 2014-11-30 0.9.2   hubot hubot-scripts panda
...

To use a package, check the package's documentation, but in general it is:

  1. Use npm install --save to add the package to package.json and install it
  2. Add the package name to external-scripts.json as a double quoted string

You can review external-scripts.json to see what is included by default.

Advanced Usage

It is also possible to define external-scripts.json as an object to explicitly specify which scripts from a package should be included. The example below, for example, will only activate two of the six available scripts inside the hubot-fun plugin, but all four of those in hubot-auto-deploy.

{
  "hubot-fun": ["crazy", "thanks"],
  "hubot-auto-deploy": "*"
}