diff options
| author | Josh <[email protected]> | 2021-01-17 15:18:10 +1000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-01-17 00:18:10 -0500 |
| commit | fce67c32c93cb157dae2ed2c9af3146444ea58eb (patch) | |
| tree | 49809662e1e3fd9d217deb781556bbfdc49ec0ef | |
| parent | [commands] Add linesep kwarg to Paginator (diff) | |
| download | discord.py-fce67c32c93cb157dae2ed2c9af3146444ea58eb.tar.xz discord.py-fce67c32c93cb157dae2ed2c9af3146444ea58eb.zip | |
Add spoiler attribute to File
| -rw-r--r-- | discord/file.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/discord/file.py b/discord/file.py index 30b22422..442931c3 100644 --- a/discord/file.py +++ b/discord/file.py @@ -58,7 +58,7 @@ class File: Whether the attachment is a spoiler. """ - __slots__ = ('fp', 'filename', '_original_pos', '_owner', '_closer') + __slots__ = ('fp', 'filename', 'spoiler', '_original_pos', '_owner', '_closer') def __init__(self, fp, filename=None, *, spoiler=False): self.fp = fp @@ -92,6 +92,8 @@ class File: if spoiler and self.filename is not None and not self.filename.startswith('SPOILER_'): self.filename = 'SPOILER_' + self.filename + self.spoiler = spoiler or (self.filename is not None and self.filename.startswith('SPOILER_')) + def reset(self, *, seek=True): # The `seek` parameter is needed because # the retry-loop is iterated over multiple times |