Skip to content

Commit

Permalink
feat: aiocqhttp允许使用图片链接作为参数
Browse files Browse the repository at this point in the history
  • Loading branch information
RockChinQ committed Apr 11, 2024
1 parent e5cffb7 commit 1e1a103
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/platform/sources/aiocqhttp.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,14 @@ def yiri2target(message_chain: mirai.MessageChain) -> typing.Tuple[list, int, da
msg_id = msg.id
msg_time = msg.time
elif type(msg) is mirai.Image:
msg_list.append(aiocqhttp.MessageSegment.image(msg.path))
arg = ''

if msg.url:
arg = msg.url
elif msg.path:
arg = msg.path

msg_list.append(aiocqhttp.MessageSegment.image(arg))
elif type(msg) is mirai.At:
msg_list.append(aiocqhttp.MessageSegment.at(msg.target))
elif type(msg) is mirai.AtAll:
Expand Down

0 comments on commit 1e1a103

Please sign in to comment.