Skip to content

Commit 1fa54a9

Browse files
committed
enable stream file writer
1 parent d297858 commit 1fa54a9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/wechaty_puppet/file_box/file_box.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def __init__(self, options: FileBoxOptionsBase):
6868

6969
elif isinstance(options, FileBoxOptionsStream):
7070
# TODO -> need to get into detail for stream sending
71-
pass
71+
self.stream = options.stream
7272

7373
elif isinstance(options, FileBoxOptionsQrCode):
7474
self.qrCode = options.qr_code
@@ -192,6 +192,10 @@ async def to_file(self, file_path: Optional[str] = None,
192192
with open(file_path, 'wb') as f:
193193
f.write(data)
194194

195+
elif file_box_type == FileBoxType.Stream:
196+
with open(file_path, 'wb+') as f:
197+
f.write(self.stream)
198+
195199
def to_base64(self) -> str:
196200
"""
197201
transfer file-box to base64 string

0 commit comments

Comments
 (0)