A little disclaimer: Join the discord.py server for more information, there are weekly updates since they are actively developing the library and changes can be breaking.
Now every Client
subclass needs the intents
keysword as mentioned in the following picture:
How to change the code:
- Head over to the Discord Developer Portal and click on your application
- Head over to
Bot
and findPrivileged Gateway Intents
. Tick whatever you need - In your code, you then need to import them:
intents = discord.Intents.default() # or .all() if you ticked all, that is easier
intents.members = True # If you ticked the SERVER MEMBERS INTENT
bot = commands.Bot(command_prefix=".", intents=intents) # "Import" the intents
This should resolve your error.