mirror of
https://github.com/TriM-Organization/LiteyukiBot-TriM.git
synced 2024-11-28 16:24:51 +08:00
commit
6e66c95487
@ -65,39 +65,56 @@ class MarkdownMessage:
|
|||||||
session_id = event.user_id if event.message_type == "private" else event.group_id
|
session_id = event.user_id if event.message_type == "private" else event.group_id
|
||||||
try:
|
try:
|
||||||
# 构建Markdown消息并获取转发消息ID
|
# 构建Markdown消息并获取转发消息ID
|
||||||
forward_id = await bot.call_api(
|
# forward_id = await bot.call_api(
|
||||||
api="send_forward_msg",
|
# api="send_forward_msg",
|
||||||
messages=[
|
# messages=[
|
||||||
v11.MessageSegment(
|
# v11.MessageSegment(
|
||||||
type="node",
|
# type="node",
|
||||||
data={
|
# data={
|
||||||
"name" : "Liteyuki.OneBot",
|
# "name" : "Liteyuki.OneBot",
|
||||||
"uin" : bot.self_id,
|
# "uin" : bot.self_id,
|
||||||
"content": [
|
# "content": [
|
||||||
{
|
# {
|
||||||
"type": "markdown",
|
# "type": "markdown",
|
||||||
"data": {
|
# "data": {
|
||||||
"content": '{"content":"%s"}' % formatted_md
|
# "content": '{"content":"%s"}' % formatted_md
|
||||||
}
|
# }
|
||||||
},
|
# },
|
||||||
]
|
# ]
|
||||||
},
|
# },
|
||||||
)
|
# )
|
||||||
]
|
# ]
|
||||||
)
|
# )
|
||||||
# 发送Markdown longmsg并获取相应数据
|
# 发送Markdown longmsg并获取相应数据
|
||||||
data = await bot.send_msg(
|
data = await bot.send_msg(
|
||||||
user_id=session_id,
|
user_id=session_id,
|
||||||
group_id=session_id,
|
group_id=session_id,
|
||||||
message_type=message_type,
|
message_type=message_type,
|
||||||
message=[
|
message=[
|
||||||
v11.MessageSegment(
|
{
|
||||||
type="longmsg",
|
"type": "markdown",
|
||||||
data={
|
"data": {
|
||||||
"id": forward_id
|
"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
|
**kwargs
|
||||||
)
|
)
|
||||||
except BaseException as e:
|
except BaseException as e:
|
||||||
|
Loading…
Reference in New Issue
Block a user