With discord.py 1.5.x setting up intents is necessary for your events to work properly.
- Go to your discord developer portal.
- Click your application.
- Click your bot.
- Scroll down to “Privileged Gateway Intents” and turn on both.
Add this to your code:
intents = discord.Intents.default() # If you are using client client = discord.Client(intents=intents) # If you are using bot bot = commands.Bot(command_prefix='!', intents=intents)
CLICK HERE to find out more related problems solutions.