ajette / DBStewardess

DBSteward's nagging alter ego embodied as a trolling IRC bot. Mostly started as a joke. Still a joke.
1 stars 3 forks source link

Unified triggers #4

Closed austinhyde closed 9 years ago

austinhyde commented 9 years ago

Basically just reorganizes into a trigger + action system. e.g.

triggers.push({
  mediums: ['irc', 'plug'],
  regex: /stupid\s+([\w\s]+)/i,
  action: function(dbs, data) {
    dbs.announce('Meeseek open ' + data.from + '\'s stupid ' + data.matches[1]);
  }
});

triggers.push({
  mediums: ['irc','plug'],
  regex: /(jira.*down)|(down.*jira)/i,
  action: action('isthejiradown')
});

I have some ideas that can be made possible with this refactor...

ajette commented 9 years ago

such hubot