Issue
I'm trying to use intents in my bot but when running the following code:
import discord
from discord.ext import commands
intents = discord.Intents.default()
intents.members = True
bot = commands.Bot(command_prefix=prefix, intent=intents)
I get the error:
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discor
Traceback (most recent call last):
File "main.py", line 3, in <module>
intents = discord.Intents.default()
AttributeError: module 'discord' has no attribute 'Intents'
I am running Python 3.8.2, and I don't know why this is happening. Any help would be appriceated (:
Solution
You are most likely not actually using discord.py 1.5.1, you can print discord.__version__
after importing it to double check. Best practise is to use Python venv for packages like this.
Additionally, to make sure you are always accessing the correct pip, you can use python -m pip
. This means you are always using pip for the same version you will invoke the script with later.
Answered By - Bluenix
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.