How-to enable "privileged intents" for the bot
Go to the Discord Developer Portal.
Click on your bot's application.
Navigate to the "Bot" tab on the left sidebar.
Scroll down to the "Privileged Gateway Intents" section.
Enable the "Server Members Intent" by toggling the switch.