Skip to content

Commit fb74ffc

Browse files
committed
♻️ Make Attachment.save clearer by expliciting that chunksize is non-null
1 parent 54f6576 commit fb74ffc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

discord/message.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ async def save(
314314
deleted attachments if too much time has passed, and it does not work
315315
on some types of attachments.
316316
chunksize: Optional[:class:`int`]
317-
The maximum size of each chunk to process.
317+
The maximum size of each chunk to process. Must be a positive non-null integer.
318318
319319
Returns
320320
-------
@@ -336,7 +336,7 @@ async def save(
336336
data = await self.read(use_cached=use_cached)
337337

338338
if isinstance(fp, io.BufferedIOBase):
339-
if chunksize:
339+
if chunksize is not None:
340340
written = 0
341341
async for chunk in data:
342342
written += fp.write(chunk)

0 commit comments

Comments
 (0)