当我在电脑上运行discord机器人时,我的一切都正常工作,但当我将代码上传到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意图需要版本1.5+(请参见discord.py docs),您有版本1.4.x。要解决此问题,只需将
requirements.txt
更新为兼容版本旁注:为什么在
requirements.txt
和包含asyncio
中列出了3次discord.py,它自3.4以来一直在stdlib中相关问题 更多 >
编程相关推荐