mirror of
https://github.com/nonebot/nonebot2.git
synced 2024-11-25 01:25:04 +08:00
16 lines
412 B
Python
16 lines
412 B
Python
from nonebot.typing import State
|
|
from nonebot.matcher import Matcher
|
|
from nonebot.adapters import Bot, Event
|
|
from nonebot.message import event_preprocessor, run_preprocessor
|
|
|
|
|
|
@event_preprocessor
|
|
async def handle(bot: Bot, event: Event, state: State):
|
|
state["preprocessed"] = True
|
|
print(event)
|
|
|
|
|
|
@run_preprocessor
|
|
async def run(matcher: Matcher, bot: Bot, event: Event, state: State):
|
|
print(matcher)
|