mirror of
https://github.com/suyiiyii/nonebot-bison.git
synced 2025-06-04 02:26:11 +08:00
fix generate bug
This commit is contained in:
parent
8e61e27127
commit
01305c1cf6
@ -1,5 +1,6 @@
|
||||
import base64
|
||||
from dataclasses import dataclass, field
|
||||
from functools import reduce
|
||||
from io import BytesIO
|
||||
from typing import Optional, Union
|
||||
|
||||
@ -125,7 +126,7 @@ class Post:
|
||||
# msgs.append(Message("[CQ:image,file={url}]".format(url=pic)))
|
||||
msgs.append(MessageSegment.image(pic))
|
||||
if self.compress:
|
||||
msgs = [Message([msgs])]
|
||||
msgs = [reduce(lambda x, y: x.append(y), msgs, Message())]
|
||||
msgs.extend(self.extra_msg)
|
||||
self._message = msgs
|
||||
return self._message
|
||||
|
@ -51,3 +51,4 @@ async def test_fetch_new(arknights, dummy_user_subinfo, arknights_list_0, arknig
|
||||
assert(post.target_name == '明日方舟游戏内公告')
|
||||
assert(len(post.pics) == 1)
|
||||
assert(post.pics == ['https://ak-fs.hypergryph.com/announce/images/20210623/e6f49aeb9547a2278678368a43b95b07.jpg'])
|
||||
r = await post.generate_messages()
|
||||
|
Loading…
x
Reference in New Issue
Block a user