mirror of
https://github.com/KimigaiiWuyi/GenshinUID.git
synced 2025-05-12 06:55:58 +08:00
🐛 修复onebot_v12
文件发送乱码 (#516)
This commit is contained in:
parent
798020fae5
commit
a54b19e2aa
@ -668,11 +668,11 @@ async def onebot_v12_send(
|
|||||||
await send_file_message(params, "image", file_id)
|
await send_file_message(params, "image", file_id)
|
||||||
elif file:
|
elif file:
|
||||||
file_name, file_content = file.split('|')
|
file_name, file_content = file.split('|')
|
||||||
file_content = base64.b64decode(file)
|
file_data = base64.b64decode(file_content)
|
||||||
up_data = await bot.call_api(
|
up_data = await bot.call_api(
|
||||||
'upload_file',
|
'upload_file',
|
||||||
type="data",
|
type="data",
|
||||||
data=file_content,
|
data=file_data,
|
||||||
name=f"{file_name}",
|
name=f"{file_name}",
|
||||||
)
|
)
|
||||||
file_id = up_data['file_id']
|
file_id = up_data['file_id']
|
||||||
|
Loading…
x
Reference in New Issue
Block a user