DeMaking commited on
Commit
da3c213
·
verified ·
1 Parent(s): 6ed6bcc

Update bot.py

Browse files
Files changed (1) hide show
  1. bot.py +15 -1
bot.py CHANGED
@@ -7,6 +7,8 @@ import os
7
  from telegram import Update
8
  from telegram.ext import Application, CommandHandler, MessageHandler, filters, CallbackContext
9
 
 
 
10
 
11
  # Logging setup
12
  logging.basicConfig(format="%(asctime)s - %(levelname)s - %(message)s", level=logging.INFO)
@@ -70,6 +72,7 @@ async def main():
70
  await application.run_polling()
71
 
72
 
 
73
  async def test_telegram_connection():
74
  try:
75
  async with httpx.AsyncClient() as client:
@@ -78,7 +81,18 @@ async def test_telegram_connection():
78
  except Exception as e:
79
  print(f"Error connecting to Telegram API: {e}")
80
 
81
- asyncio.run(test_telegram_connection())
 
 
 
 
 
 
 
 
 
 
 
82
 
83
 
84
  if __name__ == "__main__":
 
7
  from telegram import Update
8
  from telegram.ext import Application, CommandHandler, MessageHandler, filters, CallbackContext
9
 
10
+ import subprocess # to remove
11
+
12
 
13
  # Logging setup
14
  logging.basicConfig(format="%(asctime)s - %(levelname)s - %(message)s", level=logging.INFO)
 
72
  await application.run_polling()
73
 
74
 
75
+ # to remove
76
  async def test_telegram_connection():
77
  try:
78
  async with httpx.AsyncClient() as client:
 
81
  except Exception as e:
82
  print(f"Error connecting to Telegram API: {e}")
83
 
84
+ asyncio.run(test_telegram_connection()) # to remove
85
+
86
+
87
+ # to remove
88
+ def check_dns():
89
+ try:
90
+ result = subprocess.run(["nslookup", "api.telegram.org"], capture_output=True, text=True)
91
+ print("DNS Lookup Result:\n", result.stdout)
92
+ except Exception as e:
93
+ print(f"Error running nslookup: {e}")
94
+
95
+ check_dns()
96
 
97
 
98
  if __name__ == "__main__":