Merge branch 'dev' into AzideCupric-recover

This commit is contained in:
felinae98 2022-03-17 11:44:10 +08:00
commit 503a295582
No known key found for this signature in database
GPG Key ID: 00C8B010587FF610
2 changed files with 6 additions and 35 deletions

View File

@ -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)

View File

@ -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