forked from GitHub/dbot
sustatus thing
This commit is contained in:
parent
9ca81e3094
commit
e52699b211
@ -127,47 +127,40 @@ var commands = function(dbot) {
|
|||||||
} else if(notify.type == 'report') {
|
} else if(notify.type == 'report') {
|
||||||
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() {
|
}, function() {
|
||||||
if(quiet != 0 || warn != 0 || report != 0) {
|
if(quiet != 0 || warn != 0 || report != 0) {
|
||||||
event.reply(user.primaryNick + ' has been warned ' + warn + ' times, quieted ' + quiet + ' times, and reported ' + report + ' times.');
|
event.reply(user.primaryNick + ' has been warned ' + warn + ' times, quieted ' + quiet + ' times, and reported ' + report + ' times.');
|
||||||
|
|
||||||
var sTimes = _.keys(items).sort(function(a, b) {
|
var sTimes = _.keys(items).sort(function(a, b) {
|
||||||
return parseInt(a) - parseInt(b);
|
return parseInt(a.time) - parseInt(b.time);
|
||||||
});
|
});
|
||||||
|
|
||||||
if(sTimes.length < 70) {
|
if(sTimes.length < 70) {
|
||||||
|
event.reply('[reports]');
|
||||||
_.each(sTimes, function(time) {
|
_.each(sTimes, function(time) {
|
||||||
|
if(items[time].type == 'report') {
|
||||||
event.reply('[' + moment(parseInt(time)).format('DD/MM/YYYY') + '] ' + items[time]);
|
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 {
|
} else {
|
||||||
event.reply('There are too many to show without killing everyone :S');
|
event.reply('There are too many to show without killing everyone :S');
|
||||||
|
Loading…
Reference in New Issue
Block a user