| | |
| | | from app.services.redis_queue import redis_queue |
| | | from app.services.ecloud_client import ecloud_client |
| | | from app.services.dify_client import dify_client |
| | | from app.services.friend_ignore_service import friend_ignore_service |
| | | from config import settings |
| | | |
| | | |
| | |
| | | or not data.get("content") |
| | | ): |
| | | logger.warning(f"消息缺少必要字段: data={data}") |
| | | return False |
| | | |
| | | # 检查发送者是否在好友忽略列表中 |
| | | from_user = data.get("fromUser") |
| | | if friend_ignore_service.is_friend_ignored(from_user): |
| | | logger.info(f"忽略好友发送的消息: fromUser={from_user}") |
| | | return False |
| | | |
| | | return True |
| | |
| | | # 3.2 获取用户在当前群组的conversation_id |
| | | conversation_id = redis_queue.get_conversation_id(from_user, from_group) |
| | | |
| | | # 调用Dify接口发送消息 |
| | | dify_response = dify_client.send_chat_message( |
| | | # 调用Dify接口发送消息(根据配置选择模式) |
| | | dify_response = dify_client.send_message( |
| | | query=content, user=from_user, conversation_id=conversation_id |
| | | ) |
| | | |