feat: add runtime patch for ModalSubmitInteraction to prevent crashes during member resolution

This commit is contained in:
2025-10-03 23:52:15 -05:00
parent 1a9eabb7af
commit 2d28e63a4f
2 changed files with 105 additions and 0 deletions

View File

@@ -9,6 +9,7 @@ import {memoryOptimizer} from "./core/memory/memoryOptimizer";
import { startReminderPoller } from "./core/api/reminders";
import { ensureRemindersSchema } from "./core/api/remindersSchema";
import logger from "./core/lib/logger";
import { applyModalSubmitInteractionPatch } from "./core/patches/discordModalPatch";
// Activar monitor de memoria si se define la variable
const __memInt = parseInt(process.env.MEMORY_LOG_INTERVAL_SECONDS || '0', 10);
@@ -21,6 +22,13 @@ if (process.env.ENABLE_MEMORY_OPTIMIZER === 'true') {
memoryOptimizer.start();
}
// Apply safety patch for ModalSubmitInteraction members resolution before anything else
try {
applyModalSubmitInteractionPatch();
} catch (e) {
logger.warn({ err: e }, 'No se pudo aplicar el patch de ModalSubmitInteraction');
}
export const bot = new Amayo();
// Listeners de robustez del cliente Discord