Command that runs every millisecond - Discord.js V13
How would I make a command that runs every millisecond to check my database for a timestamp that matches the Date.now() for my premium system?
11 Replies
• What's your exact discord.js
npm list discord.js
and node node -v
version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.that seems like a terrible idea because you might get ratelimited on your db
So how would I fix this?
just do it every minute or so
or every 10 minutes
I could do that, but how would I do it every certain amount of time?
setTimeout
or alternatively cron but i have no experience with that
or setInterval iirc
How would I use the setTimeout to do it every 10 minutes, instead of it doing it only once?
That has been removed from v13.
setInterval() global function
The setInterval() method, offered on the Window and Worker interfaces, repeatedly calls a function or executes a code snippet, with a fixed time delay between each call.
Oh that one
mb
that has nothing to do with djs
I was talking about client.setInterval