Skip to content

Commit

Permalink
Add a help command
Browse files Browse the repository at this point in the history
  • Loading branch information
robarnold committed Jun 3, 2011
1 parent 6693555 commit 4652935
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
9 changes: 8 additions & 1 deletion README
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
Nothing to see here...move along.
afrosdwilsh's IRC manifestation.

Things it may understand if addressed in the channel:
watch <tree>
unwatch <tree>
watch <changset> on <tree> (for <person>)
<email> is <name>
I am <email>
4 changes: 4 additions & 0 deletions channels.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@ ChannelController.prototype = {
committers.add(email, name);
this.channel.tell(from)("thank you!");
},
help: function (from) {
this.channel.tell(from)("See https://github.com/sdwilsh/tree-bot/blob/master/README for a list of commands");
},
handleCommand: function (from, text) {
var self = this;
function tryCommand(matcher, cb) {
Expand All @@ -183,6 +186,7 @@ ChannelController.prototype = {
tryCommand(/^(.+) is (.+)$/, this.identify);
tryCommand(/^(.+) am (.+)$/, this.identify);
tryCommand(/^watch ([A-Fa-f0-9]{12}) on ([A-Za-z-]+)(?: for (.+))?/, this.watchTree);
tryCommand(/^h[ae]lp/, this.help);
}
};

Expand Down

0 comments on commit 4652935

Please sign in to comment.