diff --git a/README.md b/README.md index 87bed15..31c079a 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,10 @@ If you don't want people seeing the profile you have on Discord, append the quer If you don't want people seeing the your activity, append the query param `hideActivity=true` to the end of the URL or use `hideActivity=whenNotUsed` to hide activity section when there's no activity to display. Activity are shown by default. +### ___Hide Spotify___ + +If you don't want people seeing your Spotify activity, append the query param `hideSpotify=true` to the end of the URL. Spotify activity is shown by default. + ### ___Hide App by ID___ If you don't want display a specific application, append the query param `ignoreAppId=:app_id` to the end of the URL, IDs separate by `,`. diff --git a/src/renderCard.tsx b/src/renderCard.tsx index 35841b6..a8c1480 100644 --- a/src/renderCard.tsx +++ b/src/renderCard.tsx @@ -16,6 +16,7 @@ type Parameters = { hideBadges?: string; hideProfile?: string; hideActivity?: string; + hideSpotify?: string; ignoreAppId?: string; showDisplayName?: string; borderRadius?: string; @@ -69,6 +70,7 @@ const renderCard = async (body: LanyardTypes.Root, params: Parameters): Promise< let hideBadges = parseBool(params.hideBadges); let hideProfile = parseBool(params.hideProfile); let hideActivity = params.hideActivity ?? "false"; + let hideSpotify = parseBool(params.hideSpotify); let ignoreAppId = parseAppId(params.ignoreAppId); let hideDiscrim = parseBool(params.hideDiscrim); let showDisplayName = parseBool(params.showDisplayName); @@ -136,6 +138,7 @@ const renderCard = async (body: LanyardTypes.Root, params: Parameters): Promise< if (hideProfile) return "130"; if (hideActivity === "true") return "91"; if (hideActivity === "whenNotUsed" && !activity && !data.listening_to_spotify) return "91"; + if (hideSpotify && data.listening_to_spotify) return "210"; return "210"; } @@ -144,6 +147,7 @@ const renderCard = async (body: LanyardTypes.Root, params: Parameters): Promise< if (hideProfile) return "120"; if (hideActivity === "true") return "81"; if (hideActivity === "whenNotUsed" && !activity && !data.listening_to_spotify) return "81"; + if (hideSpotify && data.listening_to_spotify) return "200"; return "200"; } @@ -412,7 +416,7 @@ const renderCard = async (body: LanyardTypes.Root, params: Parameters): Promise< } ${ - data.listening_to_spotify && !activity && data.activities[Object.keys(data.activities).length - 1].type === 2 + data.listening_to_spotify && !activity && !hideSpotify && data.activities[Object.keys(data.activities).length - 1].type === 2 ? `