aboutsummaryrefslogtreecommitdiff
path: root/discord/file.py
diff options
context:
space:
mode:
Diffstat (limited to 'discord/file.py')
-rw-r--r--discord/file.py4
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