Skip to content

Commit

Permalink
Fixed(timeout error) telegraph
Browse files Browse the repository at this point in the history
  • Loading branch information
bishalqx980 committed Jan 26, 2025
1 parent 126f0b1 commit 015d75e
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion bot/modules/telegraph.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
import requests
from telegraph import Telegraph
from bot import logger

try:
telegraph = Telegraph()
domains = ["telegra.ph", "graph.org"]
for domain in domains:
try:
r = requests.get(f"https://{domain}", timeout=5)
if r.status_code == 200:
break
except Exception as e:
logger.error(e)

telegraph = Telegraph(domain=domain)
telegraph.create_account("@MissCiri_bot")
except Exception as e:
logger.error(e)
Expand Down

0 comments on commit 015d75e

Please sign in to comment.