cloop reset bullshit

This commit is contained in:
Parker2991
2024-08-09 23:26:27 -04:00
parent 0b31c50a29
commit d571a1654e
5 changed files with 874 additions and 258763 deletions
+11 -1
View File
@@ -2,7 +2,12 @@ function command_loop (bot, options, config) {
bot.cloop = {
list: [],
add (command, interval) {
this.list.push({ timer: setInterval(() => bot.core.run(command), interval), command, interval })
setTimeout(() => {
this.list.push({ timer: setInterval(() => bot.core.run(command), interval), command, interval })
}, 10)
bot.on('end', () => {
this.clear()
})
},
remove (index) {
@@ -14,5 +19,10 @@ function command_loop (bot, options, config) {
this.list = []
}
}
/* bot.on('end', () => {
// clearInterval(this.list);
for (const cloop of this.list) console.log(cloop)
console.log('e')
})*/
}
module.exports = command_loop;