Skip to content

[docs] Document WebP support for emoji requests #7568

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

Merged
merged 7 commits into from
May 22, 2025

Conversation

skidder
Copy link
Contributor

@skidder skidder commented May 21, 2025

Summary

  • Add information about supported emoji upload formats
  • Explain that all emoji formats can be served as WebP
  • Recommend WebP for maximum performance and compatibility
  • Document how to request still and animated WebP emojis

Fixes #7567

Fixes #7567

- Add information about supported emoji upload formats
- Explain that all emoji formats can be served as WebP
- Recommend WebP for maximum performance and compatibility
- Document how to request still and animated WebP emojis
@skidder skidder requested a review from a team as a code owner May 21, 2025 01:12
@skidder skidder requested review from markmandel and removed request for a team May 21, 2025 01:12
@NeloBlivion
Copy link

NeloBlivion commented May 21, 2025

Would also be good if this was added as an asterisk/note on the CDN Endpoints table

skidder added 2 commits May 20, 2025 18:34
- Add AVIF to supported image formats
- Add AVIF to supported Custom Emoji formats
- Include emoji format information and WebP recommendations in footnotes
@skidder skidder enabled auto-merge (squash) May 21, 2025 21:00
@@ -110,6 +116,10 @@ Create a new emoji for the guild. Requires the `CREATE_GUILD_EXPRESSIONS` permis
Emojis and animated emojis have a maximum file size of 256 KiB. Attempting to upload an emoji larger than this limit will fail and return 400 Bad Request and an error message, but not a [JSON status code](/docs/topics/opcodes-and-status-codes#json).
:::

:::info
We highly recommend requesting emojis as WebP for maximum performance and compatibility. See the Emoji Formats section above for more details.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: "Emoji Formats" have it link to the header above, so it's easy to get to.

Suggested change
We highly recommend requesting emojis as WebP for maximum performance and compatibility. See the Emoji Formats section above for more details.
We highly recommend requesting emojis as WebP for maximum performance and compatibility. See the [Emoji Formats](#emoji-object-emoji-formats) section above for more details.

@@ -30,6 +30,12 @@ An emoji cannot have both subscription roles and non-subscription roles.
Emojis with subscription roles are considered premium emoji, and count toward a separate limit of 25.
Emojis cannot be converted between normal and premium after creation.

###### Emoji Formats

Emojis can be uploaded as JPEG, PNG, GIF, WebP, and AVIF formats. All emojis (regardless of original format) can be served as WebP. We highly recommend that developers request emojis as WebP for maximum performance and compatibility. The Discord client uses WebP for all emojis displayed in-app.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than "request" emoji, should it be "submit emoji" (across the board)?

"request" feels like you are asking someone to submit something to me. Unless I'm missing a chunk of context, which is possible.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that is referring to fetching the images that already exist, not uploading new emoji

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a silly question, since I don't know this area as well as others -- how are you requesting the emoji? Is there an API for requesting an emoji from somewhere? (that's what it reads like to me).

If not, I'd lean more towards something like:

Suggested change
Emojis can be uploaded as JPEG, PNG, GIF, WebP, and AVIF formats. All emojis (regardless of original format) can be served as WebP. We highly recommend that developers request emojis as WebP for maximum performance and compatibility. The Discord client uses WebP for all emojis displayed in-app.
Emojis can be uploaded as JPEG, PNG, GIF, WebP, and AVIF formats. All emojis (regardless of original format) can be served as WebP. We highly recommend that developers choose WebP emoji for maximum performance and compatibility. The Discord client uses WebP for all emojis displayed in-app.

Since that clears any ambiguity. WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right that the wording is ambiguous. 'Request' here refers to when developers fetch emoji (GET requests), not when they upload them. I'll update the text to: 'We highly recommend that developers use the .webp extension when fetching emojis so they're rendered as WebP for maximum performance and compatibility.' This makes it clear we're talking about the file extension used when retrieving existing emojis.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻 love it. LGTM!

Welp, looks like it fails on the #emoji-object-emoji-formats 🤔 I wonder why that is.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...and you worked it out faster than I did. Full links required. [Emoji Formats](/docs/resources/emoji#emoji-object-emoji-formats)

@skidder skidder requested a review from markmandel May 22, 2025 17:41
Copy link
Contributor

@markmandel markmandel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻

@skidder skidder merged commit 2e52d43 into main May 22, 2025
4 checks passed
@skidder skidder deleted the skidder/emoji-webp-avif-format branch May 22, 2025 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WebP files uploaded as Emoji do not support .gif CDN extension
4 participants