mirror of
https://github.com/suyiiyii/nonebot-bison.git
synced 2026-05-09 18:27:56 +08:00
♻️ refactor client of scheduler_config
This commit is contained in:
@@ -42,11 +42,12 @@ class BasicTheme(Theme):
|
||||
if urls:
|
||||
text += "\n".join(urls)
|
||||
|
||||
client = await post.platform.ctx.get_client_for_static()
|
||||
msgs: list[MessageSegmentFactory] = [Text(text)]
|
||||
if post.images:
|
||||
pics = post.images
|
||||
if is_pics_mergable(pics):
|
||||
pics = await pic_merge(list(pics), post.platform.client)
|
||||
pics = await pic_merge(list(pics), client)
|
||||
msgs.extend(map(Image, pics))
|
||||
|
||||
return msgs
|
||||
|
||||
@@ -29,11 +29,12 @@ class BriefTheme(Theme):
|
||||
if urls:
|
||||
text += "\n".join(urls)
|
||||
|
||||
client = await post.platform.ctx.get_client_for_static()
|
||||
msgs: list[MessageSegmentFactory] = [Text(text)]
|
||||
if post.images:
|
||||
pics = post.images
|
||||
if is_pics_mergable(pics):
|
||||
pics = await pic_merge(list(pics), post.platform.client)
|
||||
pics = await pic_merge(list(pics), client)
|
||||
msgs.append(Image(pics[0]))
|
||||
|
||||
return msgs
|
||||
|
||||
@@ -54,9 +54,10 @@ class Ht2iTheme(Theme):
|
||||
msgs.append(Text("\n".join(urls)))
|
||||
|
||||
if post.images:
|
||||
client = await post.platform.ctx.get_client_for_static()
|
||||
pics = post.images
|
||||
if is_pics_mergable(pics):
|
||||
pics = await pic_merge(list(pics), post.platform.client)
|
||||
pics = await pic_merge(list(pics), client)
|
||||
msgs.extend(map(Image, pics))
|
||||
|
||||
return msgs
|
||||
|
||||
Reference in New Issue
Block a user