making a quick change to main loop
This commit is contained in:
parent
f364e545cd
commit
99206049b4
17
src/bot.js
17
src/bot.js
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue