使用 discord.py 允许一个命令具有多个角色

I_b*_*ode 2 python discord.py

我将如何制作它以便管理员或版主可以清除 Discord 聊天?

@commands.has_role("Admin")
async def addrole(ctx, rol='member'):
    member = ctx.message.author
    role = get(member.server.roles, name=rol)
    await bot.add_roles(member, role)
Run Code Online (Sandbox Code Playgroud)

Har*_*758 6

您可以改用commands.has_any_role支票。