A simple IRC bot implemented on top of IRC-js, with support for plug-ins.
npm install irc-support-bot
Soon, anyway.
The main support bot in the #html channel on Freenode IRC uses irc-support-bot. He listens to the name rivvles and his triggers are `
and ]
. He also has his own channel, #rivvles, which can be used to discuss irc-support-bot as well.
See the examples.
See the examples. Better docs later. Maybe.
<trigger><factoid-name>
, e.g. !hello world
<trigger><command-name>[/<flags>][ <arguments>]
, e.g. !search/n foo bar baz
.
!foo @ johndoe
!foo > johndoe
!foo % johndoe
@
addresses johndoe
in the channel or query of origin; >
sends the message by query; %
sends the message by notice.
!foo # this is just a comment
!foo @ johndoe # this is just a comment
A plug-in is a Node.js module. Assign a function to the module.exports
object; the function is called with this
set to the bot instance. A plug-in has full and unlimited access to the bot instance; no hand-holding for now.
Register a special command by calling this.register_special_command
with a configuration object as its sole argument; see any of the official plug-ins for examples.
You can also register an incoming message callback by calling this.register_message_callback
with a function as its sole argument. See the irc-support-bot-admin official plug-in for an example. You can use this to audit incoming messages. Return false
to silently stop processing immediately. This is used in the admin plug-in to ignore users that are on the ignore list.
irc-support-bot has several official plug-ins available for your convenience. The 'admin' module is probably essential, but for modularity's sake, it is still provided as an optional plug-in. There's a list on the wiki.
This is a rewrite in LiveScript (from CoffeeScript), but identifiers relevant to the plug-in API still use snake-case. I'll probably want to change this to kebab-case at some point, like other identifiers.
UNLICENSE yo.