Skip to content

Commit 68d5046

Browse files
authored
feat(render): 合并转发中追加图文图片描述 (#511)
1 parent a43df14 commit 68d5046

File tree

1 file changed

+5
-5
lines changed
  • src/nonebot_plugin_parser/renders

1 file changed

+5
-5
lines changed

src/nonebot_plugin_parser/renders/base.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,7 @@ def on_error(e: Exception):
6161
case AudioContent():
6262
yield UniMessage(UniHelper.record_seg(path))
6363
case ImageContent():
64-
img_seg = UniHelper.img_seg(path)
65-
if cont.alt:
66-
img_seg += cont.alt
67-
forwardable_segs.append(img_seg)
64+
forwardable_segs.append(UniHelper.img_seg(path))
6865
case DynamicContent():
6966
dynamic_segs.append(UniHelper.video_seg(path))
7067

@@ -81,7 +78,10 @@ def on_error(e: Exception):
8178
continue
8279

8380
if path := await cont.path_task.safe_get(on_error):
84-
forwardable_segs.append(UniHelper.img_seg(path))
81+
img_seg = UniHelper.img_seg(path)
82+
if cont.alt:
83+
img_seg += cont.alt
84+
forwardable_segs.append(img_seg)
8585

8686
if forwardable_segs:
8787
if pconfig.need_forward_contents or len(forwardable_segs) > 4:

0 commit comments

Comments
 (0)