Skip to content

Latest commit

 

History

History
97 lines (61 loc) · 3.41 KB

README.md

File metadata and controls

97 lines (61 loc) · 3.41 KB

Jeff

Jeff is a chat bot built on the Hubot framework. It was initially generated by generator-hubot, and configured to be deployed on a self managed server. This is due to security concerns about the number of credentials and proprietary code access hubot needs to perform various tasks.

Running Jeff Locally

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

You can start Jeff 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
jeff>

Then you can interact with Jeff by typing jeff help.

jeff> jeff help
jeff animate me <query> - The same thing as `image me`, except adds [snip]
jeff help - Displays all of the help commands that Jeff knows about.
...

Scripting

An example script is included at scripts/example.coffee, so check it out to get started, along with the Scripting Guide.

For many common tasks, there's a good chance someone has already one to do just the thing.

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 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.

Persistence

The hubot-redis-brain plugin is used to persist data. You will need to have a Redis installation available for this, but it is not necessary for local testing (but no data will persist across a restart.

See the documentaion in the hubot-redis-brain plugin if you need to point at a server other than the default.

Adapters

At the time of writing we're using a modified HipChat adapter, as the current official version is using outdated libraries that can cause compilation issues. Check the adapters README for how to configure it.

There are many third-party adapters that the community have contributed. Check Hubot Adapters for the available ones.

To run hubot with a specific adapter:

% bin/hubot -a <adapter>

Where <adapter> is the name of your adapter without the hubot- prefix.

Deploying

Use npm install a reference to this repo (tarball advised) to install hubot and all associated plugins. You will also need to create an init script to run hubot as a service, and manage all the necessary environment variables.