更新时间:2023-11-30 12:11:58
您可以在命令上添加一个装饰器,以将其限制为仅具有特定角色或权限的成员.它的文档是 这里.它看起来像这样:
You can add a decorator on the command to restrict it to only members with specific roles or permissions. The documentation for it is here. It would look like this:
@bot.command()
@commands.has_role('RoleName')
async def command_name():
请记住,您传递的 RoleName
字符串区分大小写.
Keep in mind that the RoleName
string you pass is case sensitive.