Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

224
Vistas
Make setTimeout() work after closing and opening an application

So atm I'm working on a Discord.js bot and have a command to ban people. The issue is if I turn the bot off and on again all the setTimeouts reset. So say, if I were to ban someone for a week, turn the bot off and on in between there, they will never automatically be unbanned.

setTimeout(function () {
                    memberTarget.roles.remove(bannedRole);
                }, ms(args[1]));

What other way could I use for it to remember to unban everyone after the bot has been turned on again?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You need to use database or data persist

Store bans data to database/data persist then set worker to check for unban (expiry).

Database https://www.tutorialsteacher.com/nodejs/data-access-in-nodejs

Data Persist https://www.npmjs.com/package/node-persist

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda