Welcome to Rumpy

Rumpy is some kind of framework to make up your own jabber bot quickly. It uses ActiveRecord and XMPP4R.



  • Forget about xmpp-related things. Just set your login and password.

  • Forget about database-related things. Just set your database preferences.

  • Write logic using ActiveRecord and callback functions.

Getting started


Rumpy uses 3 configs:


Your bot's database preferences.


Your bot's responces. Append to existing keys more answers and use them like @lang['someanswer']. There MUST be at least 3 keys: hello (used when somebody adds bot), stranger (used when somebody trying to speak with bot without authorization) and authorized (used when bot gets authorization).


Your bot's jabber account settings.

Look at Examples section to see this configs.

ActiveRecord models

Implement your ActiveRecord models. You have to implement at least one model, for users.

Prepare your database

Your bot's class

Rumpy::Bot module

You have to mix in your bot's class the Rumpy::Bot module:

include Rumpy::Bot

Instance variables

Rumpy uses next instance variables:


Array of your models files.


Path to directory, containing all ruby config files. Default is config.


Symbol, that stands for main model. For example, if your main model is User, you have to set @main_model to :user. Default is :user.


Location of the file to which pid of detached process will be saved. Default is NameOfYourBotClass.downcase + '.pid'.


Location of the logfile. Default is STDERR.


Logging severity threshold. Possible values are the same the logger from standard library has. Default is Logger::INFO.


Number of old log files to keep, or frequency of rotation (daily, weekly or monthly). Default is 0.


Maximum logfile size. Default is 1048576.


If you need more accuracy in configuring logger, simply create one. It have to be compatible with standard library's logger.


Name of the bot. Default is name of bot's class.


Optional version of the bot. Default is 1.0.0.

Instance methods

Rumpy needs only three methods:

backend_func() -> [[receiver, message]*]

This optional method is running all the time in the loop. Returns array of pairs [receiver, message].

parser_func(msg) -> pars_result

This method parses any incoming message and returs results of parsing.

do_func(usermodel, pars_results) -> msg

This method uses results from parser_func, doing some stuff with model of user, from whom the message was received. Returns the answer to this user.

Hint: empty answer will not be sent.

Run bot

You can run your bot without detaching:

Rumpy.run YourBotClassName.new

Or with detaching:

bot = YourBotClassName.new
#To start your bot:
Rumpy.start bot
#To stop it:
Rumpy.stop bot


Look at


Feel free to contact us about any questions related to Rumpy.


Rumpy is released under the MIT license.