3
0
mirror of https://github.com/reality/dbot.git synced 2024-11-27 14:29:29 +01:00
This commit is contained in:
reality 2015-03-14 13:47:31 +00:00
parent 65d1c24adf
commit 8070875937

View File

@ -85,8 +85,8 @@ var commands = function(dbot) {
dbot.api.users.resolveUser(event.server, user, function(err, user) { dbot.api.users.resolveUser(event.server, user, function(err, user) {
if(user) { if(user) {
var ban = 0, var ban = 0,
latest_ban = 0, latest_ban = {'time':0},
latest_unban = 0, latest_unban = {'time':0},
unban = 0, unban = 0,
quiet = 0, quiet = 0,
warn = 0, warn = 0,
@ -133,7 +133,7 @@ var commands = function(dbot) {
}); });
if(latest_ban != 0) { if(latest_ban != 0) {
if(latest_unban == 0 || (latest_unban != 0 && latest_unban.time < latest_ban.time)) { if(latest_unban.time == 0 || (latest_unban.time < latest_ban.time)) {
event.reply('Current Ban Status: Banned for ' + moment(latest_ban.time).fromNow() + ' (since ' + moment(parseInt(latest_ban.time)).format('DD/MM/YYYY') + ')'); event.reply('Current Ban Status: Banned for ' + moment(latest_ban.time).fromNow() + ' (since ' + moment(parseInt(latest_ban.time)).format('DD/MM/YYYY') + ')');
event.reply('Reason: ' + latest_ban.message); event.reply('Reason: ' + latest_ban.message);
} else { } else {