Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

141
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda