How can I get the timer to run again whenever the value of i increases?
this is my code:
while (i < tekrarsayisi){ await setTimeout(function(){ message.channel.send("message"); }, 10000); i++ }
The timer in my code works once. how can i get this to work when it back to top ?
You cannot await setTimeout() directly, try this
setTimeout()
while (i < tekrarsayisi){ await new Promise(resolve => setTimeout(resolve, 10000)); message.channel.send("message"); i++ }
1.4m articles
1.4m replys
5 comments
56.9k users