From 6722eeffa9c249a0f70087fd3dbb23bcce7c97ad Mon Sep 17 00:00:00 2001 From: snowy Date: Thu, 18 Apr 2024 18:15:11 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20markdown=E6=9A=82=E6=97=B6=E4=B8=8D?= =?UTF-8?q?=E5=8F=AF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- liteyuki/utils/message/message.py | 69 +++++++++++++++++++------------ 1 file changed, 43 insertions(+), 26 deletions(-) diff --git a/liteyuki/utils/message/message.py b/liteyuki/utils/message/message.py index 84442be7..0e8a38e9 100644 --- a/liteyuki/utils/message/message.py +++ b/liteyuki/utils/message/message.py @@ -65,39 +65,56 @@ class MarkdownMessage: session_id = event.user_id if event.message_type == "private" else event.group_id try: # 构建Markdown消息并获取转发消息ID - forward_id = await bot.call_api( - api="send_forward_msg", - messages=[ - v11.MessageSegment( - type="node", - data={ - "name" : "Liteyuki.OneBot", - "uin" : bot.self_id, - "content": [ - { - "type": "markdown", - "data": { - "content": '{"content":"%s"}' % formatted_md - } - }, - ] - }, - ) - ] - ) + # forward_id = await bot.call_api( + # api="send_forward_msg", + # messages=[ + # v11.MessageSegment( + # type="node", + # data={ + # "name" : "Liteyuki.OneBot", + # "uin" : bot.self_id, + # "content": [ + # { + # "type": "markdown", + # "data": { + # "content": '{"content":"%s"}' % formatted_md + # } + # }, + # ] + # }, + # ) + # ] + # ) # 发送Markdown longmsg并获取相应数据 data = await bot.send_msg( user_id=session_id, group_id=session_id, message_type=message_type, message=[ - v11.MessageSegment( - type="longmsg", - data={ - "id": forward_id - } - ), + { + "type": "markdown", + "data": { + "content": "{\"content\":\"%s\"}" % formatted_md + } + } ], + # messages=[ + # v11.MessageSegment( + # type="node", + # data={ + # "name": "Liteyuki.OneBot", + # "uin": bot.self_id, + # "content": [ + # { + # "type": "markdown", + # "data": { + # "content": '{"content":"%s"}' % formatted_md + # } + # } + # ] + # } + # ), + # ], **kwargs ) except BaseException as e: