feat: enhance user file upload overview with percentage of total capacity used

This commit is contained in:
grngxd 2025-08-01 08:33:01 +01:00
parent fcaf8fee75
commit 0fda50dfb5
2 changed files with 2 additions and 15 deletions

View file

@ -72,20 +72,7 @@ export const on: {
} = {
[Events.InteractionCreate]: async (interaction: Interaction<CacheType>) => {
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;

View file

@ -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 }
)