diff options
| -rw-r--r-- | src/infini/handler.py | 7 | ||||
| -rw-r--r-- | src/infini/typing.py | 5 |
2 files changed, 11 insertions, 1 deletions
diff --git a/src/infini/handler.py b/src/infini/handler.py index 8406972b..dbec3eaf 100644 --- a/src/infini/handler.py +++ b/src/infini/handler.py @@ -7,6 +7,7 @@ from abc import ABCMeta, abstractmethod from enum import Enum +from typing import ClassVar, Optional from .event import MatcherEvent, InfiniEvent __all__ = ["Handler", "HandlerLoadType"] @@ -25,7 +26,11 @@ class Handler: """规则包业务基类""" name: str - priority: int = 0 + priority: ClassVar[int] = 0 + block: ClassVar[bool] = False + + def __init_state__(self) -> Optional[StateT]: + """初始化规则包状态。""" def __init__(self) -> None: pass diff --git a/src/infini/typing.py b/src/infini/typing.py index 9af61569..08015b0e 100644 --- a/src/infini/typing.py +++ b/src/infini/typing.py @@ -8,3 +8,8 @@ from typing import ( NoReturn as NoReturn, Awaitable as Awaitable, ) + +if TYPE_CHECKING: + from typing import Any + +StateT = TypeVar("StateT")
\ No newline at end of file |
