From 0fda50dfb5c751c556ef34daca1d643d4f71427e Mon Sep 17 00:00:00 2001 From: grngxd <36968271+grngxd@users.noreply.github.com> Date: Fri, 1 Aug 2025 08:33:01 +0100 Subject: [PATCH] feat: enhance user file upload overview with percentage of total capacity used --- cmd/files.ts | 15 +-------------- cmd/user.ts | 2 +- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/cmd/files.ts b/cmd/files.ts index b3b820e..5a58e94 100644 --- a/cmd/files.ts +++ b/cmd/files.ts @@ -72,20 +72,7 @@ export const on: { } = { [Events.InteractionCreate]: async (interaction: Interaction) => { if (!interaction.isButton()) return; - // old, cursed code :vomit: - - // const match = interaction.customId.match(/^s\.list\.(prev|next)\.(\d+)$/); - // if (!match) return; - - // let page = parseInt(match[2] || "1", 10); - // page = match[1] === "next" ? page + 1 : page - 1; - - // const dirtyReply = await renderList(interaction.user, interaction.user.id, page); - // const { flags, ...reply } = dirtyReply; - // await interaction.update({ ...reply }); - - // new, clean code :sunglasses: (minified since discord limits ids to 100 chars) - + const data = b64decode<{ direction: -1 | 1; user: string; diff --git a/cmd/user.ts b/cmd/user.ts index 8c747d5..4c01057 100644 --- a/cmd/user.ts +++ b/cmd/user.ts @@ -45,7 +45,7 @@ export const execute = async (interaction: ChatInputCommandInteraction) => { .setDescription("Here's your overview:") .addFields( { name: "Uploads", value: `${files.length} files`, inline: true }, - { name: "Uploaded", value: `${formatSize(totalSize)} / 15 GB`, inline: true }, + { name: "Uploaded", value: `${formatSize(totalSize)} / 15 GB (${(totalSize / (15 * 1024 * 1024 * 1024)).toFixed(2)}%)`, inline: true }, { name: "Plan", value: `Free`, inline: true } )