【发布时间】:2018-08-16 02:02:27
【问题描述】:
所以我可以在我的机器上本地运行我的机器人,它运行良好,但是当我尝试将它托管在 AWS 上时,我得到了错误:
AttributeError: 'Message' object has no attribute 'server'
这是导致问题的线路。
role = discord.utils.get(message.server.roles, name=entered_role)
【问题讨论】:
-
目标机器运行的是什么版本的discord.py?尝试执行
python3 -c "import discord; print(discord.__version__)"。 -
版本 1.0.0a.
-
您的代码是为版本 0.16(“异步”分支)构建的,而您的计算机正在运行版本
1.0(“重写”分支)。您可以更改计算机上的版本或更新您的代码(您可能应该更新您的代码)。 The docs for the rewrite version 可能是一个不错的起点。
标签: python amazon-web-services amazon-ec2 discord discord.py