【发布时间】:2021-05-09 17:14:19
【问题描述】:
嗨,我想在 ctx.author 角色位置低于 bot 角色时编写一个机器人,ctx.author 得到错误并且不能使用该命令,例如: 我编码了这个 (客户端是机器人对象)
@client.command()
async def ab(ctx):
if client.top_role.position > ctx.author.top_role.position:
await ctx.send('Error!')
return
staff
.
.
.
但是机器人对象没有名为 top_role 的属性。 还有其他方法可以做这样的事情吗?有什么想法吗?
我也尝试使用 get_user(Id),但失败了。
【问题讨论】:
标签: python python-3.x discord discord.py