0

I'm trying to have my bot select a random member for this raffle, but it is only coming up with the same 3 members. Me, itself, and a music bot.

All I'm doing is this

let randommember = message.guild.members.cache.random()
console.log(winner)

But no matter what I do it comes up with those 3 members. I tried having it shuffle people with a specific role, but unless one of those 3 members has the role, it comes up with an error.

let RaffleContenstant = message.guild.roles.cache.get("771443215936520252")

let winner = RaffleContestant.members.random()

1 Answers1

0

Discord recently rolled out Priveliged Gateway Intents, which are mostly to do with server members and presence.

By default, those intents are turned off, so if you want to access guild member and presence-related data, you should probably change your gateway intents at the Discord Developer Portal.

Splatterxl
  • 343
  • 1
  • 10