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

83
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
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