mirror of
https://github.com/suyiiyii/nonebot-bison.git
synced 2026-06-23 14:16:52 +08:00
🔀 merge
This commit is contained in:
@@ -147,10 +147,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",
|
||||
]
|
||||
|
||||
@@ -9,9 +9,9 @@ from nonebot_plugin_saa import Text, PlatformTarget, SupportedAdapters
|
||||
from ..types import Target
|
||||
from ..config import config
|
||||
from ..apis import check_sub_target
|
||||
from ..platform import Platform, platform_manager
|
||||
from ..config.db_config import SubscribeDupException
|
||||
from .utils import common_platform, ensure_user_info, gen_handle_cancel
|
||||
from ..platform import Platform, platform_manager, unavailable_paltforms
|
||||
|
||||
|
||||
def do_add_sub(add_sub: type[Matcher]):
|
||||
@@ -39,6 +39,8 @@ def do_add_sub(add_sub: type[Matcher]):
|
||||
elif platform == "取消":
|
||||
await add_sub.finish("已中止订阅")
|
||||
elif platform in platform_manager:
|
||||
if platform in unavailable_paltforms:
|
||||
await add_sub.finish(f"无法订阅 {platform},{unavailable_paltforms[platform]}")
|
||||
state["platform"] = platform
|
||||
else:
|
||||
await add_sub.reject("平台输入错误")
|
||||
|
||||
Reference in New Issue
Block a user