refactor: flatten player display component structure for game player command
This commit is contained in:
@@ -53,22 +53,12 @@ export const command: CommandMessage = {
|
|||||||
const display = {
|
const display = {
|
||||||
type: 17,
|
type: 17,
|
||||||
accent_color: 0x5865F2,
|
accent_color: 0x5865F2,
|
||||||
components: [
|
|
||||||
// Header
|
|
||||||
{
|
|
||||||
type: 9,
|
|
||||||
components: [
|
components: [
|
||||||
{
|
{
|
||||||
type: 10,
|
type: 10,
|
||||||
content: `👤 **${targetUser.username}**\n${targetUser.bot ? '🤖 Bot' : '👨 Usuario'}`
|
content: `👤 **${targetUser.username}**\n${targetUser.bot ? '🤖 Bot' : '👨 Usuario'}`
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{ type: 14, divider: true },
|
{ type: 14, divider: true },
|
||||||
// Stats Básicos
|
|
||||||
{
|
|
||||||
type: 9,
|
|
||||||
components: [
|
|
||||||
{
|
{
|
||||||
type: 10,
|
type: 10,
|
||||||
content: `**📊 ESTADÍSTICAS**\n` +
|
content: `**📊 ESTADÍSTICAS**\n` +
|
||||||
@@ -76,28 +66,16 @@ export const command: CommandMessage = {
|
|||||||
`⚔️ ATK: **${stats.damage}**\n` +
|
`⚔️ ATK: **${stats.damage}**\n` +
|
||||||
`🛡️ DEF: **${stats.defense}**\n` +
|
`🛡️ DEF: **${stats.defense}**\n` +
|
||||||
`💰 Monedas: **${wallet.coins.toLocaleString()}**`
|
`💰 Monedas: **${wallet.coins.toLocaleString()}**`
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{ type: 14, divider: true },
|
{ type: 14, divider: true },
|
||||||
// Equipo
|
|
||||||
{
|
|
||||||
type: 9,
|
|
||||||
components: [
|
|
||||||
{
|
{
|
||||||
type: 10,
|
type: 10,
|
||||||
content: `**⚔️ EQUIPO**\n` +
|
content: `**⚔️ EQUIPO**\n` +
|
||||||
(weapon ? `🗡️ Arma: **${weapon.name || weapon.key}**\n` : '🗡️ Arma: *Ninguna*\n') +
|
(weapon ? `🗡️ Arma: **${weapon.name || weapon.key}**\n` : '🗡️ Arma: *Ninguna*\n') +
|
||||||
(armor ? `🛡️ Armadura: **${armor.name || armor.key}**\n` : '🛡️ Armadura: *Ninguna*\n') +
|
(armor ? `🛡️ Armadura: **${armor.name || armor.key}**\n` : '🛡️ Armadura: *Ninguna*\n') +
|
||||||
(cape ? `🧥 Capa: **${cape.name || cape.key}**` : '🧥 Capa: *Ninguna*')
|
(cape ? `🧥 Capa: **${cape.name || cape.key}**` : '🧥 Capa: *Ninguna*')
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{ type: 14, divider: true },
|
{ type: 14, divider: true },
|
||||||
// Inventario
|
|
||||||
{
|
|
||||||
type: 9,
|
|
||||||
components: [
|
|
||||||
{
|
{
|
||||||
type: 10,
|
type: 10,
|
||||||
content: `**🎒 INVENTARIO**\n` +
|
content: `**🎒 INVENTARIO**\n` +
|
||||||
@@ -105,8 +83,6 @@ export const command: CommandMessage = {
|
|||||||
`🔢 Total items: **${inventorySum._sum.quantity ?? 0}**`
|
`🔢 Total items: **${inventorySum._sum.quantity ?? 0}**`
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
|
||||||
]
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Añadir stats de actividades si existen
|
// Añadir stats de actividades si existen
|
||||||
@@ -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,
|
|
||||||
components: [
|
|
||||||
{
|
|
||||||
type: 10,
|
type: 10,
|
||||||
content: `**🎮 ACTIVIDADES**\n${activitiesText}`
|
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,
|
|
||||||
components: [
|
|
||||||
{
|
|
||||||
type: 10,
|
type: 10,
|
||||||
content: `**🗺️ PROGRESO EN ÁREAS**\n` +
|
content: `**🗺️ PROGRESO EN ÁREAS**\n` +
|
||||||
progress.map(p => `• ${p.area.name || p.area.key}: Nivel **${p.highestLevel}**`).join('\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,
|
|
||||||
components: [
|
|
||||||
{
|
|
||||||
type: 10,
|
type: 10,
|
||||||
content: `**⏰ COOLDOWNS ACTIVOS**\n${cooldownsText}`
|
content: `**⏰ COOLDOWNS ACTIVOS**\n${cooldownsText}`
|
||||||
}
|
|
||||||
]
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user