refactor: flatten player display component structure for game player command

This commit is contained in:
2025-10-05 16:49:22 -05:00
parent fa11000052
commit e10e3a9e89

View File

@@ -53,22 +53,12 @@ export const command: CommandMessage = {
const display = {
type: 17,
accent_color: 0x5865F2,
components: [
// Header
{
type: 9,
components: [
{
type: 10,
content: `👤 **${targetUser.username}**\n${targetUser.bot ? '🤖 Bot' : '👨 Usuario'}`
}
]
},
{ type: 14, divider: true },
// Stats Básicos
{
type: 9,
components: [
{
type: 10,
content: `**📊 ESTADÍSTICAS**\n` +
@@ -76,28 +66,16 @@ export const command: CommandMessage = {
`⚔️ ATK: **${stats.damage}**\n` +
`🛡️ DEF: **${stats.defense}**\n` +
`💰 Monedas: **${wallet.coins.toLocaleString()}**`
}
]
},
{ type: 14, divider: true },
// Equipo
{
type: 9,
components: [
{
type: 10,
content: `**⚔️ EQUIPO**\n` +
(weapon ? `🗡️ Arma: **${weapon.name || weapon.key}**\n` : '🗡️ Arma: *Ninguna*\n') +
(armor ? `🛡️ Armadura: **${armor.name || armor.key}**\n` : '🛡️ Armadura: *Ninguna*\n') +
(cape ? `🧥 Capa: **${cape.name || cape.key}**` : '🧥 Capa: *Ninguna*')
}
]
},
{ type: 14, divider: true },
// Inventario
{
type: 9,
components: [
{
type: 10,
content: `**🎒 INVENTARIO**\n` +
@@ -105,8 +83,6 @@ export const command: CommandMessage = {
`🔢 Total items: **${inventorySum._sum.quantity ?? 0}**`
}
]
}
]
};
// Añadir stats de actividades si existen
@@ -119,13 +95,8 @@ export const command: CommandMessage = {
if (activitiesText) {
display.components.push({ type: 14, divider: true });
display.components.push({
type: 9,
components: [
{
type: 10,
content: `**🎮 ACTIVIDADES**\n${activitiesText}`
}
]
});
}
}
@@ -134,14 +105,9 @@ export const command: CommandMessage = {
if (progress.length > 0) {
display.components.push({ type: 14, divider: true });
display.components.push({
type: 9,
components: [
{
type: 10,
content: `**🗺️ PROGRESO EN ÁREAS**\n` +
progress.map(p => `${p.area.name || p.area.key}: Nivel **${p.highestLevel}**`).join('\n')
}
]
});
}
@@ -157,13 +123,8 @@ export const command: CommandMessage = {
display.components.push({ type: 14, divider: true });
display.components.push({
type: 9,
components: [
{
type: 10,
content: `**⏰ COOLDOWNS ACTIVOS**\n${cooldownsText}`
}
]
});
}