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

156
Vistas
Discord JS: How do I move all member inside an array into a channel?

I want to move all member within an array into a channel. The array memberIDs contains the IDs from the Member I want to move. The variable gameChannel contains the channel id as a string. My Code looks like this:

memberIDs.forEach(element => message.guild.member(element).voice.setChannel(gameChannel));
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

To move a member you must first get its data (GuildMember) and then move it.

Discord.js^12

var gameChannel = 'CHANNEL_ID';
var memberIDs = ['SOME_ID_HERE', 'OTHER_ID_HERE', '...'];

// For each element of the 'MemberIDs'
memberIDs.forEach(id => {
  // Assuming 'guild' is the Server Guild
  var member = guild.member.cache.get(id); // Get member
  if(member){
    // Move
    member.voice.setChannel(gameChannel, 'reason (this can be empty)')
    .then(e => console.log('User moved successfully'))
    .catch(e => console.log('An error occurred while trying to move the user'));
  }
});
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