Refactor chat stream handling to use BotChatSession

- Updated imports and references from ChatStream to BotChatSession across multiple files.
- Adjusted method signatures and internal logic to accommodate the new session management.
- Ensured compatibility with existing functionality while improving code clarity and maintainability.
This commit is contained in:
DrSmoothl
2026-03-07 00:57:33 +08:00
parent 8712fc0d05
commit 2e3dd44ee9
43 changed files with 706 additions and 563 deletions

View File

@@ -61,9 +61,12 @@ class TempMethodsExpression:
str: 生成的聊天流ID哈希值
"""
try:
from src.chat.message_receive.chat_stream import get_chat_manager
from src.common.utils.utils_session import SessionUtils
return get_chat_manager().get_stream_id(platform, str(id_str), is_group=is_group)
if is_group:
return SessionUtils.calculate_session_id(platform, group_id=str(id_str))
else:
return SessionUtils.calculate_session_id(platform, user_id=str(id_str))
except Exception as e:
logger.error(f"生成聊天流ID失败: {e}")
return None