Banner
Views: 723,120,638
Time:
22 users online: Adeleine, Aguni_, Arkon_Jon, Aurel509, BTD6_maker, o Deeke, DPBOX, ft029, Giftshaven, Kagami Hiiragi, o Luks, metalmimikyu, NeXuS15, Pikachu090, Poison, Sancles, o Sinc-X, Teyla, ThalesMangaka, The Hacking Yoshi, Tobio, UTF - Guests: 69 - Bots: 153Users: 37,825 (1,837 active)
Latest: Arkon_Jon
Tip: ExAnimation also works on sprites!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:
Code
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.
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: 24

Menu

Follow Us On

  • Facebook
  • Twitter
  • YouTube

Affiliates

  • Talkhaus
  • SMBX Community
  • GTx0
  • Super Luigi Bros
  • ROMhacking.net
  • MFGG
  • Gaming Reinvented