A secretary manifested as an IRC bot
JavaScript

README.md

Sectery Build Status Coverage Status

Usage

Install the dependencies:

npm install

Fire it up:

node sectery

Development

Run the tests

npm install
npm test

Observe that they all pass.

Add a new test

For the feature you'd like to develop, write a new test for it in test/sectery_test.js:

'emoji': function(test) {
  test.expect(2);
  client._message('testuser', '#test-channel', 'foo bar table flip baz');
  test.equal(client._lastSaid().to, '#test-channel');
  test.equal(client._lastSaid().message, '╯°□°)╯︵ ┻━┻');
  test.done();
},

Run the tests again

npm test

Observe that your new test fails.

Make your test pass

lib/listeners/message/emoji.js:

'use strict';

function messageListener(db, from, channel, message) {
  if (/table\s*flip/.test(message) || /flip\s*table/.test(message)) {
    return [ { to: channel, message: '╯°□°)╯︵ ┻━┻' } ];
  }
}

module.exports = messageListener;