Cogbot is an irc bot written in ruby based on Cinch bot framework.
It has been in service at Code Green from 2012 to 2013 and his stability was unquestionned. It is used with a collection of custom plugins that are focused on helping a coding team that uses irc as a main shared communication space:
- git notifications pushed on the channel
- redmine issues polled from redmine and announced
- commands to ask google, rubygems or stack overflow
- the urban dictionary to make us laugh
- a twitter search plugin
- a trello webhooks listener
- a RSS announce poller
- and some other more or less used features
gem install cogbot
At first launch:
you will be prompted to create a configuration file in ~/.cogbot/cogbot.yml When this is done you can launch again and it will just run according to your configuration.
To stop the robot, just use
You can specify an alternative config directory using the COGBOT_DIR environment variable:
COGBOT_DIR=~/.cogbot-alt cogbot start COGBOT_DIR=~/.cogbot-alt cogbot stop
Some plugins require extra config parameters:
Git and trello webhook listeners use a small eventmachine http server, which is only launched if the configuration is present:
server: ip: x.x.x.x port: xxxxx
Twitter plugin requires to have credentials set:
tweet: consumer_key: "xxx" consumer_secret: "xxx" access_token: "xxx" access_token_secret: "xxx"
Trello plugin has some config too, for knowing where to announce the trello changes. The webhook has to be setup independantly, it's quite easy to declare by using postman.
trello: announce: - "#trello-announces"
Then in Trello, using the API, you can set a hook to send events to http://ip:port/trellolistener
For RSS plugin you can specify multiple listener for multiple channels:
rss: polling: 300 channels: - prefix: '[example]' url: http://example.com/feed/ announce: - "#cogbot-rss"
- document each plugin
- add multi-entrypoints system for webhooks listener
- add a users database
- add a credentials system
git clone email@example.com:mose/cogbot.git cd cogbot/ bundle install --path vendor bundle exec ruby -Ilib bin/cogbot start
To reload plugins while developing, you can issue, on a channel where your bot is sitting:
.m reload myplugin
- Fork it
- Create your feature branch (
git checkout -b my-new-feature)
- Commit your changes (
git commit -am 'Added some feature')
- Push to the branch (
git push origin my-new-feature)
- Create new Pull Request
- write some documentation of the commands of plugins
- write tests
Copyright (c) 2012-18 mose at mose