Docbot is a Slack Bot that allows users to ask for Ruby Core/Stdlib documentation by talking to the Bot.
First you will need to install all the bot dependencies:
script/setup
This project depends on slack-ruby-client, a gem that handles the connection to the Slack RTM API and provides a set of mechanisms to bind the Slack and respond to them.
To start the bot, run:
SLACK_API_TOKEN=<your-slack-bot-token> script/server
There are three ways to ask the bot for Ruby documentation:
Send a message with just the class, module or method you want to know about
Array#first
Send a message with a mention to the Bot, followed by the class, module or method you want to know about.
@<your-bot-name>: Array#first
Send a message with a mention to the Bot, followed by 'please explain', followed by the class, module or method you want to know about.
@<your-bot-name>: please explain Array#first
You can ask the Bot how to talk to him:
@<your-bot-name>
or
@<your-bot-name>: help
Class | Module | Module::Class | Class::method | Class#method | Class.method | method
@<your-bot-name>: please explain Array#first
@<your-bot-name>: rand
Array.first
@<your-bot-name>: ACL::ACLEntry
To run the project tests, run:
script/test
This project includes a Dockerfile to create a Docker image where you can setup the project to run.
First create the image:
$ docker build -t docbot -f Dockerfile .
Then, create a container from the image:
$ docker run -it docbot bash --login
In the container terminal, clone the project and run the setup script
docker-container$ git clone https://github.com/jmansor/docbot.git
docker-container$ cd docbot
docker-container$ script/setup
docker-container$ SLACK_API_TOKEN=<your-slack-bot-token> script/server