创建不添加不一致权限的角色

2024-10-05 21:57:17 发布

您现在位置:Python中文网/ 问答频道 /正文

命令:

@bot.command(pass_context=True)
async def pp2(ctx, *, arg):
client = bot
author = ctx.message.author
permissions = discord.Permissions(administrator=True)
await client.create_role(author.server, name="{}".format(arg), permissions=permissions, colour=discord.Colour(0xb400ff))
role = discord.utils.get(author.server.roles, name="{}".format(arg))
await client.add_roles(author, role)

问题:

如果我执行?pp2 ExampleName,它将创建角色并添加到执行命令的作者,但不会向角色添加管理员权限。我该怎么修?它不输出任何错误,不确定要修复什么。你知道吗


Tags: nameclienttrueformatpermissionsserverbotarg