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

'LOAD' event issue? #108

Closed
hemanth opened this issue Sep 21, 2012 · 3 comments
Closed

'LOAD' event issue? #108

hemanth opened this issue Sep 21, 2012 · 3 comments

Comments

@hemanth
Copy link

hemanth commented Sep 21, 2012

var irc = require('irc');
var client = new irc.Client('irc.freenode.net', 'myNick', {
    channels: ['#hmh'],
});
client.addListener('JOIN', function (msg) {client.send('hemanth',msg.nick)});

This does not send msg to hemanth when the users on 'JOIN'! missing something?

Also the below did not work

client.on('JOIN', function (data) {
  var message = 'Welcome to ' + data.receiver + ', ' + data.sender;
  client.say(data.receiver, message);
  console.log(data.receiver);
});
@katanacrimson
Copy link
Contributor

tried lowercasing "join" in the second example? it works fine for me still.

@hemanth
Copy link
Author

hemanth commented Sep 21, 2012

@damianb yes I had, made no difference then, but tried it again and bomb!

/Users/hemanth/node_modules/irc/lib/irc.js:548
                    throw err;
                          ^
Error: Uncaught, unspecified 'error' event.
    at Client.EventEmitter.emit (events.js:68:15)
    at Client.<anonymous> (/Users/hemanth/node_modules/irc/lib/irc.js:432:26)
    at Client.EventEmitter.emit (events.js:88:17)
    at Client.connect (/Users/hemanth/node_modules/irc/lib/irc.js:545:22)
    at Array.forEach (native)
    at Socket.Client.connect (/Users/hemanth/node_modules/irc/lib/irc.js:542:15)
    at Socket.EventEmitter.emit (events.js:88:17)
    at TCP.onread (net.js:390:31)

And on :

client.on('join', function (x,y,data) {
  var message = 'Welcome to ' + data.receiver + ', ' + data.sender;
  client.say(data.receiver, message);
  console.log(data.receiver);
});


/Users/hemanth/node_modules/irc/lib/irc.js:548
                    throw err;
                          ^
Error: Uncaught, unspecified 'error' event.
    at Client.EventEmitter.emit (events.js:68:15)
    at Client.<anonymous> (/Users/hemanth/node_modules/irc/lib/irc.js:432:26)
    at Client.EventEmitter.emit (events.js:88:17)
    at Client.connect (/Users/hemanth/node_modules/irc/lib/irc.js:545:22)
    at Array.forEach (native)
    at Socket.Client.connect (/Users/hemanth/node_modules/irc/lib/irc.js:542:15)
    at Socket.EventEmitter.emit (events.js:88:17)
    at TCP.onread (net.js:390:31)

Finally :

client.addListener('join', function(channel, who) {
    console.log('%s has joined %s', who, channel);
});

Worked 👨

@martynsmith
Copy link
Owner

If you check out the README.md on the front page, it explains how to catch those errors.

Glad to see you got it working though, I'm going to close this issue :-)

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