Update src/plugin_system/core/events_manager.py

Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
pull/1207/head
Windpicker-owo 2025-08-21 14:38:29 +08:00 committed by GitHub
parent d93091ff1d
commit d1d6bd773d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 3 deletions

View File

@ -79,9 +79,7 @@ class EventsManager:
message: Optional[MaiMessages]
) -> Coroutine[Any, Any, tuple[bool, bool, Any]]:
"""封装了调用 handler.execute 的逻辑。"""
if message:
return handler.execute(message)
return handler.execute() # 适用于 ON_START, ON_STOP
return handler.execute(message) if message else handler.execute()
def _dispatch_handler_task(self, handler: BaseEventHandler, message: Optional[MaiMessages]):
"""分发一个非阻塞(异步)的事件处理任务。"""