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