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

speak function bug, can't compile #388

Closed
BirkhoffLee opened this issue Jul 26, 2015 · 2 comments
Closed

speak function bug, can't compile #388

BirkhoffLee opened this issue Jul 26, 2015 · 2 comments

Comments

@BirkhoffLee
Copy link

node-irc version 0.3.12

Stack trace: http://pastebin.com/VhsiiEZ8

My code: http://pastebin.com/8qZzBnag

Any solution?

@Booster2ooo
Copy link

I think it's a matter of timing. The say method is called before the bot is connected or joined the channel. As there is no "connected" event, I think you should use the join event, and, only when the bot joined the channel, try to send the message.

Client.addListener("join#ysitd", function(nick, message) {
    if(nick == config.botName) {
        Client.say( "#ysitd", "hello" ); // No more error
    }
});

(edit: there is a 'connect' event, my bad)

@BirkhoffLee
Copy link
Author

Working solution. Thanks very much.

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

2 participants