Fixed logging and added check for whois query failure

This commit is contained in:
lanxu 2019-05-15 21:21:27 +03:00
parent e3f9491dcc
commit 68d9d39b00

7
app.js
View File

@ -27,7 +27,7 @@ var logger = new (winston.Logger)({
new (winston.transports.Console)(), new (winston.transports.Console)(),
new (winston.transports.DailyRotateFile)({ new (winston.transports.DailyRotateFile)({
filename: logDirectory + '/ircbot.log', filename: logDirectory + '/ircbot.log',
datePattern: '.yyyy-MM-dd', datePattern: 'YYYY-MM-DD',
maxsize: 20000 maxsize: 20000
}) })
] ]
@ -41,7 +41,7 @@ if(!config.irc.connect) {
var isConnected = false var isConnected = false
// Start client // Start client
var client = new irc.Client(config.irc.server, config.irc.nick, { var client = new irc.Client(config.irc.server, config.irc.nick, {
debug: true, debug: false,
channels: config.irc.channels, channels: config.irc.channels,
//floodProtection: true, //floodProtection: true,
//sasl: true, //sasl: true,
@ -100,10 +100,11 @@ client.addListener('join', function(channel, who) {
for(var memberNick in members) { for(var memberNick in members) {
var member = members[memberNick]; var member = members[memberNick];
if(typeof result.host !== 'undefined' && typeof result.user !== 'undefined') {
if(result.host.match(member.host) && result.user.match(member.user)) { if(result.host.match(member.host) && result.user.match(member.user)) {
client.send('MODE', channel, '+o', result.nick); client.send('MODE', channel, '+o', result.nick);
} }
}
} }
}); });