Skip to content

Instantly share code, notes, and snippets.

@AlisamfP
Created September 24, 2014 18:15
Show Gist options
  • Save AlisamfP/5c65286e641b7ff768c2 to your computer and use it in GitHub Desktop.
Save AlisamfP/5c65286e641b7ff768c2 to your computer and use it in GitHub Desktop.
var irc = require('irc');
var config = {
server: 'irc.freenode.net',
name: 'testBot',
channels: '#testRoom'
};
var bot = new irc.Client(config.server, config.name, { channels: [config.channels] });
bot.addListener('error', function(err){
console.log('error: ' + err);
});
bot.addListener('message', function(to, from, msg){
console.log(from + ': ' + msg);
});
bot.join(config.channels, function(){
bot.say(config.channels, 'Hello!');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment