mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-02-20 09:38:23 +08:00
🐛 BytesIO cursor 可能不在开头
This commit is contained in:
parent
474fd10613
commit
fff7d3bff6
@ -89,7 +89,7 @@ class MessageSegment(BaseMessageSegment["Message"]):
|
|||||||
proxy: bool = True,
|
proxy: bool = True,
|
||||||
timeout: Optional[int] = None) -> "MessageSegment":
|
timeout: Optional[int] = None) -> "MessageSegment":
|
||||||
if isinstance(file, BytesIO):
|
if isinstance(file, BytesIO):
|
||||||
file = file.read()
|
file = file.getvalue()
|
||||||
if isinstance(file, bytes):
|
if isinstance(file, bytes):
|
||||||
file = f"base64://{b64encode(file).decode()}"
|
file = f"base64://{b64encode(file).decode()}"
|
||||||
elif isinstance(file, Path):
|
elif isinstance(file, Path):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user