Views: 778,238,572
5 users online: Darkslayer, I don't know a good name., marcuse, NGB, vladislav4 - Guests: 28 - Bots: 121 Users: 40,825 (1,695 active)
Latest: th3k1ng1337
Tip: Only use a few different kinds of enemies per level. Overdoing it can make your level feel disjointed and clunky.Not logged in.
I'm stuck in JavaScript
Forum Index - Donut Plains - Computers & Technology - I'm stuck in JavaScript
Pages: « 1 »
So currently I'm working on a Discord Bot for my friend because he saw me make mine and thought it was cool. I promised I would do as much as I could, excluding sound effects. And I can't seem to make an interval using node. He wants a stupid message every 5 minutes and I can't for the life of me figure out how to do this. If you would be so kind please help me out. :)
Reading through the Node.js documentation really quick, it's exposed exactly the same way as in the browser:
var timeout = setInterval(() => {

	// Your code here
}, 300000)

setInterval() makes it happen every 5 minutes automatically until cancelled, if you want it to happen just once, use setTimeout().

timeout would be the ID of the interval, which you don't need unless you plan to cancel the interval in the future.
300000 miliseconds are 5 minutes.

I can't test if this actually works because I don't have a node setup anywhere, but that should be all there is to it, and it'd make sense for them to mirror the browser's way of exposing timers so that it's familiar to everyone.

Your layout has been removed.
Pages: « 1 »
Forum Index - Donut Plains - Computers & Technology - I'm stuck in JavaScript

The purpose of this site is not to distribute copyrighted material, but to honor one of our favourite games.

Copyright © 2005 - 2019 - SMW Central
Legal Information - Privacy Policy - Link To Us

Total queries: 7


Follow Us On

  • YouTube
  • Twitch
  • Twitter


  • Talkhaus
  • SMBX Community
  • GTx0
  • Super Luigi Bros
  • MFGG
  • Gaming Reinvented