mirror of
https://github.com/jwinterm/node-tip-bot.git
synced 2026-11-15 09:24:08 +01:00
allow help and terms commands without being identified
This commit is contained in:
+11
-12
@@ -153,6 +153,17 @@ client.addListener('message', function(from, channel, message) {
|
|||||||
// if pms, make sure to respond to pms instead to itself
|
// if pms, make sure to respond to pms instead to itself
|
||||||
if(channel == client.nick) channel = from;
|
if(channel == client.nick) channel = from;
|
||||||
|
|
||||||
|
// comands that don't require identifying
|
||||||
|
if(command == 'help' || command == 'help')
|
||||||
|
{
|
||||||
|
for(var i = 0; i < settings.messages[command].length; i++) {
|
||||||
|
var message = settings.messages[command][i];
|
||||||
|
client.say(channel, message.expand({}));
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// if not that, message will be undefined for some reason
|
// if not that, message will be undefined for some reason
|
||||||
// todo: find a fix for that
|
// todo: find a fix for that
|
||||||
var msg = message;
|
var msg = message;
|
||||||
@@ -320,18 +331,6 @@ client.addListener('message', function(from, channel, message) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case 'help':
|
|
||||||
for(var i = 0; i < settings.messages.help.length; i++) {
|
|
||||||
var message = settings.messages.help[i];
|
|
||||||
client.say(channel, message.expand({}));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 'terms':
|
|
||||||
for(var i = 0; i < settings.messages.terms.length; i++) {
|
|
||||||
var message = settings.messages.terms[i];
|
|
||||||
client.say(channel, message.expand({}));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
+3
-2
@@ -1,5 +1,6 @@
|
|||||||
var express = require('express')
|
var express = require('express')
|
||||||
, swig = require('swig');
|
, swig = require('swig')
|
||||||
|
, path = require('path');
|
||||||
|
|
||||||
module.exports.app = function(port, coin, settings, winston) {
|
module.exports.app = function(port, coin, settings, winston) {
|
||||||
var app = express();
|
var app = express();
|
||||||
@@ -14,7 +15,7 @@ module.exports.app = function(port, coin, settings, winston) {
|
|||||||
return success;
|
return success;
|
||||||
}));
|
}));
|
||||||
|
|
||||||
var tpl = swig.compileFile(__dirname + '/views/index.html');
|
var tpl = swig.compileFile(path.join(__dirname, '/views/index.html'));
|
||||||
app.get('/', function(req, res) {
|
app.get('/', function(req, res) {
|
||||||
var accounts = [];
|
var accounts = [];
|
||||||
coin.listAccounts(5, function(err, reply) {
|
coin.listAccounts(5, function(err, reply) {
|
||||||
|
|||||||
Reference in New Issue
Block a user