mirror of
https://github.com/reality/dbot.git
synced 2025-01-12 13:02:47 +01:00
added rate limiting for large todo lists
This commit is contained in:
parent
08922c8e67
commit
9a020e1dcb
@ -52,10 +52,16 @@ var todo = function(dbot) {
|
||||
evt.reply(dbot.t('empty-list', {'user': evt.user}));
|
||||
} else {
|
||||
evt.reply('[' + evt.user + ']:');
|
||||
for (let i = 0; i < myTodos.length; i++) {
|
||||
var i = 0;
|
||||
|
||||
function loop() {
|
||||
var todo = myTodos[i];
|
||||
evt.reply((i + 1) + ': ' + todo);
|
||||
i = i + 1;
|
||||
if (i < myTodos.length) setTimeout(loop, 1000);
|
||||
}
|
||||
|
||||
loop();
|
||||
}
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user