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 ( +