F

register

Registers an image generated at runtime, such as a data: URI or a file the plugin wrote, with Discord's asset registry, so <Image source={id}> and Discord's icon props draw it. Images a plugin imports are registered for it. A plugin's names never collide with another's, and its registrations end when it stops.

function register(options: AssetRegistration): RegisteredAsset

Parameters

NameTypeDescription
optionsAssetRegistration

The image: its name, uri or path, size in points, type and other scales.

Returns

RegisteredAsset

The asset's id, and unregister.