mirror of
https://github.com/jwinterm/node-tip-bot.git
synced 2026-10-17 05:41:42 +02:00
bot now will join only when identified
This commit is contained in:
+10
-1
@@ -67,7 +67,6 @@ var client = new irc.Client(settings.connection.host, settings.login.nickname, {
|
||||
port: settings.connection.port,
|
||||
secure: settings.connection.secure,
|
||||
|
||||
channels: settings.channels,
|
||||
userName: settings.login.username,
|
||||
realName: settings.login.realname,
|
||||
|
||||
@@ -427,3 +426,13 @@ client.addListener('message', function(from, channel, message) {
|
||||
}
|
||||
});
|
||||
});
|
||||
client.addListener('notice', function(nick, to, text, message) {
|
||||
if(nick && nick.toLowerCase() == 'nickserv') {
|
||||
winston.info('%s: %s', nick, text);
|
||||
if(text.match(/^You are now identified/)) {
|
||||
for (var i = settings.channels.length - 1; i >= 0; i--) {
|
||||
client.join(settings.channels[i]);
|
||||
};
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user