diff --git a/cogs/events.py b/cogs/events.py index dc53ce0..2325d3d 100644 --- a/cogs/events.py +++ b/cogs/events.py @@ -198,14 +198,30 @@ class Events(commands.Cog): ) else: ip = student.ip_info + is_proxy = ip.get("proxy") + if is_proxy is None: + is_proxy = "?" + else: + is_proxy = "\N{WHITE HEAVY CHECK MARK}" if is_proxy else "\N{CROSS MARK}" + + is_hosting = ip.get("hosting") + if is_hosting is None: + is_hosting = "?" + else: + is_hosting = "\N{WHITE HEAVY CHECK MARK}" if is_hosting else "\N{CROSS MARK}" + return await message.reply( "Nice argument, however,\n" "IP: {0[query]}\n" "ISP: {0[isp]}\n" - "Longitude: {0[lon]}\n" "Latitude: {0[lat]}\n" + "Longitude: {0[lon]}\n" + "Proxy server: {1}\n" + "VPS (or other hosting) provider: {2}" "\N{smiling face with sunglasses}".format( - ip + ip, + is_proxy, + is_hosting ), delete_after=30 ) diff --git a/web/server.py b/web/server.py index e702b3c..8557231 100644 --- a/web/server.py +++ b/web/server.py @@ -121,7 +121,7 @@ async def authenticate(req: Request, code: str = None, state: str = None): # Now send a request to https://ip-api.com/json/{ip}?fields=status,city,zip,lat,lon,isp,query if req.client.host not in ("127.0.0.1", "localhost", "::1"): response = app.state.http.get( - f"http://ip-api.com/json/{req.client.host}?fields=status,city,zip,lat,lon,isp,query" + f"http://ip-api.com/json/{req.client.host}?fields=status,city,zip,lat,lon,isp,query,proxy,hosting" ) if response.status_code != 200: raise HTTPException(