因此,我正在尝试使机器人检查其是否具有manage_messages
权限,但似乎无法正常工作。我使用了if client.user.server_permissions.manage_messages == False:
client.user是机器人,因此它要检查机器人是否具有该权限。
@client.command(pass_context=True)
async def test(ctx):
if client.user.server_permissions.manage_messages == False: #< this line is meant to check if user doesn't have the permissions
await client.say("I don't have manage messages permissions")
else:
await client.say("I have permissions")