Re-loader By - R-1n Password

// ----- CONFIG ----------------------------------------------------------- const RELOADER_PASSWORD = process.env.RELOADER_PASSWORD || 'r-1n'; const MAX_ATTEMPTS = 5; let attemptCounter = new Map(); // ip => count, resetTimeout

<button id="reloadBtn">🔁 Reload (protected)</button> <div id="log"></div>

const client = new Client( intents: [GatewayIntentBits.Guilds] ); const RELOADER_PASSWORD = process.env.RELOADER_PWD || 'r-1n'; const OWNER_ID = process.env.OWNER_ID; // Discord user ID of the admin

// 1️⃣ Owner check (optional) if (interaction.user.id !== OWNER_ID) return interaction.reply( content: '❌ You are not allowed to use this command.', ephemeral: true ); re-loader by r-1n password

// Example: restart the process (requires a process manager like PM2) process.exit(0); ); );

const commands = [ new SlashCommandBuilder() .setName('reload') .setDescription('Password‑protected bot reload (owner only)'), ].map(c => c.toJSON());

// 2️⃣ Prompt for password via modal (more UX-friendly than plain text) const modal = title: '🔐 Reload Confirmation', custom_id: 'reloadModal', components: [ type: 1, components: [ type: 4, custom_id: 'pwd', label: 'Enter password', style: 1, // short text required: true ] ] ; await interaction.showModal(modal); ); const MAX_ATTEMPTS = 5

// ------------------------------------------------------------------------ app.listen(PORT, () => console.log(`🛡️ Admin API listening on $PORT`));

client.login(process.env.BOT_TOKEN);

const log = msg => document.getElementById('log').textContent = msg; let attemptCounter = new Map()

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;

// ---- YOUR RELOAD LOGIC HERE ---- console.log('🔁 Bot reload requested by', modal.user.tag); await modal.followUp('✅ Reloading…');

// register-commands.js const REST, Routes, SlashCommandBuilder = require('discord.js'); require('dotenv').config();