New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(MessageAttachment): allow files to be marked as spoilers #6509
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Has this been tested? This method is calling the spoiler getter, which returns the basename utility method and passes the URL across. But that won't exist via instantiating this class and will throw an error?
I suggested the brackets exactly because of that. You should install eslint locally so that it tells you about these errors before pushing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Imo you only need 1 return at the end, the others are redundant. Otherwise LGTM
This is a bit strange now. If a user runs |
Tbh it should’ve been like that from the beginning, and it’s as simple as adding |
Yeah, I actually agree with this idea since it's the shortest approach to do and it simplifies the job and any future tasks that needs name validation. I'll commit this, along with the if/else-if thing, as it was suggested to be removed by ckohen earlier on. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove x === boolean
in favour of x
and !x
Done, suggestions have been committed |
Co-authored-by: Antonio Román <kyradiscord@gmail.com>
This is unusual. It seems all 4 checks failed to request npm. Kindly rerun them again later. 😄 |
|
Done |
Please describe the changes this PR makes and why it should be merged:
This allows users to mark media as spoilers before sending them to Discord's API. The motivation behind this is for convenience, as in, users not needing to place the
SPOILER_
string.You'll see a validation if the given argument is false, as it's possible to have the spoiler string inside the string itself, hence removing the title users would expect.
I have adapted this PR from
#6473
but I didn't make it an equivalent setter as the function is more easy to use.Resolves #6473
Status and versioning classification: