Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

140
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!