This commit is contained in:
Parker2991
2024-05-24 10:07:53 -04:00
commit 43be2bf86a
140 changed files with 49350 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
function command_loop_manager (bot, options) {
bot.cloop = {
list: [],
add (command, interval, list = true) {
setTimeout(() => {
const id = setInterval(() => bot.core.run(command), interval)
const thingsToPush = { id, interval, command, list }
bot.cloop.list.push(thingsToPush)
return thingsToPush
}, bot.options.Core.resetDelay)
},
remove (item) {
clearInterval(bot.cloop.list[item].id)
bot.cloop.list.splice(item, 1)
},
clear () {
for (const interval of bot.cloop.list) clearInterval(interval.id)
bot.cloop.list = []
}
}
}
module.exports = command_loop_manager