DiscordCdn class
Discord uses ids and hashes to render images in the client. These hashes can be retrieved through various API requests, like Get User. Below are the formats, size limitations, and CDN endpoints for images in Discord. The returned format can be changed by changing the extension name at the end of the URL. The returned size can be changed by appending a querystring of ?size=desired_size to the URL. Image size can be any power of two between 16 and 4096.
https://discord.com/developers/docs/reference#image-formatting
In the case of endpoints that support GIFs, the hash will begin with a_ if it is available in GIF format. (example: a_1269e74af4df7417b13759eae50c83dc)
These methods automatically return .gif endpoints for animates images and
.png endpoints for static images. This behavior can be overridden by passing
the format
parameter.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
achievementIcon(
String applicationId, String achievementId, String iconHash, {ImageFormat? format}) → String - Path: app-assets/application_id/achievements/achievement_id/icons/icon_hash.png
-
applicationAsset(
String applicationId, String assetId, {ImageFormat? format}) → String - Path: app-assets/application_id/asset_id.png
-
applicationCover(
String applicationId, String coverImage, {ImageFormat? format}) → String - Path: app-icons/application_id/cover_image.png
-
applicationIcon(
String applicationId, String icon, {ImageFormat? format}) → String - Path: app-icons/application_id/icon.png
-
defaultUserAvatar(
int userDiscriminator) → String - Path: embed/avatars/user_discriminator.png
-
emoji(
String emojiId, {ImageFormat? format}) → String - Path: emojis/emoji_id.png
-
guildBanner(
String guildId, String guildBanner, {ImageFormat? format}) → String - Path: banners/guild_id/guild_banner.png
-
guildDiscoverySplash(
String guildId, String guildDiscoverySplash, {ImageFormat? format}) → String - Path: discovery-splashes/guild_id/guild_discovery_splash.png
-
guildIcon(
String guildId, String guildIcon, {ImageFormat? format}) → String - Path: icons/guild_id/guild_icon.png
-
guildMemberAvatar(
String guildId, String userId, String memberAvatar, {ImageFormat? format}) → String - Path: guilds/guild_id/users/user_id/avatars/member_avatar.png
-
guildSplash(
String guildId, String guildSplash, {ImageFormat? format}) → String - Path: splashes/guild_id/guild_splash.png
-
roleIcon(
String roleId, String roleIcon, {ImageFormat? format}) → String - Path: role-icons/role_id/role_icon.png
-
sticker(
String stickerId, {ImageFormat? format}) → String - Path: stickers/sticker_id.png
-
stickerPackBanner(
String stickerPackBannerAssetId, {ImageFormat? format}) → String - Path: app-assets/710982414301790216/store/sticker_pack_banner_asset_id.png
-
teamIcon(
String teamId, String teamIcon, {ImageFormat? format}) → String - Path: team-icons/team_id/team_icon.png
-
userAvatar(
String userId, String userAvatar, {ImageFormat? format}) → String - Path: avatars/user_id/user_avatar.png
-
userBanner(
String userId, String userBanner, {ImageFormat? format}) → String - Path: banners/user_id/user_banner.png
Constants
- imageBaseUrl → const String
- The base url for the Discord CDN