mirror of
https://github.com/KimigaiiWuyi/GenshinUID.git
synced 2025-06-03 05:59:51 +08:00
'修改:发送消息为b64'
This commit is contained in:
parent
8d2959544b
commit
24349d5e24
@ -3,10 +3,11 @@ import json
|
|||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
import string
|
import string
|
||||||
|
from io import BytesIO
|
||||||
|
from base64 import b64encode
|
||||||
|
|
||||||
from PIL import Image, ImageDraw, ImageFont
|
from PIL import Image, ImageDraw, ImageFont
|
||||||
from httpx import get
|
from httpx import get
|
||||||
from nonebot import logger
|
|
||||||
|
|
||||||
R_PATH = Path(__file__).parents[0]
|
R_PATH = Path(__file__).parents[0]
|
||||||
TEXT_PATH = R_PATH / 'texture2D'
|
TEXT_PATH = R_PATH / 'texture2D'
|
||||||
@ -481,5 +482,6 @@ async def draw_char_card(raw_data: dict, charUrl: str = None) -> bytes:
|
|||||||
img = img.convert('RGB')
|
img = img.convert('RGB')
|
||||||
result_buffer = BytesIO()
|
result_buffer = BytesIO()
|
||||||
img.save(result_buffer, format='JPEG', subsampling=0, quality=90)
|
img.save(result_buffer, format='JPEG', subsampling=0, quality=90)
|
||||||
res = result_buffer.getvalue()
|
imgmes = 'base64://' + b64encode(result_buffer.getvalue()).decode()
|
||||||
return res
|
res = imgmes
|
||||||
|
return res
|
Loading…
x
Reference in New Issue
Block a user