Skip to content

Commit

Permalink
Namespace IRC connections. Separate out Freenode's client
Browse files Browse the repository at this point in the history
Signed-off-by: Kaustav Das Modak <[email protected]>
  • Loading branch information
Kaustav Das Modak committed Jun 20, 2015
1 parent 5b607d6 commit a7390ec
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 31 deletions.
44 changes: 24 additions & 20 deletions config.js.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,39 @@ module.exports = {
// IRC config
irc: {

// IRC server
server: "irc.freenode.net",
// Configuration for Freenode
freenode: {

// Bot nickname to attempt to use
nick: "applaitbot",
// IRC server
server: "irc.freenode.net",

// IRC port
port: 6697,
// Bot nickname to attempt to use
nick: "applaitbot",

// Bot nickname registered on IRC
userName: "applaitbot",
// IRC port
port: 6697,

// Bot real name
realName: "Applait Bot",
// Bot nickname registered on IRC
userName: "applaitbot",

// Bot account password on IRC
password: "",
// Bot real name
realName: "Applait Bot",

// Channels to join
channels: ["#applait"],
// Bot account password on IRC
password: "",

// SSL connection enable/disable
secure: true,
// Channels to join
channels: ["#applait"],

// Allow self-signed cert
selfSigned: true,
// SSL connection enable/disable
secure: true,

// Allow expired cert
certExpired: false
// Allow self-signed cert
selfSigned: true,

// Allow expired cert
certExpired: false
}

}
};
22 changes: 11 additions & 11 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
* Bottle server start
*/

var irc = require("irc");
var irc = { module: require("irc"), servers: {}, clients: {} };

var config = require("./config");

// Spin off IRC client instance
var irc_client = new irc.Client(config.irc.server, config.irc.nick, {
userName: config.irc.userName || "_applaitbot_",
realName: config.irc.realName || "Applait Bot",
password: config.irc.password,
port: config.irc.port || 6697,
channels: config.irc.channels || [],
secure: config.irc.secure || false,
selfSigned: config.irc.selfSigned || true,
certExpired: config.irc.certExpired || false,
sasl: config.irc.sasl || false,
irc.clients.freenode = new irc.module.Client(config.irc.freenode.server, config.irc.freenode.nick, {
userName: config.irc.freenode.userName || "_applaitbot_",
realName: config.irc.freenode.realName || "Applait Bot",
password: config.irc.freenode.password,
port: config.irc.freenode.port || 6697,
channels: config.irc.freenode.channels || [],
secure: config.irc.freenode.secure || false,
selfSigned: config.irc.freenode.selfSigned || true,
certExpired: config.irc.freenode.certExpired || false,
sasl: config.irc.freenode.sasl || false,
autoRejoin: true,
autoConnect: true,
showErrors: true,
Expand Down

0 comments on commit a7390ec

Please sign in to comment.