making a quick change to main loop

This commit is contained in:
Camille CAMBIUM 2023-05-06 02:42:17 +02:00
parent f364e545cd
commit 99206049b4
1 changed files with 15 additions and 2 deletions

View File

@ -137,11 +137,24 @@ async function rank(token = O_TOKEN){
}); });
} }
function sleep(ms) {
return new Promise((resolve) => {
setTimeout(resolve, ms);
});
}
async function routine() {
while (1) {
rank();
remove_notlogged();
await sleep(900000)
}
}
CLIENT.on('ready', () => { CLIENT.on('ready', () => {
console.log(`Logged in as ${CLIENT.user.tag}!`); console.log(`Logged in as ${CLIENT.user.tag}!`);
setInterval(rank, 900000);
setInterval(remove_notlogged, 900000);
console.log('started rank() interval !'); console.log('started rank() interval !');
routine();
}); });
CLIENT.login(D_TOKEN); CLIENT.login(D_TOKEN);