Files
xiaozhi-esp32-server/main/xiaozhi-server/core/handle/textHandle.py
T

20 lines
589 B
Python
Raw Normal View History

from typing import TYPE_CHECKING
if TYPE_CHECKING:
from core.connection import ConnectionHandler
2025-09-03 09:43:34 +08:00
from core.handle.textMessageHandlerRegistry import TextMessageHandlerRegistry
from core.handle.textMessageProcessor import TextMessageProcessor
2025-02-02 23:01:14 +08:00
2025-02-18 00:07:19 +08:00
TAG = __name__
2025-02-02 23:01:14 +08:00
2025-09-03 09:43:34 +08:00
# 全局处理器注册表
message_registry = TextMessageHandlerRegistry()
# 创建全局消息处理器实例
message_processor = TextMessageProcessor(message_registry)
2025-02-02 23:01:14 +08:00
async def handleTextMessage(conn: "ConnectionHandler", message):
2025-02-04 13:57:05 +08:00
"""处理文本消息"""
2025-09-03 09:43:34 +08:00
await message_processor.process_message(conn, message)