diff options
| author | Rapptz <[email protected]> | 2021-04-16 11:38:56 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2021-04-16 11:38:56 -0400 |
| commit | 6ba3d89076a6559895561e450a6110f015468c29 (patch) | |
| tree | 59c31d7b0dcc137b8a62a82b9e6adcfbd2227f5c /discord/message.py | |
| parent | Rewrite Asset design (diff) | |
| download | discord.py-6ba3d89076a6559895561e450a6110f015468c29.tar.xz discord.py-6ba3d89076a6559895561e450a6110f015468c29.zip | |
Revert Attachment.save code to prior implementation
Diffstat (limited to 'discord/message.py')
| -rw-r--r-- | discord/message.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/discord/message.py b/discord/message.py index 97d42704..eadd03e5 100644 --- a/discord/message.py +++ b/discord/message.py @@ -172,11 +172,11 @@ class Attachment(Hashable): The number of bytes written. """ data = await self.read(use_cached=use_cached) - if isinstance(fp, io.RawIOBase): + if isinstance(fp, io.IOBase) and fp.writable(): written = fp.write(data) if seek_begin: fp.seek(0) - return written or 0 + return written else: with open(fp, 'wb') as f: return f.write(data) |