From aceec2009a7c819d2236884fa9ccc5ce58a92bea Mon Sep 17 00:00:00 2001 From: Rapptz Date: Wed, 6 Mar 2019 20:07:38 -0500 Subject: [PATCH] Have use_cached=True by default for Attachment.save. Also touch up the documentation a bit. --- discord/message.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/discord/message.py b/discord/message.py index ef4fae548..32eb9b0d8 100644 --- a/discord/message.py +++ b/discord/message.py @@ -77,7 +77,7 @@ class Attachment: """:class:`bool`: Whether this attachment contains a spoiler.""" return self.filename.startswith('SPOILER_') - async def save(self, fp, *, seek_begin=True, use_cached=False): + async def save(self, fp, *, seek_begin=True, use_cached=True): """|coro| Saves this attachment into a file-like object. @@ -88,15 +88,15 @@ class Attachment: The file-like object to save this attachment to or the filename to use. If a filename is passed then a file is created with that filename and used instead. - seek_begin: bool + seek_begin: :class:`bool` Whether to seek to the beginning of the file after saving is successfully done. - use_cached: bool - Whether to use the proxy_url property, rather than the url - property, as the attachment source. This will allow attachments - to be saved after deletion more often than with the url, which - is deleted after the message is deleted. Note that use_cached will - still fail after an uncertain amount of time. + 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 + more often, which is generally deleted right after the message is deleted. + Note that this can still fail to download deleted attachments if too much time + has passed. Raises --------