From 70098988dcbba0576378126b195ed4b933dc5e47 Mon Sep 17 00:00:00 2001 From: shni Date: Sun, 5 Oct 2025 06:28:42 -0500 Subject: [PATCH] feat(economy): add message flags and enhance component structure for improved display --- src/commands/messages/admin/areasLista.ts | 13 +++--- src/commands/messages/admin/itemsLista.ts | 13 +++--- src/commands/messages/admin/logroCrear.ts | 47 +++++++++++++++++--- src/commands/messages/admin/logroVer.ts | 6 ++- src/commands/messages/admin/logrosLista.ts | 13 +++--- src/commands/messages/admin/misionCrear.ts | 30 ++++++++++++- src/commands/messages/admin/misionVer.ts | 2 +- src/commands/messages/admin/misionesLista.ts | 13 +++--- src/commands/messages/admin/mobsLista.ts | 13 +++--- src/commands/messages/game/itemCreate.ts | 30 ++++++++++++- src/commands/messages/game/itemEdit.ts | 30 ++++++++++++- 11 files changed, 171 insertions(+), 39 deletions(-) diff --git a/src/commands/messages/admin/areasLista.ts b/src/commands/messages/admin/areasLista.ts index 024bca4..b882e09 100644 --- a/src/commands/messages/admin/areasLista.ts +++ b/src/commands/messages/admin/areasLista.ts @@ -80,11 +80,14 @@ export const command: CommandMessage = { const channel = message.channel as TextBasedChannel & { send: Function }; const msg = await (channel.send as any)({ - display, - components: buttons.length > 0 ? [{ - type: ComponentType.ActionRow, - components: buttons - }] : [] + flags: 32768, + components: [ + display, + ...(buttons.length > 0 ? [{ + type: ComponentType.ActionRow, + components: buttons + }] : []) + ] }); const collector = msg.createMessageComponentCollector({ diff --git a/src/commands/messages/admin/itemsLista.ts b/src/commands/messages/admin/itemsLista.ts index f290755..db54e50 100644 --- a/src/commands/messages/admin/itemsLista.ts +++ b/src/commands/messages/admin/itemsLista.ts @@ -90,11 +90,14 @@ export const command: CommandMessage = { const channel = message.channel as TextBasedChannel & { send: Function }; const msg = await (channel.send as any)({ - display, - components: buttons.length > 0 ? [{ - type: ComponentType.ActionRow, - components: buttons - }] : [] + flags: 32768, + components: [ + display, + ...(buttons.length > 0 ? [{ + type: ComponentType.ActionRow, + components: buttons + }] : []) + ] }); const collector = msg.createMessageComponentCollector({ diff --git a/src/commands/messages/admin/logroCrear.ts b/src/commands/messages/admin/logroCrear.ts index b232f16..0f865bf 100644 --- a/src/commands/messages/admin/logroCrear.ts +++ b/src/commands/messages/admin/logroCrear.ts @@ -86,7 +86,20 @@ export const command: CommandMessage = { switch (i.customId) { case 'ach_cancel': await i.deferUpdate(); - await editorMsg.edit({ content: '❌ Creación de logro cancelada.', components: [], display: undefined }); + await editorMsg.edit({ + flags: 32768, + components: [{ + type: 17, + accent_color: 0xFF0000, + components: [{ + type: 9, + components: [{ + type: 10, + content: '**❌ Creación de logro cancelada.**' + }] + }] + }] + }); collector.stop('cancel'); return; @@ -123,11 +136,20 @@ export const command: CommandMessage = { } }); - await i.reply({ content: '✅ Logro creado exitosamente.', flags: 64 }); + await i.reply({ content: '✅ Logro creado exitosamente!', flags: 64 }); await editorMsg.edit({ - content: `✅ Logro \`${state.key}\` creado.`, - components: [], - display: undefined + flags: 32768, + components: [{ + type: 17, + accent_color: 0x00FF00, + components: [{ + type: 9, + components: [{ + type: 10, + content: `**✅ Logro \`${state.key}\` creado exitosamente.**` + }] + }] + }] }); collector.stop('saved'); return; @@ -143,7 +165,20 @@ export const command: CommandMessage = { collector.on('end', async (_c, r) => { if (r === 'time') { try { - await editorMsg.edit({ content: '⏰ Editor expirado.', components: [], display: undefined }); + await editorMsg.edit({ + flags: 32768, + components: [{ + type: 17, + accent_color: 0xFFA500, + components: [{ + type: 9, + components: [{ + type: 10, + content: '**⏰ Editor expirado.**' + }] + }] + }] + }); } catch {} } }); diff --git a/src/commands/messages/admin/logroVer.ts b/src/commands/messages/admin/logroVer.ts index 85f9d2f..969cf5d 100644 --- a/src/commands/messages/admin/logroVer.ts +++ b/src/commands/messages/admin/logroVer.ts @@ -118,6 +118,10 @@ export const command: CommandMessage = { }); } - const channel = message.channel as TextBasedChannel & { send: Function }; await (channel.send as any)({ display, reply: { messageReference: message.id } }); + const channel = message.channel as TextBasedChannel & { send: Function }; + await (channel.send as any)({ + flags: 32768, + components: [display] + }); } }; diff --git a/src/commands/messages/admin/logrosLista.ts b/src/commands/messages/admin/logrosLista.ts index 897111c..d900a92 100644 --- a/src/commands/messages/admin/logrosLista.ts +++ b/src/commands/messages/admin/logrosLista.ts @@ -95,11 +95,14 @@ export const command: CommandMessage = { const channel = message.channel as TextBasedChannel & { send: Function }; const msg = await (channel.send as any)({ - display, - components: buttons.length > 0 ? [{ - type: ComponentType.ActionRow, - components: buttons - }] : [] + flags: 32768, + components: [ + display, + ...(buttons.length > 0 ? [{ + type: ComponentType.ActionRow, + components: buttons + }] : []) + ] }); const collector = msg.createMessageComponentCollector({ diff --git a/src/commands/messages/admin/misionCrear.ts b/src/commands/messages/admin/misionCrear.ts index 42c2d9d..7059fe4 100644 --- a/src/commands/messages/admin/misionCrear.ts +++ b/src/commands/messages/admin/misionCrear.ts @@ -84,7 +84,20 @@ export const command: CommandMessage = { switch (i.customId) { case 'quest_cancel': await i.deferUpdate(); - await editorMsg.edit({ content: '❌ Creación de misión cancelada.', components: [], display: undefined }); + await editorMsg.edit({ + flags: 32768, + components: [{ + type: 17, + accent_color: 0xFF0000, + components: [{ + type: 9, + components: [{ + type: 10, + content: '**❌ Creación de misión cancelada.**' + }] + }] + }] + }); collector.stop('cancel'); return; @@ -142,7 +155,20 @@ export const command: CommandMessage = { collector.on('end', async (_c, r) => { if (r === 'time') { try { - await editorMsg.edit({ content: '⏰ Editor expirado.', components: [], display: undefined }); + await editorMsg.edit({ + flags: 32768, + components: [{ + type: 17, + accent_color: 0xFFA500, + components: [{ + type: 9, + components: [{ + type: 10, + content: '**⏰ Editor expirado.**' + }] + }] + }] + }); } catch {} } }); diff --git a/src/commands/messages/admin/misionVer.ts b/src/commands/messages/admin/misionVer.ts index 809a78b..3e1b957 100644 --- a/src/commands/messages/admin/misionVer.ts +++ b/src/commands/messages/admin/misionVer.ts @@ -151,6 +151,6 @@ export const command: CommandMessage = { }); } - const channel = message.channel as TextBasedChannel & { send: Function }; await (channel.send as any)({ display, reply: { messageReference: message.id } }); + const channel = message.channel as TextBasedChannel & { send: Function }; await (channel.send as any)({ flags: 32768, components: [display] }); } }; diff --git a/src/commands/messages/admin/misionesLista.ts b/src/commands/messages/admin/misionesLista.ts index 7b6d3eb..9f117dd 100644 --- a/src/commands/messages/admin/misionesLista.ts +++ b/src/commands/messages/admin/misionesLista.ts @@ -102,11 +102,14 @@ export const command: CommandMessage = { const channel = message.channel as TextBasedChannel & { send: Function }; const msg = await (channel.send as any)({ - display, - components: buttons.length > 0 ? [{ - type: ComponentType.ActionRow, - components: buttons - }] : [] + flags: 32768, + components: [ + display, + ...(buttons.length > 0 ? [{ + type: ComponentType.ActionRow, + components: buttons + }] : []) + ] }); const collector = msg.createMessageComponentCollector({ diff --git a/src/commands/messages/admin/mobsLista.ts b/src/commands/messages/admin/mobsLista.ts index d0f94bf..424bf22 100644 --- a/src/commands/messages/admin/mobsLista.ts +++ b/src/commands/messages/admin/mobsLista.ts @@ -84,11 +84,14 @@ export const command: CommandMessage = { const channel = message.channel as TextBasedChannel & { send: Function }; const msg = await (channel.send as any)({ - display, - components: buttons.length > 0 ? [{ - type: ComponentType.ActionRow, - components: buttons - }] : [] + flags: 32768, + components: [ + display, + ...(buttons.length > 0 ? [{ + type: ComponentType.ActionRow, + components: buttons + }] : []) + ] }); const collector = msg.createMessageComponentCollector({ diff --git a/src/commands/messages/game/itemCreate.ts b/src/commands/messages/game/itemCreate.ts index ec7efac..3321809 100644 --- a/src/commands/messages/game/itemCreate.ts +++ b/src/commands/messages/game/itemCreate.ts @@ -121,7 +121,20 @@ export const command: CommandMessage = { if (!i.isButton()) return; if (i.customId === 'it_cancel') { await i.deferUpdate(); - await editorMsg.edit({ content: '❌ Editor cancelado.', components: [], display: undefined }); + await editorMsg.edit({ + flags: 32768, + components: [{ + type: 17, + accent_color: 0xFF0000, + components: [{ + type: 9, + components: [{ + type: 10, + content: '**❌ Editor cancelado.**' + }] + }] + }] + }); collector.stop('cancel'); return; } @@ -171,7 +184,20 @@ export const command: CommandMessage = { collector.on('end', async (_c, r) => { if (r === 'time') { - try { await editorMsg.edit({ content: '⏰ Editor expirado.', components: [], display: undefined }); } catch {} + try { await editorMsg.edit({ + flags: 32768, + components: [{ + type: 17, + accent_color: 0xFFA500, + components: [{ + type: 9, + components: [{ + type: 10, + content: '**⏰ Editor expirado.**' + }] + }] + }] + }); } catch {} } }); }, diff --git a/src/commands/messages/game/itemEdit.ts b/src/commands/messages/game/itemEdit.ts index db8c920..2bf6f32 100644 --- a/src/commands/messages/game/itemEdit.ts +++ b/src/commands/messages/game/itemEdit.ts @@ -121,7 +121,20 @@ export const command: CommandMessage = { if (!i.isButton()) return; if (i.customId === 'it_cancel') { await i.deferUpdate(); - await editorMsg.edit({ content: '❌ Editor cancelado.', components: [], display: undefined }); + await editorMsg.edit({ + flags: 32768, + components: [{ + type: 17, + accent_color: 0xFF0000, + components: [{ + type: 9, + components: [{ + type: 10, + content: '**❌ Editor cancelado.**' + }] + }] + }] + }); collector.stop('cancel'); return; } @@ -171,7 +184,20 @@ export const command: CommandMessage = { collector.on('end', async (_c, r) => { if (r === 'time') { - try { await editorMsg.edit({ content: '⏰ Editor expirado.', components: [], display: undefined }); } catch {} + try { await editorMsg.edit({ + flags: 32768, + components: [{ + type: 17, + accent_color: 0xFFA500, + components: [{ + type: 9, + components: [{ + type: 10, + content: '**⏰ Editor expirado.**' + }] + }] + }] + }); } catch {} } }); },