From 1830ff60b05ac9b699f991e8a89f9c60ed37c2af Mon Sep 17 00:00:00 2001 From: brokiem Date: Sun, 27 Nov 2022 13:43:48 +0800 Subject: [PATCH 1/2] Add option to hide Discord profile ith hideProfile=true --- README.md | 4 ++++ src/renderCard.tsx | 11 +++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4fc6778..5f66ec0 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,10 @@ If you don't want people seeing the elapsed time on an activity, append the quer If you don't want people seeing the badges you have on Discord, append the query param `hideBadges=true` to the end of the URL. Badges are shown by default. +### ___Hide Profile___ + +If you don't want people seeing the profile you have on Discord, append the query param `hideProfile=true` to the end of the URL. Profile are shown by default. + ## ___Example URL and result___ ``` diff --git a/src/renderCard.tsx b/src/renderCard.tsx index dad8d3c..d384348 100644 --- a/src/renderCard.tsx +++ b/src/renderCard.tsx @@ -15,6 +15,7 @@ type Parameters = { hideStatus?: string; hideTimestamp?: string; hideBadges?: string; + hideProfile?: string; borderRadius?: string; idleMessage?: string; }; @@ -55,6 +56,7 @@ const renderCard = async (body: LanyardTypes.Root, params: Parameters): Promise< hideStatus = "false", hideTimestamp = "false", hideBadges = "false", + hideProfile = "false", borderRadius = "10px", idleMessage = "I'm not currently doing anything!"; @@ -65,6 +67,7 @@ const renderCard = async (body: LanyardTypes.Root, params: Parameters): Promise< if (params.hideTimestamp === "true") hideTimestamp = "true"; if (params.hideBadges === "true") hideBadges = "true"; if (params.hideDiscrim === "true") discrim = "hide"; + if (params.hideProfile === "true") hideProfile = "true"; if (params.theme === "light") { backgroundColor = "#eee"; theme = "light"; @@ -137,7 +140,7 @@ const renderCard = async (body: LanyardTypes.Root, params: Parameters): Promise<
+ + ${ + hideProfile === "true" ? "" : `
- + +