Hubot is a fantastic project that enabled us to build great bots. The bot-zero project aims to give you a cleaned up version with some examples that run on ES6 (instead of Coffee-script).
Starting this project is really easy:
- Fork this project (top right corner)
- Clone your forked project to your pc.
- Goto http://slackapi.github.io/hubot-slack/#getting-a-slack-token to read up on how to get a Slack token for your bot.
- Add the token to your environment.
- Open a terminal and navigate to your bot directory.
- Enter
npm install
to install the NodeJs packages. - Start the bot using
npm start
. - Enjoy!
Packages
We've included some packages:
axios
: a promise-based HTTP client. Makes it easier to use promises of your HTTP requests.dotenv
: allows you to store environment variables in the .env file in the root of the project.hubot-command-mapper
: allows for the mapping of commands with parameters to the Hubot without the need for regular expressions.
NPM
Use NPM to interact with the bot:
npm start
will start the bot.npm test
will kick of the tests of the bot. They are located in thetests
directory. Testing is done using Hubot Pretend. It'll also tests against JavaScript Standard Style to make sure your coding is consistent.
Clean up
The bot was generated using the Slack Developer Kit for Hubot. It was "cleaned" using a script from Cleaning up the Default Hubot Installation.
We're using the following stack:
- NodeJs
- ES6
- Hubot
- NPM