mirror of
https://github.com/Genshin-bots/gsuid_core.git
synced 2025-07-02 21:13:31 +00:00
🐛 重复转换链接
This commit is contained in:
@ -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)
|
||||||
|
Reference in New Issue
Block a user