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

157
Views
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 answers
Answer question

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