The following changes were made by the replace_file_content tool to: /root/aadharbot/index.js. If relevant, proactively run terminal commands to execute this code for the USER. Don't ask for permission. [diff_block_start] @@ -742,66 +742,6 @@ sendErrorToTelegram(`[TELEGRAF ERROR] Update ID: ${ctx?.update?.update_id || 'N/A'}\nError: ${err.stack || err.message || err}\n\nUpdate Detail:\n${updateInfo}`).catch(() => {}); }); -// ── FREE MODE CONFIGURATION (MODULAR) ────────────────────────────────── -const { - freeModeState, - saveFreeModeState, - isFreeModeActive, - parseDuration, - applyFreeMode -} = require('./modules/admin/freemode'); - - -async function triggerFreeModeBroadcast(durationText) { - let targets = []; - try { - const res = await pool.query('SELECT telegram_id FROM users'); - targets = res.rows.map(r => String(r.telegram_id)); - } catch (err) { - console.error("[FREE MODE BROADCAST ERROR]", err.message); - } - - if (targets.length === 0) return; - - let index = 0; - - let durationDisplay = 'Indefinite (Manual Off)'; - if (durationText) { - const value = parseInt(durationText); - const unit = durationText.slice(-1); - const unitNames = { s: 'Seconds', m: 'Minutes', h: 'Hours', d: 'Days' }; - durationDisplay = `${value} ${unitNames[unit] || ''}`; - } - - const broadcastMsg = `🎁 FREE MODE ACTIVATED / फ्री मोड चालू हो गया है 🎁\n` + - `━━━━━━━━━━━━━━━━━━━━━━━━━━\n` + - `Admin ne Free Mode activate kar diya hai! Aap bina kisi credit deduction ke unlimited searches kar sakte hain.\n\n` + - `⏰ Duration: ${durationDisplay}\n\n` + - `⚡ Cooldown pehle ki tarah hi active rahega taaki server load normal rahe.\n` + - `━━━━━━━━━━━━━━━━━━━━━━━━━━\n` + - ``; - - async function sendNext() { - if (index >= targets.length) { - console.log("[FREE MODE BROADCAST] Broadcast completed."); - return; - } - - const targetId = targets[index]; - index++; - - try { - await bot.telegram.sendMessage(targetId, broadcastMsg, { parse_mode: 'HTML' }); - } catch (err) { - } - - setTimeout(sendNext, 35); - } - - sendNext(); -} - - // ───────────────────────────────────────────────────────────────────────── [diff_block_end] Please note that the above snippet only shows the MODIFIED lines from the last change. It shows up to 3 lines of unchanged lines before and after the modified lines. The actual file contents may have many more lines not shown.