3
0
mirror of https://github.com/reality/dbot.git synced 2025-01-12 04:52:36 +01:00

added rate limiting for large todo lists

This commit is contained in:
Scritches 2019-04-25 12:21:01 -04:00
parent 08922c8e67
commit 9a020e1dcb

View File

@ -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);
evt.reply((i + 1) + ': ' + todo);
i = i + 1;
if (i < myTodos.length) setTimeout(loop, 1000);
}
loop();
}
},