Currently, I have this command that is functioning well. However, I am looking to customize it so that it only selects users and excludes bots. The purpose of the command is to randomly choose users and then mention
them in a message.
let number = args[0];
if(isNaN(number)){
return message.channel.send(`The specified amount is either not a number or no amount was provided. Please use: !randommention (number)`);
}else{
let ret = "";
for (i = 0; i < number; i++) {
let randomName = message.guild.members.cache.random().user;
//My unsuccessful attempt at blocking bot mentions
if(randomName == message.member.user.bot){
repeat(randomName)}
ret += `\n${randomName}`
}
message.channel.send(`**User(s) Selected:** ${ret}`)
}}
I experimented with a workaround using a "repeat" function, which unfortunately didn't yield the desired result. Any suggestions on how to effectively exclude bots entirely?