An IRC bot that runs on Heroku.
Bluebot is written in Ruby using the Cinch IRC framework. You can easily customize it by using many existing Cinch plugins or by writing your own.
It requires a single Dyno and uses the free MongoHQ add-on as its persistence backend, which means you can essentially run Bluebot on Heroku for free, forever.
- URL title scraping.
- Karma system.
- Quotes manager.
- Ability to respond as Cleverbot.
!karma
prints your current karma.!karma <foo>
prints the current karma for<foo>
.<foo>++
increments karma for<foo>
.<foo>--
decrements karma for<foo>
.
!addquote <quote>
records a new quote.!quote
prints a random quote.!quote <number>
prints quote with index<number>
.!lastquote
prints the last quote recorded.!searchquote <keywords>
prints the quotes matching<keywords>
.
Talk to the bot by prefixing your messages with the bot's nickname and it shall respond as Cleverbot.
Example:
<Louie> Bluebot: What's the Answer to the Ultimate Question of Life, the Universe and Everything?
<Bluebot> Louie: 42.
cd Bluebot
heroku create
heroku addons:add mongohq:sandbox
- Tell Bluebot where to connect, what nickname to use, and optionally the required password to identify against the network's NickServ service.
heroku config:set BLUEBOT_SERVER=irc.myserver.com
heroku config:set BLUEBOT_CHANNEL=#mychannel
heroku config:set BLUEBOT_NICK=mybluebot
heroku config:set BLUEBOT_PASSWORD=password # Optional
- Push the code.
git push heroku master
- Launch Bluebot.
heroku scale bluebot=1
You can later shut down the bot by running heroku scale bluebot=0
and relaunch it by running heroku scale bluebot=1
.
As you start customizing the bot and adding new featuers, you'll want to test these changes in your local development environment. In order to do this, you'll have to:
- Launch a local MongoDB server.
sudo service mongodb start # Ubuntu
sudo /etc/init.d/mongodb start # Debian
systemctl start mongodb # Arch Linux
- Launch Bluebot.
ruby bluebot.rb
By default, Bluebot connects to irc.freenode.net #cinch-bot
using the nickname bluebot
. You can override this by exporting the necessary global variables (see deployment instructions), e.g.: BLUEBOT_NICKNAME=mybot ruby bluebot.rb
.