-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
refactor(formatters): Change :_: emoji name placeholder
#10567
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
refactor(formatters): Change :_: emoji name placeholder
#10567
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Skipped Deployments
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #10567 +/- ##
==========================================
- Coverage 38.16% 37.84% -0.32%
==========================================
Files 239 239
Lines 15500 15421 -79
Branches 1371 1332 -39
==========================================
- Hits 5915 5836 -79
Misses 9570 9570
Partials 15 15
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Jiralite
left a comment
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.
I personally would rather keep this as-is for the current minor version and make name required in the future. Thoughts? @vladfrangu @almeidx
🤷. We can also just have a fallback on |
* Change `:_:` emoji name placeholder * Update tests * Format
Please describe the changes this PR makes and why it should be merged:
Discord doesn't verify emoji names, meaning you only actually need to include a valid ID for an emoji to display properly. Discord.js uses


_as a fallback name when formatting emojis with just an ID. However, since_is not a valid emoji name, if you were to parse that emoji, it would fail, which could be unexpected behavior.Additionally, if you were to have multiple emojis with the

_name placeholder and invalid IDs (or if the bot doesn't have access to the emoji), they fail to render in Discord and the text between them becomes unintentionally italicized. For example,<:_:123678901234578> foobar <:_:123678901234578>This is another unintentional side-effect of using
:_:as a placeholder emoji name that end-users currently have to look out for.To fix this, I changed the
:_:placeholder to:emoji:. This way it is a valid emoji name that parses correctly and doesn't interfere with any other Markdown features. Originally, I was going to change it to:__:, which would parse correctly, but causes text between invalid emojis to be underlined.In my opinion,

parseEmojishould also be changed to properly support emojis that used:_:in the past, because even though it's not a valid emoji name, it does still render correctly, but people in the support server disagreedStatus and versioning classification: