Each and every option listed below is optional. Running tmi.js without options will result as an anonymous connection to Twitch and you will have to join the channels manually.
options: (Optional)
debug: Boolean - Show debug messages in console (Default: false)connection: (Optional)
random: String - Server type / cluster (Default: "chat" - Can be "chat", "group" or "event")server: String - Connect to this server (Do not set if you are using a random server)port: Integer - Connect on this port (Do not set if you are using a random server)reconnect: Boolean - Reconnect to Twitch when disconnected from server (Default: false)timeout: Integer - Disconnect from server if not responding (Default: 9999 (ms))identity: (Optional)
username: String - Username on Twitchpassword: String - OAuth password on Twitchchannels: Array - List of channels to join when connected (Default: [])
logger: Object - Custom logger with the methods info, warn, and error
// Do NOT include this line if you are using the built js version!
var irc = require("tmi.js");
var options = {
options: {
debug: true
},
connection: {
random: "chat",
reconnect: true
},
identity: {
username: "Schmoopiie",
password: "oauth:a29b68aede41e25179a66c5978b21437"
},
channels: ["#schmoopiie"]
};
var client = new irc.client(options);
// Connect the client to the server..
client.connect();