个股论坛重做

This commit is contained in:
2026-01-06 16:08:16 +08:00
parent 2ec62893f0
commit 2c46beb58a
5 changed files with 345 additions and 29 deletions

View File

@@ -824,6 +824,9 @@ def send_message(channel_id):
message_id = generate_id()
now = datetime.utcnow()
# 将 Markdown 图片语法转换为 HTML支持 base64 图片)
content_html = parse_markdown_images(content)
# 构建消息文档
message_doc = {
'id': message_id,
@@ -833,6 +836,7 @@ def send_message(channel_id):
'author_name': user['username'],
'author_avatar': user.get('avatar', ''),
'content': content,
'content_html': content_html, # Markdown 转换后的 HTML
'type': 'text',
'mentioned_users': data.get('mentionedUsers', []),
'mentioned_stocks': data.get('mentionedStocks', []),