diff --git a/src/plugins/nonebot_bison/config_manager.py b/src/plugins/nonebot_bison/config_manager.py index 6c184a1..931bf3e 100644 --- a/src/plugins/nonebot_bison/config_manager.py +++ b/src/plugins/nonebot_bison/config_manager.py @@ -382,13 +382,13 @@ async def do_dispatch_command( "message", Rule(), permission, - None, - True, + handlers=None, + temp=True, priority=0, block=True, plugin=matcher.plugin, module=matcher.module, - expire_time=datetime.now() + bot.config.session_expire_timeout, + expire_time=datetime.now(), default_state=matcher.state, default_type_updater=matcher.__class__._default_type_updater, default_permission_updater=matcher.__class__._default_permission_updater, @@ -401,34 +401,3 @@ async def do_dispatch_command( do_del_sub(new_matcher) new_matcher_ins = new_matcher() asyncio.create_task(new_matcher_ins.run(bot, event, state)) - - -test_matcher = on_command("testtt") - - -@test_matcher.handle() -async def _handler(bot: Bot, event: Event, matcher: Matcher, state: T_State): - permission = await matcher.update_permission(bot, event) - new_matcher = Matcher.new( - "message", - Rule(), - permission, - None, - True, - priority=0, - block=True, - plugin=matcher.plugin, - module=matcher.module, - expire_time=datetime.now() + bot.config.session_expire_timeout, - default_state=matcher.state, - default_type_updater=matcher.__class__._default_type_updater, - default_permission_updater=matcher.__class__._default_permission_updater, - ) - - async def h(): - logger.warning("yes") - await new_matcher.send("666") - - new_matcher.handle()(h) - new_matcher_ins = new_matcher() - await new_matcher_ins.run(bot, event, state) diff --git a/tests/test_config_manager_add.py b/tests/test_config_manager_add.py index 65447ed..a38a1a8 100644 --- a/tests/test_config_manager_add.py +++ b/tests/test_config_manager_add.py @@ -383,7 +383,7 @@ async def test_add_with_get_id(app: App): ctx.should_rejected() ctx.should_call_send( event_4_query, - [MessageSegment(*BotReply.add_reply_on_id_input_search())], + Message([MessageSegment(*BotReply.add_reply_on_id_input_search())]), True, ) """ @@ -403,3 +403,5 @@ async def test_add_with_get_id(app: App): True, ) ctx.should_finished() + subs = config.list_subscribe(10000, "group") + assert len(subs) == 0