mirror of
https://github.com/nonebot/nonebot2.git
synced 2024-11-24 00:55:07 +08:00
✅ add processor test
This commit is contained in:
parent
b87df479a2
commit
7ce69fb6f8
13
tests/test_plugins/test_processor.py
Normal file
13
tests/test_plugins/test_processor.py
Normal file
@ -0,0 +1,13 @@
|
||||
from nonebot.typing import Bot, Event, Matcher
|
||||
from nonebot.message import event_preprocessor, run_preprocessor
|
||||
|
||||
|
||||
@event_preprocessor
|
||||
async def handle(bot: Bot, event: Event, state: dict):
|
||||
state["preprocessed"] = True
|
||||
print(event)
|
||||
|
||||
|
||||
@run_preprocessor
|
||||
async def run(matcher: Matcher, bot: Bot, event: Event, state: dict):
|
||||
print(matcher)
|
Loading…
Reference in New Issue
Block a user