feat: add memory refresh button and update admin panel with memory usage details

This commit is contained in:
2025-09-23 23:37:50 -05:00
parent acb41f8a46
commit eb92edb19a
2 changed files with 82 additions and 33 deletions

View File

@@ -0,0 +1,24 @@
import type { ButtonInteraction } from 'discord.js';
import { buildAdminPanel } from '../../commands/messages/net/commandsAdmin';
const OWNER_ID = '327207082203938818';
export default {
customId: 'cmd_mem_refresh',
run: async (interaction: ButtonInteraction) => {
if (interaction.user.id !== OWNER_ID) {
return interaction.reply({ content: '❌ No autorizado.', ephemeral: true });
}
try {
await interaction.deferUpdate();
const panel = buildAdminPanel();
// Edita el mensaje original reemplazando componentes (solo el contenedor con filas internas)
await interaction.message.edit({ components: [panel] });
} catch (e) {
console.error('Error refrescando panel de memoria:', e);
if (!interaction.deferred && !interaction.replied)
await interaction.reply({ content: '❌ Error refrescando panel.', ephemeral: true });
}
}
};