Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get members of a discord guild(discord.py)?

I know some of the answers for this one would be:

for member in guild.members:
    id = member.id
    #do stuff here

But no, that doesn't work for me, I already tried that and it only has the bot itself inside of the list of members, though it does show the actual member count(but I'm not sure if that's useful in any way). So I'm asking if there is another way to do this.

like image 953
REEE Avatar asked Nov 19 '25 20:11

REEE


1 Answers

The new Discord intents system broke a lot of things, so you need to make sure discord.py is updated and you instantiate your client with all intents:

intents = discord.Intents.all()
client = discord.Client(intents=intents)
like image 123
Aplet123 Avatar answered Nov 22 '25 10:11

Aplet123



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!