I am trying to give the items in the voice channel randomly to the items in the message content. but it chooses the same person again. how can I prevent this? also user like this for dont knowing discord.js ppl example = user = ["2222222", "21111112"]
let users = message.member.voiceChannel.members
.filter(y => y.user.id !== message.author.id)
.map(a => a.user.id);
for (var i = 0; i < num; i++) {
var user = users[Math.floor(Math.random() * num)];
console.log(user);
let adi = message.guild.members.get(user);
liste += "" + adi.displayName + " adlı kullanıcının rolü " + rol + "\n";
oyuncular += " <@" + adi.user.id + "> ";
}
Aucun commentaire:
Enregistrer un commentaire