Reputation: 143
I'm using Heroku to host my discord bot but I get an error saying
2021-05-22T13:49:05.066399+00:00 app[worker.1]: File "/app/Discord.py", line 6, in <module>
2021-05-22T13:49:05.066599+00:00 app[worker.1]: intents = discord.Intents(messages=True, guilds=True, reactions=True, members=True, presences=True)
2021-05-22T13:49:05.066604+00:00 app[worker.1]: AttributeError: module 'discord' has no attribute 'Intents'
and my code is
import discord
from discord.ext import commands
import random
from kewl import *
intents = discord.Intents(messages=True, guilds=True, reactions=True, members=True, presences=True)
client = commands.Bot(command_prefix='$', intents=intents)
role = ""
# 290 lines of code
client.run(Token)
line 6 is this intents = discord.Intents(messages=True, guilds=True, reactions=True, members=True, presences=True)
which is the problem, can someone help me with this, I'm new to Discord.py
Upvotes: 1
Views: 105
Reputation: 2907
You need to upgrade your discord.py version. This can be done by specifying the version you need in the requirements.txt
file. You can check your version of discord.py by executing discord.__version__
Latest version is 1.7.2
and putting this in the requirements.txt
you would need to put discord.py>=1.7.2
If you want to use all the intents then it's best to use discord.Intents.all()
instead of specifying the intents you want to use.
Upvotes: 1