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

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

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 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