mirror of
https://github.com/nexy7574/LCC-bot.git
synced 2024-09-20 02:26:32 +01:00
Add more details
This commit is contained in:
parent
8023627513
commit
f7622a9f92
2 changed files with 19 additions and 3 deletions
|
@ -198,14 +198,30 @@ class Events(commands.Cog):
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
ip = student.ip_info
|
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(
|
return await message.reply(
|
||||||
"Nice argument, however,\n"
|
"Nice argument, however,\n"
|
||||||
"IP: {0[query]}\n"
|
"IP: {0[query]}\n"
|
||||||
"ISP: {0[isp]}\n"
|
"ISP: {0[isp]}\n"
|
||||||
"Longitude: {0[lon]}\n"
|
|
||||||
"Latitude: {0[lat]}\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(
|
"\N{smiling face with sunglasses}".format(
|
||||||
ip
|
ip,
|
||||||
|
is_proxy,
|
||||||
|
is_hosting
|
||||||
),
|
),
|
||||||
delete_after=30
|
delete_after=30
|
||||||
)
|
)
|
||||||
|
|
|
@ -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
|
# 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"):
|
if req.client.host not in ("127.0.0.1", "localhost", "::1"):
|
||||||
response = app.state.http.get(
|
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:
|
if response.status_code != 200:
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
|
|
Loading…
Reference in a new issue