The bot currently running on freenode.net#SexManiac.
Coming soon. For now, the current plugins should give a good idea of how to write them.
core.startTime :: moment Object
Time when the bot was started up. Used by the metrics plugin to get accurate uptime information.
Address of the IRC server the bot is currently connected to.
Port of the IRC server the bot is currently connected to.
The bot's current channel, with a leading #
.
The bot's current nickname.
This is displayed when someone requests WHOIS information about the bot.
If undefined, the bot is not identified for its nickname. Otherwise, this is the password it used to identify itself.
If true, this bot has operator privileges on the channel.
If true, more debug information will be printed out as the bot runs.
Contains the data found in config.js
. This data is reloaded automatically when the file is changed.
Its structure is freeform.
A list of IRC reply codes, to compare with msg.rawCommand.
A list of IRC error codes, to compare with msg.rawCommand.
Utility functions that are useful for writing plugins.
Check if two strings are equal, while ignoring case.
Check if string a
begins with string b
, while ignoring case.
Check if string a
contains string b
, while ignoring case.
Split the string on groups of whitespaces, unless the words are surrounded by double quotes, in which case they are considered as a single "word" and the result is stripped of its quotes. Returns an array containing the resulting elements.
core.irc :: node-irc Client
The current IRC connection. node-irc
already provides a bunch of methods, following are the ones added
by smircbot's core.
Add a temporary listener that will remove itself when done
is called. done
is a function
given as an additional first argument to the listener.
Shorthand method for saying messages on the current channel.
Shorthand method for saying formatted messages on the current channel. The syntax is the same as node's util.format.
Set the bot's nickname with this method.
Change the bot nickname for the specified one for the duration of the function. As of now, it is likely to cause issues if used with asynchronous tasks.
A list of currently loaded plugins. It will be updated automatically as plugins get loaded or unloaded.
Triggered when the config has changed and has been reloaded.
Triggered when a plugin runs into an error while loading or unloading.
Triggered when a plugin is loaded.
Triggered when a plugin is unloaded.
Triggered when a message is sent on the bot's current channel. nick
and text
are strings,
while msg
is an object documented here.