From a257926609d9c88f44015ee0b06040be5936d85f Mon Sep 17 00:00:00 2001 From: AutumnVN Date: Sun, 5 Nov 2023 00:45:17 +0700 Subject: [PATCH] customRpc: fix discord attachment link (#1949) --- src/plugins/customRPC/index.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/customRPC/index.tsx b/src/plugins/customRPC/index.tsx index 8ed74121..feed52fd 100644 --- a/src/plugins/customRPC/index.tsx +++ b/src/plugins/customRPC/index.tsx @@ -30,6 +30,7 @@ const ActivityClassName = findByPropsLazy("activity", "buttonColor"); const Colors = findByPropsLazy("profileColors"); async function getApplicationAsset(key: string): Promise { + if (/https?:\/\/(cdn|media)\.discordapp\.(com|net)\/attachments\//.test(key)) return "mp:" + key.replace(/https?:\/\/(cdn|media)\.discordapp\.(com|net)\//, ""); return (await ApplicationAssetUtils.fetchAssetIds(settings.store.appID!, [key]))[0]; }