mirror of
https://github.com/ClovertaTheTrilobita/SanYeCao-Nonebot.git
synced 2026-04-01 22:04:51 +00:00
fix(chat): 添加角色名称输入长度校验
This commit is contained in:
parent
0a1cd69e37
commit
d7f97ac3ee
1 changed files with 2 additions and 0 deletions
|
|
@ -74,6 +74,8 @@ async def handle_function(message: MessageEvent):
|
|||
if not await GroupChatRole.get_admin_list(group_openid, member_openid):
|
||||
await t2.finish("您没有权限使用此功能。")
|
||||
value = message.get_plaintext().strip().split()
|
||||
if len(value) < 2:
|
||||
await t2.finish("请输入命令和角色名称,格式为:命令 角色名称")
|
||||
action, role_name = value[0], value[1]
|
||||
if action == "/删除人设":
|
||||
result = await ChatRole.delete_role(role_name)
|
||||
|
|
|
|||
Loading…
Reference in a new issue