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

188
Vistas
Update the channel name several times

What I am trying to do is have a counter that is shown in the name of a channel.

I am aware of the Discord API rate-limits and that I can change the channel name 2 times in 10 minutes. I am aware that DiscordJS handles rate-limits internally by putting them in a queue.

The problem is right here, suppose the bot executes these lines consecutively:

myChannel.setName(1);
myChannel.setName(2);
myChannel.setName(3);
myChannel.setName(4);
myChannel.setName(5);

What happens is that the first two requests change the channel name and the other three go to queue. But after 10 minutes what happens is that the third and fourth requests are sent, while I would like to jump to the last one instead.

I was interested in finding out if there was a way to check the response to the request for a channel name change, in order to "intercept" the rate-limit and prevent it from going into the queue.

I have already thought of a solution for the problem itself:

setInterval(()=>{
    myChannel.setName(varDefSomewhereElse);
},10*60*1000);

but I want to solve the "problem" as efficiently as possible.

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

0

Two ways would likely work for this:

  1. try, catch:
try {
   myChannel.setName('asd')
}
catch (error) {
console.error(error)
// handle the error here
}
  1. .then
myChannel.setName(varDefSomewhereElse).then((c) => {
console.log(`Set to ${c.name}`)
})
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