Permalink
Browse files

Add a help command

  • Loading branch information...
1 parent 6693555 commit 465293511e3e243fe2c82276ec90abacf4b8c982 @robarnold robarnold committed Jun 3, 2011
Showing with 12 additions and 1 deletion.
  1. +8 −1 README
  2. +4 −0 channels.js
View
9 README
@@ -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>
View
4 channels.js
@@ -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) {
@@ -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);
}
};

0 comments on commit 4652935

Please sign in to comment.