Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't get chat messages #384

Closed
necm1 opened this issue Jul 18, 2015 · 2 comments
Closed

can't get chat messages #384

necm1 opened this issue Jul 18, 2015 · 2 comments

Comments

@necm1
Copy link

necm1 commented Jul 18, 2015

Hi!
I tried to get the chat messages, but I can't see the messages in the console... Why?

var net = require('irc');
var io = require('socket.io');
var formatter = require('dateformat');
var now = new Date;

io.listen(1337);
log("Starting bot...");

bot.addListener('error', function(message) {
console.error('ERROR: %s: %s', message.command, message.args.join(' '));
});

//GET MESSAGES
bot.addListener('message', function(from, to, text, msg) {
log(from);
log(to);
log(msg);
log(text);
});

//IF USER JOINED TO THE BROADCAST => LOG
bot.addListener('join', function(channel, user) {
log(user + " joined");
});

//DISCONNECT
bot.addListener('part', function(channel, who, reason) {
console.log('«%s» has left %s: %s', who, channel, reason);
});

//IF USER GOT KICKED BY OP
bot.addListener('kick', function(channel, who, by, reason) {
console.log('«%s» was kicked from %s by %s: %s', who, channel, by, reason);
});

//CHECK IF BOT CONNECTED TO IRC CHAT
bot.addListener('connect', function(retryCount, callback) {
log("Successfully connected!");
})

console output:

18 Jul 22:13:14 - Starting bot...
18 Jul 22:13:14 - Sending irc NICK/USER
18 Jul 22:13:14 - SEND: NICK :xxx
18 Jul 22:13:14 - SEND: USER xxxxx 8 * :xxx
18 Jul 22:13:14 - Successfully connected!
18 Jul 22:13:14 - SEND: JOIN :#xxxx
18 Jul 22:13:14 - xxxx joined
18 Jul 22:13:15 - SEND: MODE :#xxxx

@BirkhoffLee
Copy link

debug mode not on(i guess)

@ghost
Copy link

ghost commented Sep 11, 2015

log is not defined or function or a command.

Please close.

@jirwin jirwin closed this as completed Mar 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants