Password | Re-loader By R-1n
// register-commands.js const REST, Routes, SlashCommandBuilder = require('discord.js'); require('dotenv').config();
// 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); );
// ----- CONFIG ----------------------------------------------------------- const RELOADER_PASSWORD = process.env.RELOADER_PASSWORD || 'r-1n'; const MAX_ATTEMPTS = 5; let attemptCounter = new Map(); // ip => count, resetTimeout re-loader by r-1n password
const entered = prompt('Enter reload password:'); if (entered === null) // user cancelled log('⏹️ Reload cancelled.'); return;
client.login(process.env.BOT_TOKEN);
// Optional: double‑confirm await modal.reply( content: '⚠️ Are you sure? React with ✅ within 10 s to proceed.', fetchReply: true ) .then(async msg => await msg.react('✅'); const filter = (reaction, user) => reaction.emoji.name === '✅' && user.id === modal.user.id; const collected = await msg.awaitReactions( filter, max: 1, time: 10_000, errors: ['time'] ) .catch(() => null);
if (!collected) await msg.edit('⏹️ Reload aborted (no confirmation).'); return; // register-commands
<script> const PASSWORD = 'r-1n'; // <-- change to something strong! const MAX_ATTEMPTS = 3; let attempts = 0;