当订阅列表里有UNKNOWN时raise

pull/1215/head
Windpicker-owo 2025-08-24 03:10:50 +08:00
parent b534340009
commit bb6e31238c
1 changed files with 2 additions and 0 deletions

View File

@ -32,6 +32,8 @@ class BaseEventHandler(ABC):
"""插件配置字典""" """插件配置字典"""
self.subscribed_events = [] self.subscribed_events = []
"""订阅的事件列表""" """订阅的事件列表"""
if EventType.UNKNOWN in self.init_subscribe:
raise NotImplementedError("事件处理器必须指定 event_type")
@abstractmethod @abstractmethod
async def execute(self, kwargs: dict | None) -> Tuple[bool, bool, Optional[str]]: async def execute(self, kwargs: dict | None) -> Tuple[bool, bool, Optional[str]]: