"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.initTelegramAuth = initTelegramAuth; exports.fetchLatestRate = fetchLatestRate; exports.getCurrentRates = getCurrentRates; const channelUsername = 'iraqborsa'; let currentIqdRate = null; async function initTelegramAuth() { console.log('Initializing Telegram Rate Fetcher...'); // Initial fetch await fetchLatestRate(); // Fetch rate every 10 minutes setInterval(fetchLatestRate, 10 * 60 * 1000); } async function fetchLatestRate() { try { console.log(`Fetching latest messages from https://t.me/s/${channelUsername}...`); const response = await fetch(`https://t.me/s/${channelUsername}`); if (!response.ok) { throw new Error(`HTTP error! status: ${response.status}`); } const html = await response.text(); const regex = /
{ console.log("Setup complete! You can press Ctrl+C to exit and start the main server."); // Process will keep running due to setInterval }).catch(console.error); }