Skip to content

Commit

Permalink
update ip.py
Browse files Browse the repository at this point in the history
  • Loading branch information
DoroWolf committed Jan 23, 2025
1 parent efa0528 commit a62f287
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions core/utils/ip.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@


def append_ip(ip_info: dict):
Secret.add(ip_info["ip"])
Secret.ip_address = ip_info["country"]
Secret.ip_country = ip_info["ip"]
if ip_info and ip_info.get("ip"):
Secret.add(ip_info["ip"])
Secret.ip_address = ip_info.get("country")
Secret.ip_country = ip_info.get("ip")


async def fetch_ip_info() -> dict:
Expand All @@ -20,3 +21,4 @@ async def fetch_ip_info() -> dict:
except Exception:
Logger.error("Failed to get IP information.")
Logger.error(traceback.format_exc())
return {}

0 comments on commit a62f287

Please sign in to comment.