diff --git a/docs/guide/creating-a-matcher.md b/docs/guide/creating-a-matcher.md index 027dd009..b603449a 100644 --- a/docs/guide/creating-a-matcher.md +++ b/docs/guide/creating-a-matcher.md @@ -142,4 +142,3 @@ Rule(async_checker1) & sync_checker & async_checker2 :::danger 警告 `Rule(*checkers)` 只接受 async function,或使用 `nonebot.utils.run_sync` 自行包裹 sync function。在使用 `与 &` 时,NoneBot 会自动包裹 sync function ::: -t \ No newline at end of file diff --git a/tests/test_plugins/test_delete.py b/tests/test_plugins/test_delete.py new file mode 100644 index 00000000..bd02cfbc --- /dev/null +++ b/tests/test_plugins/test_delete.py @@ -0,0 +1,31 @@ +import asyncio + +from nonebot import on_message +from nonebot.permission import USER +from nonebot.typing import Bot, Event + +a = on_message(priority=0, permission=USER(123123123), temp=True) + + +@a.handle() +async def test_a(bot: Bot, event: Event, state: dict): + print("======== A Received ========") + print("======== A Running Completed ========") + + +b = on_message(priority=0, permission=USER(123456789), temp=True) + + +@b.handle() +async def test_b(bot: Bot, event: Event, state: dict): + print("======== B Received ========") + await asyncio.sleep(10) + print("======== B Running Completed ========") + + +c = on_message(priority=0, permission=USER(1111111111)) + + +@c.handle() +async def test_c(bot: Bot, event: Event, state: dict): + print("======== C Received ========")