extensible node.js jabber bot
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
plugins
.gitignore
README.md
config.js-dist
run.js

README.md

zombi

zombi is a simple extensible bot for Jabber.

zombi is not maintained.

Requirements

Running zombi

Copy config.js-dist over to config.js and edit in the appropriate values for your Jabber account.

  • username is the user and domain of your account.
  • password is the password of the user you want to act as your bot.
  • rooms is an array of the rooms you want to connect to. If you want to connect to 'main' and 'non-main' it would be ['main', 'non-main']
  • nickname is a name you can give to your bot
  • verbose is if you want extra status messages

Run zombi:

node run.js

Plugins

zombi is controlled via plugins in /plugins, and as such, has an easy to use plugin interface.

Plugins consist of a singular function with a command that consists of at least three variables:

  1. name - Name of the plugin.
  2. regex - Regex applied to messages to capture and execute this command. This can be an array of regular expressions if your plugin requires multiple triggers.
  3. callback - Code to execute for this command.

The order of arguments for the callback are as such:

  • body - The regex matched message body
  • stanza - The stanza object as returned from XMPP.
  • zombi - The instance of the zombi object.

The following is a simple plugin to respond to "ping" with "pong".

/**
 * zombi plugin to respond to a 'ping'.
 *
 */
function Command() {
  this.name = "ping";
  this.regex = /ping/;
  this.description = "Respond to a ping.";
  this.callback = function(body, stanza, zombi) {
    zombi.say('pong', stanza);
  }
};

exports.Command = Command;

Mentions