Documentation

The configuration object is passed to the Tennu Client factory. It defines what you can do with your bot.

In the configuration object, undefined,null, and lack of property are treated equivalently.

IRC Socket Configuration

server
The server to connect to. For instance, irc.mibbit.net.
port
The port to connect to. By default, 6667.
connectOptions
Options object passed to the NetSocket.connect method when called. See io.js's documentation for what values are permitted. The values host and port are automatically set by the options server and port respectively. If you want to connect via IPv6, pass "family": 6 with this object.
password
The server for the password. Most servers don't have passwords, and this can be left undefined.
capabilities
An object for which wanted and required capabilities can be requested. The object has two properties, wants and requires which are both arrays of capability names. Tennu currently requires multi-prefix.
nicknames

The nicknames to join with. By default, we use ['tennubot'].

username
The username to use. By default, we use 'tennu'.
realname
Also known as the gecos, the realname is a field where you can put an arbitrary name, including spaces. By default, we set it to the current version of Tennu.

Other Configuration Values

channels

A list of channels to join once connected.

There is no checking to see if you've actually joined the channels.

nickserv
The user to send the identification message to. Defaults to 'nickserv'.
auth-password
The password to send in the identification message. If undefined, no identification message is sent.
plugins

A list of plugins to load. The order does not matter.

Any plugins that these plugins depend on must also be in this list.

command-trigger
The trigger command to look for in privmsgs to determine whether the message is a command or not. Defaults to "!". May be multiple characters. When passed the empty string, every PRIVMSG counts as a command.
command-ignore-list
A list of commands to not treat as commands. They will not show up in the !commands. Could be useful for disabling built-in commands from the help plugin, or selectively disabling commands from a plugin you only want a few commands from.
daemon
The IRCd used by the network you are connecting to. Some networks have IRCd specific features, such as UnrealIRCd having user mode +B for signifying a user is a bot or Twitch not accepting half of IRC. The value should be one of the ones in this array: ["unreal", "inspired", "twitch"]
disable-help

[Deprecated] Use "command-ignore-list": ["commands", "help"] instead.

Disables the help plugin. False by default.

tls

Uses a TLS socket instead of a non-TLS socket. Since most networks don't have valid SSL certifications, this setting does not require them to be. False by default.

When this setting is true, ipv6 and localAddress are ignored. It doesn't look possible to set them on TLS sockets in Node 0.10.x.

Dependency Management

The Tennu Client does not hardcode which dependencies it uses. You can pass an object with dependencies to replace the ones Tennu uses by default. While this object is in flux (for example, IrcOutputSocket is being replaced by a default plugin), there are three dependencies that you can rely on not changing: Logger, NetSocket, and IrcSocket.

A common example of replacing a dependency is changing the logger. By default, the logger outputs nothing. Let's change it so that everything prints to standard out.

var Tennu = require('Tennu');
var config = require('./config.json');

var print = console.log.bind(console);

var Logger = function () {
    return {
        debug: print,
        info: print,
        notice: print,
        warning: print,
        error: print,
        crit: print,
        alert: print,
        emerg: print
    }
};

var client = Tennu(config, {Logger: Logger});
client.connect();