【发布时间】:2021-12-04 21:01:23
【问题描述】:
以下代码在服务器内部运行:
@client.command()
async def test(ctx):
await ctx.send(len(ctx.author.roles))
通过 PM 我得到:
Command raised an exception: AttributeError: 'User' object has no attribute 'roles'
好像看不懂角色,知道怎么解决吗?
【问题讨论】:
-
你应该如何阅读 DM 中的角色?角色是每个公会的,你可以在不同的服务器上拥有不同的角色布局。
-
我要定义服务器?
标签: python discord.py roles