Refactor save() and read() into AssetMixin

This commit is contained in:
Rapptz
2021-04-17 00:55:44 -04:00
parent f6fcffbab5
commit fed259a83b
4 changed files with 78 additions and 206 deletions

View File

@ -172,7 +172,7 @@ class Attachment(Hashable):
The number of bytes written.
"""
data = await self.read(use_cached=use_cached)
if isinstance(fp, io.IOBase) and fp.writable():
if isinstance(fp, io.BufferedIOBase):
written = fp.write(data)
if seek_begin:
fp.seek(0)