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

114
Views
DiscordJS Voice Channel Info Does Not Update

My code:

// not very relevant stuff
const {
  SlashCommandBuilder
} = require('@discordjs/builders');
const {
  MessageEmbed
} = require('discord.js');
const tip = require('../../tips/randomtip')
const fs = require('fs')

{
  const status = require('./status')
  if(status.inUsed = true){
    status.inUsed = false
    fs.writeFileSync( './commands/music/status.json', JSON.stringify(status,null,2))
  }
}


// very relevant stuff
module.exports = {
  data: new SlashCommandBuilder()
  .setName('join')
  .setDescription('Join the voice channel you are in'),
  async execute(interaction) {

    const voice = interaction.member.voice
    // console.log(voice)
    console.log(voice.channel)
  },
};

Problem is voice.channel remains the same (I didn’t check if they are exactly the same, but the channel name and channel is are the same, cuz that what matters)

I’m using discord.js v13 latest version so don’t even question me

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

0

If the problem you are having is that the member.voice variable does not update after the bot first starts up, the solution could be to add the GUILD_VOICE_STATES intent upon Client construction.

Here is an example of how you could do this:

const client = new Client ({ intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_VOICE_STATES] });

Adding intents.FLAGS.GUILD_VOICE_STATES should make member.voice update correctly when the user changes voice channel.

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!