From 896ddf218723aec1cff0a6dcd1277b617503ec09 Mon Sep 17 00:00:00 2001 From: cnrad <83192247+cnrad@users.noreply.github.com> Date: Thu, 12 Aug 2021 21:37:15 -0400 Subject: [PATCH] feat: idleMessage customization --- src/renderCard.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/renderCard.tsx b/src/renderCard.tsx index 04d03ef..cf1a3bb 100644 --- a/src/renderCard.tsx +++ b/src/renderCard.tsx @@ -15,6 +15,7 @@ type Parameters = { hideStatus?: string; hideTimestamp?: string; borderRadius?: string; + idleMessage?: string; }; const elapsedTime = (timestamp: any) => { @@ -51,7 +52,8 @@ const renderCard = async (body: LanyardTypes.Root, params: Parameters): Promise< discrim = "show", hideStatus = "false", hideTimestamp = "false", - borderRadius = "10px"; + borderRadius = "10px", + idleMessage = "I'm not currently doing anything!"; if (body.data.activities[0]?.emoji?.animated) statusExtension = "gif"; if (body.data.discord_user.avatar && body.data.discord_user.avatar.startsWith("a_")) avatarExtension = "gif"; @@ -64,6 +66,7 @@ const renderCard = async (body: LanyardTypes.Root, params: Parameters): Promise< theme = "light"; } if (params.bg) backgroundColor = params.bg; + if (params.idleMessage) idleMessage = params.idleMessage; if (params.borderRadius) borderRadius = params.borderRadius; let avatar: String; @@ -445,8 +448,9 @@ const renderCard = async (body: LanyardTypes.Root, params: Parameters): Promise< font-size: 0.8rem; color: ${theme === "dark" ? "#aaa" : "#444"}; height: auto; + text-align: center; "> - I'm not currently doing anything! + ${escape(idleMessage)}

` : ``