Skip to content

Instantly share code, notes, and snippets.

@mmalecki
Created December 22, 2011 14:53
Show Gist options
  • Save mmalecki/1510569 to your computer and use it in GitHub Desktop.
Save mmalecki/1510569 to your computer and use it in GitHub Desktop.
var irc = require('irc');
var client = new irc.Client(
'irc.freenode.net',
'threeLinksBot',
{ channels: ['#nodejitsu', '#nodebombrange'] }
);
client.on('message', function (from, to, msg) {
if (msg == '!threelinks') {
['handbook', 'docs', 'cheatsheet'].forEach(function (item) {
client.say(to, '!help ' + item);
});
}
});
@pksunkara
Copy link

A simple way to write and deploy an irc bot

npm install pibot -g
pibot threelinks && cd threelinks
vim scripts/3links.js
module.exports = function (chat, schemas, router) {
  chat.cmd(/3links/, function (n, c, m) {
    ['handbook', 'docs', 'cheatsheet'].forEach(function (item) {
      chat.say(c, '!help ' + item);
    });
  });
}

Edit config.json

jitsu deploy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment