im new to javaScript and I'm writing a discord bot with discord .js i want to make a delay in process. setTimeout dont work because i want to delay in all of processes and but setTimeout just work for delay between 2 process. and i dont know how to use promise-async and await cause im new. is there anyway to do it? or how should i use async and await in discord bot making(i didnt write any function in bot codes)
and example from what i want :
for(var i = 0; i < 3; i++){
console.log(i);
sleep(5000);
} output:
0
//sleep 5s
1
//sleep 5s
2