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

146
Vistas
Discord music bot js

i recently started to code a discord bot with javascript. However i am currently stuck at the moment. I am trying to check if the user is already in a voice channel. after that i want to check if my bot is alrady in the voice channel if not, he needs to join.

My code break on mutliple levels.

The code where it checks if the user is connected to a voice channel does not seem to work, i am in a voice channel it triggers the code anyway.

if(!args[1]){
    msg.channel.send("you need to provide a link")
  return;
}

I keep getting the join() is not a func but i am pretty sure it is, but somehow it does not work.

function play(connection, msg){
    var server = servers[msg.guild.id]
  
  server.dispatcher = connection.playStream(ytdl(server.queue[0], { filter: "audioonly" }))
  
  server.queue.shift()
  
  server.dispatcher.on("end", function(){
    if(server.queue[0]){
        play(connection, msg)
    } else {
        connection.disconnect()
    }
  })
}
about 4 years ago · Juan Pablo Isaza
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