mirror of
https://github.com/suyiiyii/nonebot-bison.git
synced 2026-05-08 17:58:55 +08:00
@@ -18,9 +18,16 @@ class BriefTheme(Theme):
|
||||
if not post.title:
|
||||
raise ThemeRenderUnsupportError("Post has no title")
|
||||
text = f"{post.title}\n\n"
|
||||
text += f"来源: {post.platform.name} {post.nickname or ''}\n"
|
||||
text += f"来源: {post.platform.name} {post.nickname or ''}{' 的转发' if post.repost else ''}\n"
|
||||
|
||||
urls: list[str] = []
|
||||
if (rp := post.repost) and rp.url:
|
||||
urls.append(f"转发详情: {rp.url}")
|
||||
if post.url:
|
||||
text += f"详情: {post.url}"
|
||||
urls.append(f"详情: {post.url}")
|
||||
|
||||
if urls:
|
||||
text += "\n".join(urls)
|
||||
|
||||
msgs: list[MessageSegmentFactory] = [Text(text)]
|
||||
if post.images:
|
||||
|
||||
Reference in New Issue
Block a user