fix print
continuous-integration/drone/push Build is passing

This commit is contained in:
jianxin committed 2024-05-28 17:39:38 +08:00
1 parent effa4168e2
commit 6769ed6a6d
3 files changed
+172 -13

No files matched your search

+7 -11
View File
@@ -8,7 +8,7 @@ from celery import Task
from app.utils.utils import *
from app.utils.yd_utils import get_token, get_activity_info
from app.utils.feishu import create_doc, get_doc_block, create_doc_block
from app.utils.feishu import create_doc, get_doc_block, create_doc_block, get_messages
from app.utils.utils import update_record
@@ -18,6 +18,7 @@ def process_message_callback(
) -> None:
"""
记录问题到多维表格逻辑
"""
# 如果 @机器人 等于"记录问题", 获取当前的话题
@@ -25,6 +26,9 @@ def process_message_callback(
sender_info = event_message.get("sender")
message_data = event_message.get("message")
chat_id = message_data.get("chat_id")
thread_id = message_data.get("thread_id")
message_type = message_data.get("message_type")
content = message_data.get("content")
sender_id = message_data.get("sender_id")
@@ -59,15 +63,6 @@ def process_message_callback(
images = []
images_token = []
# if message_type == "post":
# content = content["content"]
# for item in chain.from_iterable(content):
# if item.get("tag") == "text":
# message_content += item["text"]
# if item.get("tag") == "img":
# images.append(item["image_key"])
lark.logger.info(f"message_content: {content_text}")
# 从话题中提取问题发起人的所有消息和图片, 记录到多维表格中, 记录发消息人 openid 并将处理人设置为@机器人的人
@@ -82,7 +77,8 @@ def process_message_callback(
record["问题概述"] = content_text
record["创建人"] = [{"id": sender_id}]
# 对 image_key 处理并并上传至多维表格
history_message_data = get_messages(client, message_id, images, cache_dir)
lark.logger.info(f"history_message_data: {history_message_data}")
for image in images:
image_path = get_message_resource(client, message_id, image, "image", cache_dir)