From c540a515f4d8c545b9cb123b14f3fb7244732c0c Mon Sep 17 00:00:00 2001 From: vMohammad <62218284+vMohammad24@users.noreply.github.com> Date: Tue, 10 Jun 2025 23:33:07 +0300 Subject: [PATCH] tidal embeds plugin (#284) * tidal embeds plugin * Fix Patch * Bleh --------- Co-authored-by: thororen1234 <78185467+thororen1234@users.noreply.github.com> --- src/equicordplugins/tidalEmbeds/index.tsx | 47 +++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 src/equicordplugins/tidalEmbeds/index.tsx diff --git a/src/equicordplugins/tidalEmbeds/index.tsx b/src/equicordplugins/tidalEmbeds/index.tsx new file mode 100644 index 00000000..9322f74d --- /dev/null +++ b/src/equicordplugins/tidalEmbeds/index.tsx @@ -0,0 +1,47 @@ +/* + * Vencord, a Discord client mod + * Copyright (c) 2025 Vendicated and contributors + * SPDX-License-Identifier: GPL-3.0-or-later + */ + +import { EquicordDevs } from "@utils/constants"; +import definePlugin from "@utils/types"; + + +export default definePlugin({ + name: "TidalEmbeds", + description: "Embeds TIDAL songs to make them playable in Discord.", + authors: [EquicordDevs.vmohammad], + dependencies: ["MessageUpdaterAPI"], + patches: [ + { + find: "}renderEmbeds(", + replacement: { + match: /(?<=renderEmbeds\(\i\){.+?embeds\.map\(\((\i),\i\)?=>{)/, + replace: '$&if($1?.provider?.name === "TIDAL")return null;' + } + } + ], + + renderMessageAccessory({ message }) { + const tidalEmbed = message.embeds?.find(embed => embed.provider?.name === "TIDAL"); + if (!tidalEmbed) return null; + const songId = tidalEmbed?.url?.split("/").pop().split("?")[0]; + if (!songId) { + console.warn("Tidal embed found without song ID", tidalEmbed); + return null; + } + return ( +
+