mirror of
https://github.com/suyiiyii/nonebot-bison.git
synced 2026-05-09 18:27:56 +08:00
✨ 无权限用户尝试添加订阅时返回提示信息 (#617)
* ✨ 无权限用户尝试添加订阅时返回提示信息 * ✨ 添加no_permission_matcher相关的单元测试 * 🐛 优化无权限提示的排版 * 🐛 移除没有必要的命令
This commit is contained in:
@@ -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",
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user