mirror of
https://github.com/Genshin-bots/gsuid_core.git
synced 2025-05-12 06:55:49 +08:00
🐛 重复转换链接
This commit is contained in:
parent
22ef03da38
commit
bc3fb49938
@ -177,6 +177,7 @@ class MessageSegment:
|
|||||||
async def _conver_image_to_url(message: Message) -> List[Message]:
|
async def _conver_image_to_url(message: Message) -> List[Message]:
|
||||||
if pclient is not None:
|
if pclient is not None:
|
||||||
img_text: str = message.data # type: ignore
|
img_text: str = message.data # type: ignore
|
||||||
|
if img_text.startswith('base64://'):
|
||||||
bio = BytesIO(b64decode(img_text[9:]))
|
bio = BytesIO(b64decode(img_text[9:]))
|
||||||
img = Image.open(bio)
|
img = Image.open(bio)
|
||||||
img_url = await pclient.upload(f'{uuid.uuid4()}.jpg', bio)
|
img_url = await pclient.upload(f'{uuid.uuid4()}.jpg', bio)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user