Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add a help command

  • Loading branch information...
commit 465293511e3e243fe2c82276ec90abacf4b8c982 1 parent 6693555
robarnold robarnold authored
Showing with 12 additions and 1 deletion.
  1. +8 −1 README
  2. +4 −0 channels.js
9 README
View
@@ -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 channels.js
View
@@ -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);
}
};
Please sign in to comment.
Something went wrong with that request. Please try again.