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

@@ -54,57 +54,33 @@ export const command: CommandMessage = {
type: 17, type: 17,
accent_color: 0x5865F2, accent_color: 0x5865F2,
components: [ components: [
// Header
{ {
type: 9, type: 10,
components: [ content: `👤 **${targetUser.username}**\n${targetUser.bot ? '🤖 Bot' : '👨 Usuario'}`
{
type: 10,
content: `👤 **${targetUser.username}**\n${targetUser.bot ? '🤖 Bot' : '👨 Usuario'}`
}
]
}, },
{ type: 14, divider: true }, { type: 14, divider: true },
// Stats Básicos
{ {
type: 9, type: 10,
components: [ content: `**📊 ESTADÍSTICAS**\n` +
{ `❤️ HP: **${stats.hp}/${stats.maxHp}**\n` +
type: 10, `⚔️ ATK: **${stats.damage}**\n` +
content: `**📊 ESTADÍSTICAS**\n` + `🛡️ DEF: **${stats.defense}**\n` +
`❤️ HP: **${stats.hp}/${stats.maxHp}**\n` + `💰 Monedas: **${wallet.coins.toLocaleString()}**`
`⚔️ ATK: **${stats.damage}**\n` +
`🛡️ DEF: **${stats.defense}**\n` +
`💰 Monedas: **${wallet.coins.toLocaleString()}**`
}
]
}, },
{ type: 14, divider: true }, { type: 14, divider: true },
// Equipo
{ {
type: 9, type: 10,
components: [ content: `**⚔️ EQUIPO**\n` +
{ (weapon ? `🗡️ Arma: **${weapon.name || weapon.key}**\n` : '🗡️ Arma: *Ninguna*\n') +
type: 10, (armor ? `🛡️ Armadura: **${armor.name || armor.key}**\n` : '🛡️ Armadura: *Ninguna*\n') +
content: `**⚔️ EQUIPO**\n` + (cape ? `🧥 Capa: **${cape.name || cape.key}**` : '🧥 Capa: *Ninguna*')
(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 }, { type: 14, divider: true },
// Inventario
{ {
type: 9, type: 10,
components: [ content: `**🎒 INVENTARIO**\n` +
{ `📦 Items únicos: **${inventoryCount}**\n` +
type: 10, `🔢 Total items: **${inventorySum._sum.quantity ?? 0}**`
content: `**🎒 INVENTARIO**\n` +
`📦 Items únicos: **${inventoryCount}**\n` +
`🔢 Total items: **${inventorySum._sum.quantity ?? 0}**`
}
]
} }
] ]
}; };
@@ -119,13 +95,8 @@ export const command: CommandMessage = {
if (activitiesText) { if (activitiesText) {
display.components.push({ type: 14, divider: true }); display.components.push({ type: 14, divider: true });
display.components.push({ display.components.push({
type: 9, type: 10,
components: [ content: `**🎮 ACTIVIDADES**\n${activitiesText}`
{
type: 10,
content: `**🎮 ACTIVIDADES**\n${activitiesText}`
}
]
}); });
} }
} }
@@ -134,14 +105,9 @@ export const command: CommandMessage = {
if (progress.length > 0) { if (progress.length > 0) {
display.components.push({ type: 14, divider: true }); display.components.push({ type: 14, divider: true });
display.components.push({ display.components.push({
type: 9, type: 10,
components: [ content: `**🗺️ PROGRESO EN ÁREAS**\n` +
{ progress.map(p => `${p.area.name || p.area.key}: Nivel **${p.highestLevel}**`).join('\n')
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: 14, divider: true });
display.components.push({ display.components.push({
type: 9, type: 10,
components: [ content: `**⏰ COOLDOWNS ACTIVOS**\n${cooldownsText}`
{
type: 10,
content: `**⏰ COOLDOWNS ACTIVOS**\n${cooldownsText}`
}
]
}); });
} }