I'm trying to move all users from a VC with a specific role, for example: !summon @role
With that, all users with that specific role should come to the VC where the user typed that command
At the moment my code looks like this:
else if (command === 'summon') {
const channel = message.member.voice.channel;
message.guild.members.cache.forEach(member => {
member.voice.setChannel(channel);
});
message.channel.send(`${message.author} users moved to your channel!`);
}
At the moment i'm moving all users, however I only want users with the informed role
I tried to use:
message.mentions.roles.forEach(member => {
member.setChannel(channel);
});
But without success... can someone help me with this problem?