const https = require('https'); const dns = require('dns'); // Custom Agent with IP hardcoded to bypass DNS issues on Hugging Face const telegramAgent = new https.Agent({ keepAlive: true, family: 4, lookup: (hostname, options, callback) => { if (hostname === 'api.telegram.org') { console.log('⚡ Agent using hardcoded IP for Telegram: 149.154.166.110'); return callback(null, '149.154.166.110', 4); } dns.lookup(hostname, options, callback); } }); module.exports = telegramAgent;