MCPcopy
hub / github.com/n0a/telegram-get-remote-ip / get_my_ip

Function get_my_ip

tg_get_ip.py:73–79  ·  view source on GitHub ↗

Retrieve the external IP address.

()

Source from the content-addressed store, hash-verified

71 return None
72
73def get_my_ip():
74 """Retrieve the external IP address."""
75 try:
76 return requests.get('https://icanhazip.com').text.strip()
77 except Exception as e:
78 print(f"[!] Error fetching external IP: {e}")
79 return None
80
81def get_whois_info(ip):
82 """Retrieve whois data for the given IP."""

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected