mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-16 06:03:11 +00:00
Fix filename spoiler stripping method
lstrip does not work as expected
This commit is contained in:
parent
f47568ee71
commit
5c14149873
@ -38,7 +38,9 @@ __all__ = (
|
||||
|
||||
|
||||
def _strip_spoiler(filename: str) -> Tuple[str, bool]:
|
||||
stripped = filename.lstrip('SPOILER_')
|
||||
stripped = filename
|
||||
while stripped.startswith('SPOILER_'):
|
||||
stripped = stripped[8:] # len('SPOILER_')
|
||||
spoiler = stripped != filename
|
||||
return stripped, spoiler
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user