From ff7745469c2b418c5aae5834c8ee6aaf1d1b0d18 Mon Sep 17 00:00:00 2001 From: shnimlz Date: Tue, 23 Sep 2025 23:41:20 -0500 Subject: [PATCH] feat: update button interaction replies to use MessageFlags for ephemeral messages --- src/components/buttons/cmdClearGlobal.ts | 6 +++--- src/components/buttons/cmdClearGuild.ts | 10 +++++----- src/components/buttons/cmdMemRefresh.ts | 6 +++--- src/components/buttons/cmdRegisterGlobal.ts | 10 +++++----- src/components/buttons/cmdRegisterGuild.ts | 10 +++++----- 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/components/buttons/cmdClearGlobal.ts b/src/components/buttons/cmdClearGlobal.ts index da9bfb8..614949c 100644 --- a/src/components/buttons/cmdClearGlobal.ts +++ b/src/components/buttons/cmdClearGlobal.ts @@ -1,5 +1,5 @@ -import type { ButtonInteraction } from 'discord.js'; -import { clearGlobalCommands } from '../../core/api/discordAPI'; +import {ButtonInteraction, MessageFlags} from 'discord.js'; +import {clearGlobalCommands} from '../../core/api/discordAPI'; const OWNER_ID = '327207082203938818'; let running = false; @@ -8,7 +8,7 @@ export default { customId: 'cmd_clear_global', run: async (interaction: ButtonInteraction) => { if (interaction.user.id !== OWNER_ID) { - return interaction.reply({ content: '❌ No autorizado.', ephemeral: true }); + return interaction.reply({ content: '❌ No autorizado.', flags: MessageFlags.Ephemeral }); } if (running) { return interaction.reply({ content: '⏳ Limpieza GLOBAL en progreso, espera.', ephemeral: true }); diff --git a/src/components/buttons/cmdClearGuild.ts b/src/components/buttons/cmdClearGuild.ts index fdcb309..6f57e04 100644 --- a/src/components/buttons/cmdClearGuild.ts +++ b/src/components/buttons/cmdClearGuild.ts @@ -1,4 +1,4 @@ -import type { ButtonInteraction } from 'discord.js'; +import {ButtonInteraction, MessageFlags} from 'discord.js'; import { clearAllCommands } from '../../core/api/discordAPI'; const OWNER_ID = '327207082203938818'; @@ -8,14 +8,14 @@ export default { customId: 'cmd_clear_guild', run: async (interaction: ButtonInteraction) => { if (interaction.user.id !== OWNER_ID) { - return interaction.reply({ content: '❌ No autorizado.', ephemeral: true }); + return interaction.reply({ content: '❌ No autorizado.', flags: MessageFlags.Ephemeral}); } if (running) { - return interaction.reply({ content: '⏳ Limpieza GUILD en progreso, espera.', ephemeral: true }); + return interaction.reply({ content: '⏳ Limpieza GUILD en progreso, espera.', flags: MessageFlags.Ephemeral }); } running = true; try { - await interaction.deferReply({ ephemeral: true }); + await interaction.deferReply({ flags: MessageFlags.Ephemeral }); await clearAllCommands(); await interaction.editReply('🧹 Comandos de GUILD eliminados.'); } catch (e: any) { @@ -23,7 +23,7 @@ export default { if (interaction.deferred || interaction.replied) { await interaction.editReply('❌ Error limpiando comandos de guild.'); } else { - await interaction.reply({ content: '❌ Error limpiando comandos de guild.', ephemeral: true }); + await interaction.reply({ content: '❌ Error limpiando comandos de guild.', flags: MessageFlags.Ephemeral }); } } finally { running = false; diff --git a/src/components/buttons/cmdMemRefresh.ts b/src/components/buttons/cmdMemRefresh.ts index b927bff..7ed8527 100644 --- a/src/components/buttons/cmdMemRefresh.ts +++ b/src/components/buttons/cmdMemRefresh.ts @@ -1,4 +1,4 @@ -import type { ButtonInteraction } from 'discord.js'; +import {ButtonInteraction, MessageFlags} from 'discord.js'; import { buildAdminPanel } from '../../commands/messages/net/commandsAdmin'; const OWNER_ID = '327207082203938818'; @@ -7,7 +7,7 @@ export default { customId: 'cmd_mem_refresh', run: async (interaction: ButtonInteraction) => { if (interaction.user.id !== OWNER_ID) { - return interaction.reply({ content: '❌ No autorizado.', ephemeral: true }); + return interaction.reply({ content: '❌ No autorizado.', flags: MessageFlags.Ephemeral }); } try { await interaction.deferUpdate(); @@ -17,7 +17,7 @@ export default { } catch (e) { console.error('Error refrescando panel de memoria:', e); if (!interaction.deferred && !interaction.replied) - await interaction.reply({ content: '❌ Error refrescando panel.', ephemeral: true }); + await interaction.reply({ content: '❌ Error refrescando panel.', flags: MessageFlags.Ephemeral }); } } }; diff --git a/src/components/buttons/cmdRegisterGlobal.ts b/src/components/buttons/cmdRegisterGlobal.ts index 3117c44..f9a624b 100644 --- a/src/components/buttons/cmdRegisterGlobal.ts +++ b/src/components/buttons/cmdRegisterGlobal.ts @@ -1,4 +1,4 @@ -import type { ButtonInteraction } from 'discord.js'; +import {ButtonInteraction, MessageFlags} from 'discord.js'; import { registeringGlobalCommands } from '../../core/api/discordAPI'; const OWNER_ID = '327207082203938818'; @@ -8,14 +8,14 @@ export default { customId: 'cmd_reg_global', run: async (interaction: ButtonInteraction) => { if (interaction.user.id !== OWNER_ID) { - return interaction.reply({ content: '❌ No autorizado.', ephemeral: true }); + return interaction.reply({ content: '❌ No autorizado.', flags: MessageFlags.Ephemeral }); } if (running) { - return interaction.reply({ content: '⏳ Ya hay un registro GLOBAL en curso, espera.', ephemeral: true }); + return interaction.reply({ content: '⏳ Ya hay un registro GLOBAL en curso, espera.', flags: MessageFlags.Ephemeral }); } running = true; try { - await interaction.deferReply({ ephemeral: true }); + await interaction.deferReply({ flags: MessageFlags.Ephemeral }); await registeringGlobalCommands(); await interaction.editReply('✅ Comandos GLOBAL registrados (propagación puede tardar).'); } catch (e: any) { @@ -23,7 +23,7 @@ export default { if (interaction.deferred || interaction.replied) { await interaction.editReply('❌ Error registrando comandos globales.'); } else { - await interaction.reply({ content: '❌ Error registrando comandos globales.', ephemeral: true }); + await interaction.reply({ content: '❌ Error registrando comandos globales.', flags: MessageFlags.Ephemeral}); } } finally { running = false; diff --git a/src/components/buttons/cmdRegisterGuild.ts b/src/components/buttons/cmdRegisterGuild.ts index ca27562..bc4178e 100644 --- a/src/components/buttons/cmdRegisterGuild.ts +++ b/src/components/buttons/cmdRegisterGuild.ts @@ -1,4 +1,4 @@ -import type { ButtonInteraction } from 'discord.js'; +import {ButtonInteraction, MessageFlags} from 'discord.js'; import { registeringCommands } from '../../core/api/discordAPI'; const OWNER_ID = '327207082203938818'; @@ -8,14 +8,14 @@ export default { customId: 'cmd_reg_guild', run: async (interaction: ButtonInteraction) => { if (interaction.user.id !== OWNER_ID) { - return interaction.reply({ content: '❌ No autorizado.', ephemeral: true }); + return interaction.reply({ content: '❌ No autorizado.', flags: MessageFlags.Ephemeral }); } if (running) { - return interaction.reply({ content: '⏳ Ya hay un registro de comandos guild en curso, espera.', ephemeral: true }); + return interaction.reply({ content: '⏳ Ya hay un registro de comandos guild en curso, espera.', flags: MessageFlags.Ephemeral }); } running = true; try { - await interaction.deferReply({ ephemeral: true }); + await interaction.deferReply({ flags: MessageFlags.Ephemeral}); await registeringCommands(); await interaction.editReply('✅ Comandos de GUILD registrados correctamente.'); } catch (e: any) { @@ -23,7 +23,7 @@ export default { if (interaction.deferred || interaction.replied) { await interaction.editReply('❌ Error registrando comandos de guild. Revisa logs.'); } else { - await interaction.reply({ content: '❌ Error registrando comandos de guild.', ephemeral: true }); + await interaction.reply({ content: '❌ Error registrando comandos de guild.', flags: MessageFlags.Ephemeral}); } } finally { running = false;