Justbot: a helpful IRC bot with user authentication and authorization
Jake Teton-Landis <email@example.com> copyright 2012, 2013. all rights reserved
see DEVELOPERS for information about hacking on Justbot
Justbot is an IRC bot based on Cinch, a threaded IRC bot framework. You can discover the different features availible to Justbot users looking at
Here are a few of the better features, back in 2012 before Twitter did some API stuff:
- tweet right from irc by typing
!tweet <update text>
- follow all your Rescomp freinds at once by typing
Justbot: twitter followall
- bask in the warm glow of the social as Justbot prints tweets to ## in 3-color glory!
There are a few components that are not Cinch-dependent, such as the DataMapper users support, but they are ment to be used from Cinch plugins.
In order of importance:
- Ruby 1.9.1 or better. Tested to work with 2.0.0-p247 as well.
- Cinch framework (
gem install cinch) is the core library for the bot.
- Two (!) gems are used for interfacing with the Twitter APIs:
twitter_oauthis used during user creation to get oauth tokens and twitter_id
- Users support depends on DataMapper for ORM, although only only 'dm-core', 'dm-migrations' and
'dm-transactions' are required at present. It'll try to connect to a sqlite database in
configby default. Edit
- Tweets are run through HTMLentities before being displayed, so you'll need to have that gem installed, too
rspec' or remove the tests.
, : these modules have inline Rspec tests. Install '
steam-condenser', an apllingly poor gem for interacting with Valve Software's products.
: requires '
- This documentation is generated using YARD but really if you like Ruby
(or even use it at all) you should have
yard server --gemsrunning somewhere.
$ cd /path/to/bot/ $ ruby bin/justbot
Help for IRC Users
/msg <botname> help will give you an overview of the active plugins in a bot
> help Help for Justbot plugins: Administration, Friendly, Help, Registration, Sessions, Tweet, TwitterFeed, Steam help in Help help [PLUGIN] [COMMAND] show help information for the bot, for PLUGIN in bot, or for a COMMAND in PLUGIN
You can then query to get help about specific plugins. Plugin help uses prefix-based matching,
help admin' will show the help for the
The confusing thing is, commands are not called prefixed by module name. For example, if you wanted
to get help about command
twitter follow in module
TwitterFeed you might type the following:
> Justbot: help twit twitter follow or > /msg Justbot help twit twitter follow
but to actually request the command, you would type
> Justbot: twitter follow @justbotirc or > /msg Justbot twitter follow @justbotirc
Source Code Access
Justbot is now open-source! I still need to move the Twitter modules to
read config from environemnt variables, but for now the config file for
config/twitter.yaml just has my personal Oauth keys
Visit Justbot online at https://github.com/justjake/justbot
I need to get these things done for Justbot to be usable.
Refactor user registration so that it does not depend on Twitter oauth. A user should be able to register without twitter
Usermodel so that Twitter accounts are seperate from Justbot users. Add
TwitterAccountmodel with 1:1 link to
Update Twitter-related modules to coordinate thier Oauth token retrieval efforts to load tokesn from environment variables. Twitter plugins should automatically de-activate themselves if these environment variables are undefined.
Project Idea: SaltyBot
Provide an IRC interface to SaltyBet. The bot will manage a shared SaltyBet user account with Illuminati privelages. It should post the names and rankings of contenders each time a new match occurs.
Users in the channel vote on which contender SaltyBot should place its bet on.
SaltyBot> Round 9245 $4570 SaltyBucks SaltyBot> ================================VS============================= SaltyBot> Vegeta SSJ4 Jonny Cage SaltyBot> 12/0/2 - 85.71% win, 70% conf 6/2/0 - 75% win, 50% conf ... jitl> SaltyBot: bet vegeta gchao> SaltyBot: bet jonny ... SaltyBot> Voting results: 1 for "Vegeta SSJ4", 1 for "Jonny Cage" SaltyBot> Betting $100 on "Vegeta SSJ4" (better win ratio in tie) ... SaltyBot> TO THE SALT MINES WITH YOU: sanic4lyfe ($50), bobparr ($9001), margretThatcher ($299), IvanTheTerrible ($400) ... SaltyBot> Round 9245 over: Jonny Cage wins! SaltyBot> jitl: Apply yourself. This is your fourth bad call today. SaltyBot> gchao: Don't get cocky, kid.
When ties occur in voting, SaltyBot will bet less money, and bet on the better of the two contendors.