不知道如何在heroku服务器上使用intents



当我在电脑上运行discord bot时,一切都正常,但当我将代码上传到heroku时。我收到这个错误消息。

2020-12-08T22:37:37.551623+00:00 app[worker.1]: Traceback (most recent call last):
2020-12-08T22:37:37.551649+00:00 app[worker.1]: File "bot.py", line 22, in <module>
2020-12-08T22:37:37.551751+00:00 app[worker.1]: intents = discord.Intents.default()
2020-12-08T22:37:37.551756+00:00 app[worker.1]: AttributeError: module 'discord' has no attribute 'Intents'

我不确定我是否忘了在我的需求文件夹中添加一些东西,但在我的电脑上一切都很好。

intents = discord.Intents.default()
intents.members = True

这是我的要求:

git+https://github.com/Rapptz/discord.py
PyNaCl==1.3.0
dnspython==1.16.0
requests
python-dotenv
gTTS
opuslib
asyncio
youtube-dl
discord
discord.py[voice] ~= 1.4.0
pip
ffmpeg
google-cloud-firestore
firebase-admin

discord.py Intents需要1.5+版本(请参阅discord.py-docs(,您有1.4.x版本。要解决此问题,只需将requirements.txt更新到兼容版本即可。

旁注:为什么你在requirements.txt中列出了3次不和谐.py,并包括自3.4以来一直在stdlib中的asyncio

最新更新