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

77
Views
User in voice channel

I am trying to make a Discord music bot, but message.member.voice.channel always returns null. I have seen many other questions like that on stackoverflow, but none of them seem to help me. Here's the code:

     function play(message, args) {
        const VoiceChannel = message.member.voice.channel;
        console.log(VoiceChannel);
        if(!VoiceChannel) message.reply('You need to be in a voice channel');
        if(!args.length) message.reply('You need to specify song name');
    }
    /*............................................................................*/
if(command === 'play'){
    play(message, args);
}

(args.length works as it should, unlike VoiceChannel)

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Assuming the current intents are GUILDS and GUILD_MESSAGES the problem must be coming from the missing GUILD_VOICE_STATES intent. Make sure to include it in the intents array and it should fix your problem.

about 4 years ago · Juan Pablo Isaza Report
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!