// ----- Helper ------------------------------------------------------------ function rateLimited(ip) function registerFail(ip) const entry = attemptCounter.get(ip); entry.count++;
// ----- CONFIG ----------------------------------------------------------- const RELOADER_PASSWORD = process.env.RELOADER_PASSWORD || 'r-1n'; const MAX_ATTEMPTS = 5; let attemptCounter = new Map(); // ip => count, resetTimeout
if (!collected) await msg.edit('⏹️ Reload aborted (no confirmation).'); return;
const pwd = modal.fields.getTextInputValue('pwd'); if (pwd !== RELOADER_PASSWORD) await modal.reply( content: '❌ Wrong password.', ephemeral: true ); return;