mirror of
				https://github.com/nonebot/nonebot2.git
				synced 2025-10-26 20:46:39 +00:00 
			
		
		
		
	🏗️ change code structure
This commit is contained in:
		| @@ -1,6 +1,6 @@ | ||||
| from nonebot import on_command | ||||
| from nonebot.log import logger | ||||
| from nonebot.processor import Depends | ||||
| from nonebot.dependencies import Depends | ||||
|  | ||||
| test = on_command("123") | ||||
|  | ||||
|   | ||||
| @@ -1,15 +1,15 @@ | ||||
| from nonebot.adapters import Event | ||||
| from nonebot.typing import T_State | ||||
| from nonebot.processor import Matcher | ||||
| from nonebot.adapters import Bot, Event | ||||
| from nonebot.matcher import Matcher | ||||
| from nonebot.message import run_preprocessor, event_preprocessor | ||||
|  | ||||
|  | ||||
| @event_preprocessor | ||||
| async def handle(bot: Bot, event: Event, state: T_State): | ||||
| async def handle(event: Event, state: T_State): | ||||
|     state["preprocessed"] = True | ||||
|     print(type(event), event) | ||||
|  | ||||
|  | ||||
| @run_preprocessor | ||||
| async def run(matcher: Matcher, bot: Bot, event: Event, state: T_State): | ||||
| async def run(matcher: Matcher): | ||||
|     print(matcher) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user