kevinzhang is a chat bot built on the Hubot framework for use on the CORE Slack. It was initially generated by generator-hubot.
<name>++
<name>--
alot
- Shows a picture of an alotkevinzhang bottom <amount>
kevinzhang card 2
- Displays two answers for questions with two blankskevinzhang card me
- Displays an answerkevinzhang eightball <query>
- Ask the magic eight ball a questionkevinzhang encourage all
kevinzhang encourage me
kevinzhang encourage <name>
kevinzhang erase <user> [<reason>]
kevinzhang help
- Displays all of the help commands that kevinzhang knows.kevinzhang help <query>
- Displays all help commands that match<query>
.kevinzhang i am working on <anything>
- Set what you're working onkevinzhang insult <name>
- give<name>
the what-forkevinzhang kitten bomb me <number>
- Many, many kittens!kevinzhang kitten me
- A randomly selected kittenkevinzhang kitten me <w>x<h>
- A kitten of the given sizekevinzhang map me <query>
- Returns a map view of the area returned byquery
.kevinzhang pug bomb <N>
- getN
pugskevinzhang pug me
- Receive a pugkevinzhang q card
- Returns a questionkevinzhang score <name> [for <reason>]
kevinzhang tell <recipients> <some message>
- tell<recipients>
<some message>
next time they are present.kevinzhang the rules
- Make sure kevinzhang still knows the rules.kevinzhang top <amount>
kevinzhang what is everyone working on?
- Find out what everyone is working onkevinzhang who's on call
- Returns name of person on call and person on backupship it
- Display a motivation squirrel
You can test kevinzhang by running the instructions below. However, not all plugins will behave as expected unless the environment variables they rely upon have been set.
You can start kevinzhang locally by running:
$ bin/hubot
You'll see some initial output and a prompt:
[Sat Feb 28 2015 12:38:27 GMT+0000 (GMT)] INFO Using default redis on localhost:6379
kevinzhang>
Then you can interact with kevinzhang by typing kevinzhang help
, which will show the different queries available.
kevinzhang> kevinzhang help
A few scripts (including some installed by default) require environment variables to be set as a simple form of configuration.
Each script should have a commented header which contains a "Configuration" section that explains which values it requires to be placed in which variable. The following shell command can be used as a shortcut to help you configure the bot.
grep -o 'hubot-[a-z0-9_-]\+' external-scripts.json | \
xargs -n1 -I {} sh -c 'sed -n "/^# Configuration/,/^#$/ s/^/{} /p" \
$(find node_modules/{}/ -name "*.coffee")' | \
awk -F '#' '{ printf "%-25s %s\n", $1, $2 }'
An example script is included at scripts/example.coffee
, so check it out to
get started, along with the Scripting Guide. We've written our own script as well, scripts/oncall.coffee
, and plan to write more for specific functions!
Lots of functions already exist, so we use existing scripts instead of writing our own. Hubot is able to load plugins from third-party npm
packages. That's is the recommended way to add functionality to the 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 it's usually:
- Use
npm install --save
to add the package topackage.json
and install it - Add the package name to
external-scripts.json
as a double-quoted string
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 the ones in hubot-auto-deploy
.
{
"hubot-fun": [
"crazy",
"thanks"
],
"hubot-auto-deploy": "*"
}
We use the hubot-redis-brain
package for persistence, which means that we need the Redis to Go add-on for Heroku.
$ git push heroku master
If you run into any problems, check out Heroku's [docs][heroku-node-docs]. More detailed documentation can be found on the [deploying hubot onto Heroku][deploy-heroku] wiki page.