Visjar is a slack bot powered by Natural Language Understanding, which means that unlike other slackbots, this one is not only aware of simple unix-like commands, but can also understand sentences and complex requests.
During its development, we tried to create this slackbot in a way people could easily install, configure and customize it. The first, and obvious, thing to do was to offer the possibility to install Visjar in on click, thanks to the Slack button (here). And the second, was to open source Visjar, and produce a detailed README, for the developers to use (there).
- Get the project and move in the folder (
git clone git@github.com:recastAI/visjar.git && cd ./visjar
) - Create the parameters file from the .dist (
cp config/parameters.yml.dist config/parameters.yml
) - Add a new Slack integration under services/new/bot and copy the API token
- Get the token from your
visjar
app on Recast.AI - Get a token from your Google Console for
Google Places API Web Service
,Google Static Maps API
,Google Maps Geocoding API
andCustom Search API
(Optional) - Get a Forecast.io token (Optional)
- Paste your tokens and fill your preferences in the parameters.yml file (
ed config/parameters.yml
) - Install the dependencies (
gem install bundler && bundle
) - Run the daemon (
./bin/visjar
)
The workflow inside Visjar is as follows:
- Check if the message received is a direct message (via @visjar or as DM)
- If it is, send the message to Recast.AI to get the underlying intent
- If an intent is returned, send it to the corresponding command
- Repeat
Here's the list of the currently implemented commands:
- Default politeness (Greetings, Goodbyes, Feelings, Thanks, Help, Compliments, Insults)
- Settings (location for weather cast and restaurant finding, language for the news)
- Weather cast
- Restaurant finding
- News
- Google search
- Website status check
Most of the configuration must be done in the parameters.yml
file in order to have a default visjar working.
Visjar is relying on several APIs to provide you those commands, and here's a breakdown of what command uses which API:
The eat
command uses Google Geocoding, Google Places and Google Static Maps.
The weather
command works with Google Geocoding and Forecast.io.
The news
and up
commands doesn't have an API dependency.
The search
command relies on Google Custom Search.
All the commands Visjar can perform are situated in lib/commands/
and are loaded during boot by the file config/environment.rb
.
You can easily add a new command by creating a new file in the commands folder and add a requiring line in the environment file.
We have a lot of ideas concerning day-to-day tasks on a Slack.. Here are some of them, and don't hesitate to reach us with yours!
Put an uploaded file in the team's Google Drive.
Set a reminder.
Tell a joke.
- Daemon-kit and safely are used to provide an easy daemon setup.
- RecastAI, slack-ruby-client, faye-websocket, HTTParty and forecast_io are used to consume the APIs (RecastAI, Slack, Forecast.io, Google Places, Google Maps, etc.).
- activesupport is used for code lazyness.
- awesome_print is used for debugging.
- rubocop is used for code consistency.
- Fork it
- Create your feature branch (
git checkout -b feature/my-feature
) - Commit your changes (
git commit -am '[ADD] some feature'
) - Push to the branch (
git push origin feature/my-feature
) - Create a new Pull Request
Copyright (c) [2016] Recast.AI
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.