diff options
| author | Rapptz <[email protected]> | 2019-03-06 20:07:38 -0500 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2019-03-06 20:07:38 -0500 |
| commit | aceec2009a7c819d2236884fa9ccc5ce58a92bea (patch) | |
| tree | 281f93e67a11d5c7d4b67f9e14dfe91aab860aa4 | |
| parent | Added cached saving for attachments (diff) | |
| download | discord.py-aceec2009a7c819d2236884fa9ccc5ce58a92bea.tar.xz discord.py-aceec2009a7c819d2236884fa9ccc5ce58a92bea.zip | |
Have use_cached=True by default for Attachment.save.
Also touch up the documentation a bit.
| -rw-r--r-- | discord/message.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/discord/message.py b/discord/message.py index ef4fae54..32eb9b0d 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 -------- |