D. Trojan commited on
Commit
e3480c8
·
1 Parent(s): d478d6b

Update DNS and switch to alternative proxy

Browse files
Files changed (1) hide show
  1. index.js +9 -2
index.js CHANGED
@@ -174,10 +174,17 @@ const token = process.env.TELEGRAM_BOT_TOKEN;
174
  const pollinationsKey = process.env.POLLINATIONS_API_KEY;
175
  const systemEnhancePrompt = process.env.SYSTEM_ENHANCE_PROMPT || `Rewrite the following user request into a highly creative prompt for an AI image generator. Add artistic styles, lighting, and camera angles. Keep it concise, MAXIMUM 30 words! Make it in English language only. Output ONLY the raw prompt, no extra text, explanations, or quotes. The user request is: `;
176
 
177
- // 1. Инициализация бота с использованием прокси-сервера для обхода блокировок
 
 
 
 
 
 
 
178
  const bot = new TelegramBot(token, {
179
  polling: true,
180
- baseApiUrl: 'https://api.pwrtelegram.xyz', // Публичный прокси для Telegram
181
  request: {
182
  agentOptions: {
183
  family: 4
 
174
  const pollinationsKey = process.env.POLLINATIONS_API_KEY;
175
  const systemEnhancePrompt = process.env.SYSTEM_ENHANCE_PROMPT || `Rewrite the following user request into a highly creative prompt for an AI image generator. Add artistic styles, lighting, and camera angles. Keep it concise, MAXIMUM 30 words! Make it in English language only. Output ONLY the raw prompt, no extra text, explanations, or quotes. The user request is: `;
176
 
177
+ // Настройка DNS для улучшения разрешения имен
178
+ try {
179
+ dns.setServers(['1.1.1.1', '8.8.8.8']);
180
+ } catch (e) {
181
+ console.error("DNS setServers failed:", e.message);
182
+ }
183
+
184
+ // 1. Инициализация бота с использованием альтернативного прокси-сервера
185
  const bot = new TelegramBot(token, {
186
  polling: true,
187
+ baseApiUrl: 'https://api.telegram-proxy.com', // Альтернативный прокси
188
  request: {
189
  agentOptions: {
190
  family: 4