Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions discord/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ async def save(
deleted attachments if too much time has passed, and it does not work
on some types of attachments.
chunksize: Optional[:class:`int`]
The maximum size of each chunk to process.
The maximum size of each chunk to process. Must be a positive non-null integer.

Returns
-------
Expand All @@ -336,7 +336,7 @@ async def save(
data = await self.read(use_cached=use_cached)

if isinstance(fp, io.BufferedIOBase):
if chunksize:
if chunksize is not None:
written = 0
async for chunk in data:
written += fp.write(chunk)
Expand All @@ -347,7 +347,7 @@ async def save(
return written
else:
with open(fp, "wb") as f:
if chunksize:
if chunksize is not None:
written = 0
async for chunk in data:
written += f.write(chunk)
Expand Down Expand Up @@ -400,7 +400,7 @@ async def read_chunked(
Parameters
----------
chunksize: :class:`int`
The maximum size of each chunk to process.
The maximum size of each chunk to process. Must be a positive non-null integer.
use_cached: :class:`bool`
Whether to use :attr:`proxy_url` rather than :attr:`url` when downloading
the attachment. This will allow attachments to be saved after deletion
Expand Down