Skip to content
Advertisement

how to get all members of a guild in discord.py?

So i want to get all members on the discord guild/server printed out in the console but i only get the bot as member. I already activated server member intent on the discord developer portal but it didn’t help. Thanks in advance

here is the code i use:

JavaScript

Advertisement

Answer

The reason you are only getting bot, is because you are missing intents. You have to enable intents from the application page for your bot, and also enable intents in your code. Have a look here.

Code should look something like

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement