From f480b0ccc8e1bd2d3007958cc6687d6120179b1c Mon Sep 17 00:00:00 2001 From: Liam Date: Tue, 16 Apr 2024 22:59:30 +0100 Subject: [PATCH] make the embed fancy --- src/app/(pages)/mojang/page.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app/(pages)/mojang/page.tsx b/src/app/(pages)/mojang/page.tsx index d185797..abb4994 100644 --- a/src/app/(pages)/mojang/page.tsx +++ b/src/app/(pages)/mojang/page.tsx @@ -44,11 +44,13 @@ async function getData(): Promise { export async function generateMetadata(): Promise { const { endpoints } = await getData(); + const maxStatusLength = Math.max(...Object.values(endpoints).map((status) => formatStatus(status).length)); let description = "The current status of Mojang Services\n\n"; description += Object.entries(endpoints) .map(([url, status]) => { - return `**${url}**: ${formatStatus(status)}`; + const formattedStatus = formatStatus(status).padEnd(maxStatusLength, " "); // Pad the status to ensure uniform width + return `${url}: ${formattedStatus}`; }) .join("\n");