diff --git a/docs/reference.mdx b/docs/reference.mdx index c451adbf47..0d7503e6b9 100644 --- a/docs/reference.mdx +++ b/docs/reference.mdx @@ -325,33 +325,34 @@ Discord uses ids and hashes to render images in the client. These hashes can be | PNG | .png | | WebP | .webp | | GIF | .gif | +| AVIF | .avif | | Lottie | .json | ###### CDN Endpoints -| Type | Path | Supports | -|-----------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------| -| Custom Emoji | emojis/[emoji_id](/docs/resources/emoji#emoji-object).png | PNG, JPEG, WebP, GIF | -| Guild Icon | icons/[guild_id](/docs/resources/guild#guild-object)/[guild_icon](/docs/resources/guild#guild-object).png \* | PNG, JPEG, WebP, GIF | -| Guild Splash | splashes/[guild_id](/docs/resources/guild#guild-object)/[guild_splash](/docs/resources/guild#guild-object).png | PNG, JPEG, WebP | -| Guild Discovery Splash | discovery-splashes/[guild_id](/docs/resources/guild#guild-object)/[guild_discovery_splash](/docs/resources/guild#guild-object).png | PNG, JPEG, WebP | -| Guild Banner | banners/[guild_id](/docs/resources/guild#guild-object)/[guild_banner](/docs/resources/guild#guild-object).png \* | PNG, JPEG, WebP, GIF | -| User Banner | banners/[user_id](/docs/resources/user#user-object)/[user_banner](/docs/resources/user#user-object).png \* | PNG, JPEG, WebP, GIF | -| Default User Avatar | embed/avatars/[index](/docs/resources/user#user-object).png \*\* \*\*\* | PNG | -| User Avatar | avatars/[user_id](/docs/resources/user#user-object)/[user_avatar](/docs/resources/user#user-object).png \* | PNG, JPEG, WebP, GIF | -| Guild Member Avatar | guilds/[guild_id](/docs/resources/guild#guild-object)/users/[user_id](/docs/resources/user#user-object)/avatars/[member_avatar](/docs/resources/guild#guild-member-object).png \* | PNG, JPEG, WebP, GIF | -| Avatar Decoration | avatar-decoration-presets/[avatar_decoration_data_asset](/docs/resources/user#avatar-decoration-data-object).png | PNG | -| Application Icon | app-icons/[application_id](/docs/resources/application#application-object)/[icon](/docs/resources/application#application-object).png | PNG, JPEG, WebP | -| Application Cover | app-icons/[application_id](/docs/resources/application#application-object)/[cover_image](/docs/resources/application#application-object).png | PNG, JPEG, WebP | -| Application Asset | app-assets/[application_id](/docs/resources/application#application-object)/[asset_id](/docs/events/gateway-events#activity-object-activity-assets).png | PNG, JPEG, WebP | -| Achievement Icon | app-assets/[application_id](/docs/resources/application#application-object)/achievements/[achievement_id](https://github.com/discord/discord-api-docs/blob/legacy-gamesdk/docs/game_sdk/Achievements.md#user-achievement-struct)/icons/[icon_hash](https://github.com/discord/discord-api-docs/blob/legacy-gamesdk/docs/game_sdk/Achievements.md#user-achievement-struct).png | PNG, JPEG, WebP | -| Store Page Asset | app-assets/[application_id](/docs/resources/application#application-object)/store/asset_id | PNG, JPEG, WebP | -| Sticker Pack Banner | app-assets/710982414301790216/store/[sticker_pack_banner_asset_id](/docs/resources/sticker#sticker-pack-object).png | PNG, JPEG, WebP | -| Team Icon | team-icons/[team_id](/docs/topics/teams#data-models-team-object)/[team_icon](/docs/topics/teams#data-models-team-object).png | PNG, JPEG, WebP | -| Sticker | stickers/[sticker_id](/docs/resources/sticker#sticker-object).png \*\*\* \*\*\*\* | PNG, Lottie, GIF | -| Role Icon | role-icons/[role_id](/docs/topics/permissions#role-object)/[role_icon](/docs/topics/permissions#role-object).png | PNG, JPEG, WebP | -| Guild Scheduled Event Cover | guild-events/[scheduled_event_id](/docs/resources/guild-scheduled-event#guild-scheduled-event-object)/[scheduled_event_cover_image](/docs/resources/guild-scheduled-event#guild-scheduled-event-object).png | PNG, JPEG, WebP | -| Guild Member Banner | guilds/[guild_id](/docs/resources/guild#guild-object)/users/[user_id](/docs/resources/user#user-object)/banners/[member_banner](/docs/resources/guild#guild-member-object).png \* | PNG, JPEG, WebP, GIF | +| Type | Path | Supports | +|-----------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------| +| Custom Emoji | emojis/[emoji_id](/docs/resources/emoji#emoji-object).png \*\*\*\*\* | PNG, JPEG, WebP, GIF, AVIF | +| Guild Icon | icons/[guild_id](/docs/resources/guild#guild-object)/[guild_icon](/docs/resources/guild#guild-object).png \* | PNG, JPEG, WebP, GIF | +| Guild Splash | splashes/[guild_id](/docs/resources/guild#guild-object)/[guild_splash](/docs/resources/guild#guild-object).png | PNG, JPEG, WebP | +| Guild Discovery Splash | discovery-splashes/[guild_id](/docs/resources/guild#guild-object)/[guild_discovery_splash](/docs/resources/guild#guild-object).png | PNG, JPEG, WebP | +| Guild Banner | banners/[guild_id](/docs/resources/guild#guild-object)/[guild_banner](/docs/resources/guild#guild-object).png \* | PNG, JPEG, WebP, GIF | +| User Banner | banners/[user_id](/docs/resources/user#user-object)/[user_banner](/docs/resources/user#user-object).png \* | PNG, JPEG, WebP, GIF | +| Default User Avatar | embed/avatars/[index](/docs/resources/user#user-object).png \*\* \*\*\* | PNG | +| User Avatar | avatars/[user_id](/docs/resources/user#user-object)/[user_avatar](/docs/resources/user#user-object).png \* | PNG, JPEG, WebP, GIF | +| Guild Member Avatar | guilds/[guild_id](/docs/resources/guild#guild-object)/users/[user_id](/docs/resources/user#user-object)/avatars/[member_avatar](/docs/resources/guild#guild-member-object).png \* | PNG, JPEG, WebP, GIF | +| Avatar Decoration | avatar-decoration-presets/[avatar_decoration_data_asset](/docs/resources/user#avatar-decoration-data-object).png | PNG | +| Application Icon | app-icons/[application_id](/docs/resources/application#application-object)/[icon](/docs/resources/application#application-object).png | PNG, JPEG, WebP | +| Application Cover | app-icons/[application_id](/docs/resources/application#application-object)/[cover_image](/docs/resources/application#application-object).png | PNG, JPEG, WebP | +| Application Asset | app-assets/[application_id](/docs/resources/application#application-object)/[asset_id](/docs/events/gateway-events#activity-object-activity-assets).png | PNG, JPEG, WebP | +| Achievement Icon | app-assets/[application_id](/docs/resources/application#application-object)/achievements/[achievement_id](https://github.com/discord/discord-api-docs/blob/legacy-gamesdk/docs/game_sdk/Achievements.md#user-achievement-struct)/icons/[icon_hash](https://github.com/discord/discord-api-docs/blob/legacy-gamesdk/docs/game_sdk/Achievements.md#user-achievement-struct).png | PNG, JPEG, WebP | +| Store Page Asset | app-assets/[application_id](/docs/resources/application#application-object)/store/asset_id | PNG, JPEG, WebP | +| Sticker Pack Banner | app-assets/710982414301790216/store/[sticker_pack_banner_asset_id](/docs/resources/sticker#sticker-pack-object).png | PNG, JPEG, WebP | +| Team Icon | team-icons/[team_id](/docs/topics/teams#data-models-team-object)/[team_icon](/docs/topics/teams#data-models-team-object).png | PNG, JPEG, WebP | +| Sticker | stickers/[sticker_id](/docs/resources/sticker#sticker-object).png \*\*\* \*\*\*\* | PNG, Lottie, GIF | +| Role Icon | role-icons/[role_id](/docs/topics/permissions#role-object)/[role_icon](/docs/topics/permissions#role-object).png | PNG, JPEG, WebP | +| Guild Scheduled Event Cover | guild-events/[scheduled_event_id](/docs/resources/guild-scheduled-event#guild-scheduled-event-object)/[scheduled_event_cover_image](/docs/resources/guild-scheduled-event#guild-scheduled-event-object).png | PNG, JPEG, WebP | +| Guild Member Banner | guilds/[guild_id](/docs/resources/guild#guild-object)/users/[user_id](/docs/resources/user#user-object)/banners/[member_banner](/docs/resources/guild#guild-member-object).png \* | PNG, JPEG, WebP, GIF | \* In the case of endpoints that support GIFs, the hash will begin with `a_` if it is available in GIF format. These images can also be retrieved as animated WebP using the `?animated=true` querystring parameter. (example: `a_1269e74af4df7417b13759eae50c83dc`) @@ -361,6 +362,8 @@ Discord uses ids and hashes to render images in the client. These hashes can be \*\*\*\* In the case of the Sticker endpoint, the sticker will be available as PNG if its [`format_type`](/docs/resources/sticker#sticker-object) is `PNG` or `APNG`, GIF if its `format_type` is `GIF`, and as [Lottie](https://airbnb.io/lottie/#/) if its `format_type` is `LOTTIE`. +\*\*\*\*\* For Custom Emoji, we highly recommend requesting emojis as WebP for maximum performance and compatibility. Emojis can be uploaded as JPEG, PNG, GIF, WebP, and AVIF formats. WebP and AVIF formats must be requested as WebP since they don't convert well to other formats. The Discord client uses WebP for all emojis displayed in-app. See the [Emoji Resource](/docs/resources/emoji) page for more details. + :::info Sticker GIFs do not use the CDN base url, and can be accessed at `https://media.discordapp.net/stickers/.gif`. ::: diff --git a/docs/resources/emoji.mdx b/docs/resources/emoji.mdx index 886dd112c6..f69fe6ce62 100644 --- a/docs/resources/emoji.mdx +++ b/docs/resources/emoji.mdx @@ -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 + +Emoji can be uploaded as JPEG, PNG, GIF, WebP, and AVIF formats. All emoji (regardless of original format) can be served as WebP. We highly recommend that developers use the `.webp` extension when fetching emoji so they're rendered as WebP for maximum performance and compatibility. The Discord client uses WebP for all emoji displayed in-app. + +Still WebP emoji can be requested using the `.webp` file extension. For animated WebP emoji, use the `.webp` extension with the `?animated=true` query parameter. + ###### Application-Owned Emoji An application can own up to 2000 emojis that can only be used by that app. @@ -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 that developers use the `.webp` extension when fetching emoji so they're rendered as WebP for maximum performance and compatibility. See the [Emoji Formats](/docs/resources/emoji#emoji-object-emoji-formats) section above for more details. +::: + :::info This endpoint supports the `X-Audit-Log-Reason` header. ::: @@ -192,6 +202,10 @@ Create a new emoji for the application. Returns the new [emoji](/docs/resources/ 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 that developers use the `.webp` extension when fetching emoji so they're rendered as WebP for maximum performance and compatibility. See the [Emoji Formats](/docs/resources/emoji#emoji-object-emoji-formats) section above for more details. +::: + ###### JSON Params | Field | Type | Description |