Restructure bot

This commit is contained in:
Dominic Ferrando
2026-09-26 21:06:06 -04:00
parent db206bafa3
commit 7f791babd4
5 changed files with 51 additions and 48 deletions
+44
View File
@@ -0,0 +1,44 @@
import { EmbedBuilder, type Message } from "discord.js";
import type { Command } from "../../models";
import { api } from "../../util";
const ATTRIBUTE_EMOJI: Record<string, string> = {
Strength: "💪",
Power: "⚡",
Endurance: "🏃",
Agility: "🤸",
};
export default {
name: "stats",
description: "View your fitness statistics!",
usage: ".stats",
execute: async (message: Message) => {
const res = await api.accounts({ id: `@${message.author.id}` }).stats.get();
if (res.error) return;
if (!res.data) {
await message.reply("No stats found yet — submit an assessment first!");
return;
}
const { player, attributes } = res.data;
const embed = new EmbedBuilder()
.setColor(0xEEE8AA)
.setTitle(`${message.author.username}'s Stats`)
.setThumbnail(message.author.displayAvatarURL())
.setDescription(`**Overall Level: ${player}**`)
.addFields(
Object.entries(attributes).map(([attribute, level]) => ({
name: `${ATTRIBUTE_EMOJI[attribute] ?? ""} ${attribute}`,
value: `Level ${level}`,
inline: true,
}))
)
.setFooter({ text: "Blade & Brawn" })
.setTimestamp();
await message.reply({ embeds: [embed] });
}
} satisfies Command;