3
0
mirror of https://github.com/reality/dbot.git synced 2024-11-24 04:49:25 +01:00

async output next 1s delay

This commit is contained in:
reality 2015-01-19 22:28:18 +00:00
parent e5b8034e0f
commit 552b87c29e

View File

@ -1,5 +1,6 @@
var _ = require('underscore')._,
moment = require('moment');
moment = require('moment'),
asynx = require('async');
var commands = function(dbot) {
var commands = {
@ -113,11 +114,12 @@ var commands = function(dbot) {
if(quiet != 0 || warn != 0 || report != 0) {
event.reply(user.primaryNick + ' has been warned ' + warn + ' times, quieted ' + quiet + ' times, and reported ' + report + ' times.');
_.each(_.keys(items).sort(function(a, b) {
async.eachSeries(_.keys(items).sort(function(a, b) {
return parseInt(new Date(a).getTime()) - parseInt(new Date(b).getTime());
}), function(time) {
}), function(time, next) {
event.reply('[' + moment(parseInt(time)).format('DD/MM/YYYY') + '] ' + items[time]);
});
setTimeout(next, 1000);
}, function(){});
if(ban) {
event.reply(user.primaryNick + ' was banned on ' + new Date(ban).toUTCString());