Skip to main content

What are assets?

assets lets you look up Discord’s bundled images and icons by name. At startup it indexes every bundled asset by name, so you can ask for 'ChatIcon' and get the correct id for the current build. Discord ships each image and icon as a Metro module that exports a numeric id, and the app resolves that id into an image. Components that render an icon take the id. Ids change between Discord versions, so a hardcoded id is unreliable.

Looking up assets

Look up an asset by name and type (png or svg). The type defaults to png.

The Icons proxy

assets.Icons is a shortcut for the common case of turning a name into an id. Reading any property on it returns the id for that name.
Icons is shorthand for getIDByName. Use it when you want an id inline. Use getByName when you need the full record (name, type, dimensions).