mirror of
https://github.com/suyiiyii/nonebot-bison.git
synced 2026-05-09 18:27:56 +08:00
fix pic merge
This commit is contained in:
@@ -117,3 +117,4 @@ class Weibo(NewMessage, TargetMixin):
|
||||
detail_url = 'https://weibo.com/{}/{}'.format(info['user']['id'], info['bid'])
|
||||
# return parsed_text, detail_url, pic_urls
|
||||
return Post('weibo', text=parsed_text, url=detail_url, pics=pic_urls, target_name=info['user']['screen_name'])
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ class Post:
|
||||
target_name: Optional[str] = None
|
||||
compress: bool = False
|
||||
override_use_pic: Optional[bool] = None
|
||||
pics: list[Union[str,bytes]] = field(default_factory=list)
|
||||
pics: Union[list[Union[str,bytes]], list[str], list[bytes]] = field(default_factory=list)
|
||||
extra_msg: list[Message] = field(default_factory=list)
|
||||
|
||||
_message: Optional[list] = None
|
||||
@@ -66,6 +66,8 @@ class Post:
|
||||
x_coord.append(_tmp)
|
||||
y_coord = [0, first_image.size[1]]
|
||||
async def process_row(row: int) -> bool:
|
||||
if len(self.pics) < (row + 1) * 3:
|
||||
return False
|
||||
row_first_img = await self._pic_url_to_image(self.pics[row * 3])
|
||||
if not self._check_image_square(row_first_img.size):
|
||||
return False
|
||||
|
||||
Reference in New Issue
Block a user