putain de bot!
install
$ npm install putaindebot
require
var bot =
api
bot(options) > bot instance
creates a bot with the given options.
options.name
bot username
options.channel
channel to connect to
options.server
server to connect to
options.flood
object containing flood config with protection
& delay
keys.
options.debug
doesn't use irc feed but lets you write()
data in it for testing purposes.
bot.mention(regexp, callback) > bot
checks mentions followed by a string matching regexp
,
and executes callback
when a chunk matches.
mentions must start with options.name
.
bot.message(regexp, callback) > bot
checks message followed by a string matching regexp
,
and executes callback
when a chunk matches.
bot.leave(message, callback) > bot
leaves the current channel and executes callback
afterwards.
bot.join(callback) > bot
joins the current channel.
bot.use(plugin[, args…]) > bot
inits the given plugin in bot
, with the given optional args
.
callbacks
ed-209 is a stream-based bot.
to write data from mention
or message
callbacks, just use :
this
and it will go the write stream.
example
var ed209 = var bot = bot