小编web*_*eko的帖子

邮件对象没有属性“服务器”

使用以下代码行:

@bot.command()
async def report(ctx):
  author = ctx.message.author
  server = ctx.message.server
  wait ctx.send("Author: " + str(author) + "\nServer: " + str(server))
Run Code Online (Sandbox Code Playgroud)

我得到错误:

discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Message' object has no attribute 'server'
Run Code Online (Sandbox Code Playgroud)

导入库不是问题,因为我可以将行更改为ctx.message.channel并获取频道名称。在author太收集罚款。但server事实并非如此。我也尝试Guild过根据一些建议没有运气。

python-3.x discord.py discord.py-rewrite

2
推荐指数
1
解决办法
2268
查看次数