sustatus thing

This commit is contained in:
reality 2016-01-29 17:55:03 +00:00
parent 9ca81e3094
commit e52699b211

View File

@ -127,47 +127,40 @@ var commands = function(dbot) {
} else if(notify.type == 'report') {
report++;
}
items[notify.time] = notify.message;
items[notify.time] = notify;
}
/*_.each(aliases, function(alias) {
if(notify.message.indexOf('banned ' + alias + ' ') != -1 ||
notify.message.indexOf(' ' + alias + ' has been unbanned') != -1 ||
notify.message.indexOf('issued a warning to ' + alias) != -1 ||
notify.message.indexOf('has quieted ' + alias) != -1 ||
notify.message.indexOf('has reported ' + alias + ' ') != -1) {
if(notify.type == 'ban') {
ban++;
if(notify.time > latest_ban.time) {
latest_ban = notify;
}
} else if(notify.type == 'unban') {
unban++;
if(notify.time > latest_unban.time) {
latest_unban = notify;
}
} else if(notify.type == 'quiet') {
quiet++;
} else if(notify.type == 'warn') {
warn++;
} else if(notify.type == 'report') {
report++;
}
items[notify.time] = notify.message;
}
});
*/
}, function() {
if(quiet != 0 || warn != 0 || report != 0) {
event.reply(user.primaryNick + ' has been warned ' + warn + ' times, quieted ' + quiet + ' times, and reported ' + report + ' times.');
var sTimes = _.keys(items).sort(function(a, b) {
return parseInt(a) - parseInt(b);
return parseInt(a.time) - parseInt(b.time);
});
if(sTimes.length < 70) {
event.reply('[reports]');
_.each(sTimes, function(time) {
if(items[time].type == 'report') {
event.reply('[' + moment(parseInt(time)).format('DD/MM/YYYY') + '] ' + items[time]);
}
});
event.reply('[quiets]');
_.each(sTimes, function(time) {
if(items[time].type == 'quiet') {
event.reply('[' + moment(parseInt(time)).format('DD/MM/YYYY') + '] ' + items[time]);
}
});
event.reply('[warns]');
_.each(sTimes, function(time) {
if(items[time].type == 'warn') {
event.reply('[' + moment(parseInt(time)).format('DD/MM/YYYY') + '] ' + items[time]);
}
});
event.reply('[bans]');
_.each(sTimes, function(time) {
if(items[time].type == 'ban' || items[time].type == 'unban') {
event.reply('[' + moment(parseInt(time)).format('DD/MM/YYYY') + '] ' + items[time]);
}
});
} else {
event.reply('There are too many to show without killing everyone :S');