Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Plugins for IRC bot
JavaScript Racket
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
eval
.gitignore
8ball.js
README.md
caniuse.js
control.js
convert.js
crew.js
desc.js
domain.js
down.js
eval.js
factoid.js
flair.js
flip.js
github.js
google.js
ideone.js
jqapi.js
jqapi.json
rdio.js
seen.js
shared.js
spotify.js
tell.js
twitter.js
uptime.js
urbandictionary.js
wat.js
weather.js

README.md

ircjsbot-plugins

Plugins for ircjsbot.

Writing a plugin

Exports

Plugins have a basic interface of exports that should come at the end of the plugin file.

  • name : string that represents the name of the plugin. ex: "Google"
  • help : string that represents the help text for the plugin.
  • load : function that runs at the start of the plugin's execution.
  • unload : function that runs at the end of the plugin's execution.

ex:

    exports.name = "My Plugin";
    exports.help = "Here's a basic example of how my plugin works";
    exports.load = load;
    exports.unload = unload;

Register

Register a command with bot.register(); which is typically used with the load function.

/** Register a command
 *  @param  {string}    command   Command name, used as trigger
 *  @param  {RegExp}    regexp    Expression to match
 *  @param  {function}  handler   Command handler
 */

ex:

// google "any character", then run the speak function
bot.register("google", /(.+)/, speak);
Something went wrong with that request. Please try again.