无权限用户尝试添加订阅时返回提示信息 (#617)

*  无权限用户尝试添加订阅时返回提示信息

*  添加no_permission_matcher相关的单元测试

* 🐛 优化无权限提示的排版

* 🐛 移除没有必要的命令
This commit is contained in:
2024-09-01 22:32:47 +08:00
committed by GitHub
parent 83cd0a741e
commit d6205867b8
3 changed files with 57 additions and 0 deletions
+11
View File
@@ -108,10 +108,21 @@ async def do_dispatch_command(
asyncio.create_task(new_matcher_ins.run(bot, event, state))
no_permission_matcher = on_command(
"添加订阅", rule=configurable_to_me, aliases={"删除订阅", "群管理"}, priority=8, block=True
)
@no_permission_matcher.handle()
async def send_no_permission():
await no_permission_matcher.finish("您没有权限进行此操作,请联系 Bot 管理员")
__all__ = [
"common_platform",
"add_sub_matcher",
"query_sub_matcher",
"del_sub_matcher",
"group_manage_matcher",
"no_permission_matcher",
]