|
| 1 | +Bluebot |
| 2 | +======= |
| 3 | + |
| 4 | +**An IRC bot that runs on Heroku.** |
| 5 | + |
| 6 | + |
| 7 | +Bluebot is written in Ruby using the [Cinch IRC framework](https://github.com/cinchrb). You can easily customize it by using many existing [Cinch plugins](https://rubygems.org/search?utf8=%E2%9C%93&query=cinch) or by writing your own. |
| 8 | + |
| 9 | +It requires a single Dyno and uses the free [MongoHQ](https://addons.heroku.com/mongohq) add-on as its persistence backend, which means you can essentially run Bluebot on Heroku for free, forever. |
| 10 | + |
| 11 | + |
| 12 | +Features |
| 13 | +-------- |
| 14 | + |
| 15 | +- URL title scraping. |
| 16 | +- Karma system. |
| 17 | +- Quotes manager. |
| 18 | +- Ability to respond as [Cleverbot](http://www.cleverbot.com/). |
| 19 | +- Wikipedia, Urban Dictionary and LMGTFY plugins. |
| 20 | + |
| 21 | + |
| 22 | +Supported commands |
| 23 | +------------------ |
| 24 | + |
| 25 | +### Karma system ### |
| 26 | + |
| 27 | +* `!karma` prints your current karma. |
| 28 | +* `!karma <foo>` prints the current karma for `<foo>`. |
| 29 | +* `<foo>++` increments karma for `<foo>`. |
| 30 | +* `<foo>--` decrements karma for `<foo>`. |
| 31 | + |
| 32 | +### Quotes manager ### |
| 33 | + |
| 34 | +* `!addquote <quote>` records a new quote. |
| 35 | +* `!quote` prints a random quote. |
| 36 | +* `!quote <number>` prints quote with index `<number>`. |
| 37 | +* `!lastquote` prints the last quote recorded. |
| 38 | +* `!searchquote <keywords>` prints the quotes matching `<keywords>`. |
| 39 | + |
| 40 | +### Respond as Cleverbot ### |
| 41 | + |
| 42 | +Talk to the bot by prefixing your messages with the bot's nickname and it shall respond as Cleverbot. |
| 43 | + |
| 44 | +Example: |
| 45 | + |
| 46 | +``` |
| 47 | + <Louie> Bluebot: What's the Answer to the Ultimate Question of Life, the Universe and Everything? |
| 48 | + <Bluebot> Louie: 42. |
| 49 | +``` |
| 50 | + |
| 51 | +### Wikipedia ### |
| 52 | + |
| 53 | +* `!wiki <query>` searches Wikipedia for `<wiki>`. |
| 54 | + |
| 55 | +### Urban Dictionary ### |
| 56 | + |
| 57 | +* `!ud <query>` searches Urban Dictionary for `<query>`. |
| 58 | + |
| 59 | +### LMGTFY ### |
| 60 | + |
| 61 | +* `!google <query>` generates a Let Me Google That For You search for `<query>`. |
| 62 | + |
| 63 | + |
| 64 | +Deployment instructions |
| 65 | +----------------------- |
| 66 | + |
| 67 | +1. Set up a new [Heroku](http://heroku.com/) app and add the free [MongoHQ](https://addons.heroku.com/mongohq) Sandbox add-on. |
| 68 | + |
| 69 | + ``` |
| 70 | + cd Bluebot |
| 71 | + heroku create |
| 72 | + heroku addons:add mongohq:sandbox |
| 73 | + ``` |
| 74 | + |
| 75 | +2. Tell Bluebot where to connect, what nickname to use, and optionally the required password to identify against the network's NickServ service. |
| 76 | + |
| 77 | + ``` |
| 78 | + heroku config:set BLUEBOT_SERVER=irc.myserver.com |
| 79 | + heroku config:set BLUEBOT_CHANNEL=#mychannel |
| 80 | + heroku config:set BLUEBOT_NICK=mybluebot |
| 81 | + heroku config:set BLUEBOT_PASSWORD=password # Optional |
| 82 | + ``` |
| 83 | + |
| 84 | +3. Push the code. |
| 85 | + |
| 86 | + ``` |
| 87 | + git push heroku master |
| 88 | + ``` |
| 89 | + |
| 90 | +4. Launch Bluebot. |
| 91 | + |
| 92 | + ``` |
| 93 | + heroku scale bluebot=1 |
| 94 | + ``` |
| 95 | + |
| 96 | +You can later shut down the bot by running `heroku scale bluebot=0` and relaunch it by running `heroku scale bluebot=1`. |
| 97 | + |
| 98 | + |
| 99 | +Local development |
| 100 | +----------------- |
| 101 | + |
| 102 | +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: |
| 103 | + |
| 104 | +1. Launch a local MongoDB server. |
| 105 | + |
| 106 | + ``` |
| 107 | + sudo service mongodb start # Ubuntu |
| 108 | + sudo /etc/init.d/mongodb start # Debian |
| 109 | + systemctl start mongodb # Arch Linux |
| 110 | + ``` |
| 111 | + |
| 112 | +2. Launch Bluebot. |
| 113 | + |
| 114 | + ``` |
| 115 | + ruby bluebot.rb |
| 116 | + ``` |
| 117 | + |
| 118 | +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`. |
0 commit comments