Open JasonLovesDoggo opened 4 months ago
These can be fetched through the discord media proxy : https://media.discordapp.net/${activity.assets.large_image.replace("mp:", "")}
or without the discord media proxy if you don't want it, but with it, it keeps the end user's ip hidden from the server hosting the image, since that's not discord for the mp:external
assets.
activity.assets.small_image.startsWith('mp:external') ? activity.assets.small_image.replace(/mp:external\/([^\/]*)\/(http[s])/g, '$2:/')
: https://cdn.discordapp.com/app-assets/${activity.application_id}/${activity.assets.small_image}
Of course this is only targeting small_image
but you can also use the same for large_image
and this section of code will use the external link if external, or the app-assets
if it's an app asset
see https://api.lanyard.rest/v1/users/511724576674414600 (my discord id)