Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- async def save(self, fp, *, seek_begin=True, use_cached=False):
- """|coro|
- Saves this attachment into a file-like object.
- Parameters
- -----------
- fp: Union[:class:`io.BufferedIOBase`, :class:`os.PathLike`]
- 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: :class:`bool`
- Whether to seek to the beginning of the file after saving is
- successfully done.
- 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, compared to the regular URL 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 and it does not work
- on some types of attachments.
- Raises
- --------
- HTTPException
- Saving the attachment failed.
- NotFound
- The attachment was deleted.
- Returns
- --------
- :class:`int`
- The number of bytes written.
- """
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement