From db8d363b6a7da1be1ed0a97232bb084e8de21241 Mon Sep 17 00:00:00 2001 From: shnimlz Date: Sat, 20 Sep 2025 16:57:41 -0500 Subject: [PATCH] ni yo se que hice xda --- src/core/api/discordAPI.ts | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/src/core/api/discordAPI.ts b/src/core/api/discordAPI.ts index 5eb48d4..a1f66f9 100644 --- a/src/core/api/discordAPI.ts +++ b/src/core/api/discordAPI.ts @@ -98,6 +98,27 @@ export async function clearGlobalCommands(): Promise { } export async function patchMessageWithDisplay(channelId: string, messageId: string, data: any): Promise { - // data puede incluir: content, flags, display (container), components (action rows), etc. - await rest.patch(Routes.channelMessage(channelId, messageId), { body: data }); + try { + // Validación mínima para ayudar a depurar + const dbg = { + hasDisplay: !!data?.display, + displayType: data?.display?.type, + compCount: Array.isArray(data?.display?.components) ? data.display.components.length : undefined, + hasComponents: Array.isArray(data?.components), + }; + // eslint-disable-next-line no-console + if (!dbg.hasDisplay) console.warn('[patchMessageWithDisplay] Enviando PATCH sin display. data.keys=', Object.keys(data || {})); + await rest.patch(Routes.channelMessage(channelId, messageId), { body: data }); + } catch (error: any) { + // eslint-disable-next-line no-console + console.error('[patchMessageWithDisplay] Error PATCH mensaje', { + channelId, + messageId, + status: error?.status, + code: error?.code, + message: error?.message, + rawError: error?.rawError, + }); + throw error; + } }