2024-06-06 06:00:33 发布
网友
我最近做了一个不和谐的机器人使用不和.py. 我试着为一些命令设置权限。我有这个测试命令功能:
@client.command() @commands.has_role('Moderator') async def cool(ctx): await ctx.send("You are cool indeed!")
当用户没有“审阅者”角色时,如何返回消息(错误)?在
我已经试过了:
但我什么也得不到。在
在on_command_error函数中,对照^{}或^{}进行检查。在
on_command_error
if isinstance(error, (commands.MissingRole, commands.MissingAnyRole)): ...
在} 或^{} 进行检查。在
on_command_error
函数中,对照^{相关问题 更多 >
编程相关推荐