Created
November 1, 2011 22:50
-
-
Save tomyan/1332201 to your computer and use it in GitHub Desktop.
irc client library interface
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var circus = require('../lib/circus'); | |
var channel = process.argv[2]; | |
if (! channel) { | |
console.log('channel reqired'); | |
process.exit(1); | |
} | |
var client = new circus.Client; | |
client.connect('nobot', 'irc.freenode.net').then(function (connection) { | |
connection.signals.messaged.add(function (message, agent) { | |
agent.sendMessage('no'); | |
}); | |
connection.join(channel).then(function (channel) { | |
channel.signals.messaged.add(function (message, agent, channel) { | |
if (message = connection.messageAddressedToMe(message)) { | |
channel.sendMessage(agent.nick + ': no'); | |
} | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment