discord.py@bot.edit_角色非类型没有属性colou

2024-04-27 07:46:11 发布

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

我想通过使用命令添加权限“administrator”,但它输出错误 “非类型”没有“颜色”属性

@bot.command(pass_context=True)
async def manuadd(ctx, *, arg, role = discord.Role):
    author = ctx.message.author
    role = discord.utils.get(author.roles, name=arg)
    perms = discord.Permissions(administrator=True)
    await bot.edit_role(author, role, permissions=perms)

Tags: 命令true权限类型属性颜色bot错误