Skip to content

Commit 590c556

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

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

discord/message.py

Lines changed: 3 additions & 3 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)
@@ -400,7 +400,7 @@ async def read_chunked(
400400
Parameters
401401
----------
402402
chunksize: :class:`int`
403-
The maximum size of each chunk to process.
403+
The maximum size of each chunk to process. Must be a positive non-null integer.
404404
use_cached: :class:`bool`
405405
Whether to use :attr:`proxy_url` rather than :attr:`url` when downloading
406406
the attachment. This will allow attachments to be saved after deletion

0 commit comments

Comments
 (0)