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

284
Vistas
How would I automatically move someone back to a channel?

So, basically I have some code setup and I don't see the issue with the code. But basically what I want it to do is if the previous voice channel of the member that switched channels was "DO NOT DISTURB" it will move them back to the "DO NOT DISTURB" voice channel. What have I done wrong? I get 0 errors in console.

    client.on('voiceStateUpdate', async (oldState, newState) => {
        let newUserChannel = newState.channel;
        let oldUserChannel = oldState.channel;

       if(oldUserChannel.id === "894024223088050176") {
                    var dndChannel = oldState.guild.channels.cache.find(ch => ch.type === "voice" && ch.name === "DO NOT DISTURB")
                    newState.member.voice.setChannel(dndChannel)
                }
      });

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

0

Double check if your channelid in the if condition is right and use

Guild.channels.fetch(channelId)

insted of Guild.channels.cache.find().

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