mirror of https://github.com/Mai-with-u/MaiBot.git
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
parent
d93091ff1d
commit
d1d6bd773d
|
|
@ -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]):
|
||||
"""分发一个非阻塞(异步)的事件处理任务。"""
|
||||
|
|
|
|||
Loading…
Reference in New Issue