-
You need a gitter API access-token. You can obtain one here: https://developer.gitter.im/apps
-
You need a RoomId, where you want the bot to run. You can find the RoomId here: https://api.gitter.im/v1/rooms?access_token=GITTER-TOKEN
-
For the gif-displaying functionality you need a giphy access-token: You can obtain one here: https://giphy.com
-
Put the Access-Tokens in environment-Variables by starting the script with parameters, or by editing your system environement-variables. E.g. in your ~/.bashrc file:
export GITTER_TOKEN='your gitter token' export GITTER_ROOM_ID='your gitter room id' export GIPHY_API_KEY='your giphy token'
This bot can also listen to multiple rooms simultaneously. Just enter the room ids in the array room_ids
in the initialize method.
bundle install
Start the software with:
ruby gitter_bot.rb
Bot will listen to following commands, in the gitter-room that you have specified:
tell a joke
gif topic
activate time service # Displays a clock-emoji every 30 min
deactivate time service # Stops displaying a clock-emoji every 30 min
- Fork the repository
- Create a branch (
git checkout -b new-branch
) - Commit your changes (
git commit -am 'Add great new thing'
) - Push to the branch (
git push origin new-branch
) - Create new Pull Request