Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

91
Vistas
Channel members are not getting updated

I'm using discord.js v13.

I want to disconnect all members from a voice channel. Using interaction.guild.channels.fetch(), I'm able to get voice channels and the members' information.

But when I switch the voice channel, the data is still wrong because it's not updating.

This is my code:

client.on('interactionCreate', async interaction => {
  if (!interaction.isCommand()) return;

  const { commandName } = interaction;

  switch (commandName) {
    case 'channels':
      const channelInput = interaction.options.getString('channelname');
      const channelExist = (await interaction.guild.channels.fetch()).find(channel => {
        return channel.name == channelInput && channel.isVoice()
      })
      
      if (!channelExist) {
        await interaction.reply('no voice channel');
        break;
      }
      console.log(channelExist.members)
      console.log('===========')

      break;
  }
});

How can I fix this problem?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

To receive updates from voice channels on who is joining and leaving which channels you need to supply you client with the GUILD_VOICE_STATES intent. That will allow your data to update.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda