Permalink
Browse files

new config option: handle

  • Loading branch information...
1 parent 58c7e01 commit 86fac816353f445a381c979793a5a87708a01755 @arturadib committed Apr 17, 2012
Showing with 3 additions and 1 deletion.
  1. +1 −0 bootstrap/config.json
  2. +2 −1 lib/server.js
View
@@ -1,5 +1,6 @@
{
"name": "Bot.io (Main)",
+ "handle": "botio",
"script_timeout": 3600,
"private_dir": "./private",
"public_dir": "./public",
View
@@ -232,7 +232,8 @@ app.post('/', function(req, res) {
}
var commentBody = payload.comment.body,
- match = commentBody.match(/^\/botio *(\w*)/m);
+ handle = config.handle || 'botio',
+ match = commentBody.match(new RegExp('/^\/'+handle+' *(\w*)/m'));
if (!match) {
debug('not a bot command, skipping comment:', payload.comment.url);

0 comments on commit 86fac81

Please sign in to comment.