Removed DerpCode
This commit is contained in:
parent
20b6ebd749
commit
8396b7d36c
1 changed files with 4 additions and 7 deletions
|
@ -25,17 +25,14 @@ def timezone(ip):
|
||||||
|
|
||||||
@hook.command
|
@hook.command
|
||||||
@hook.command("location")
|
@hook.command("location")
|
||||||
def geoip(inp, say=None, nick=None, host=None, bot=None):
|
def geoip(inp, say=None, bot=None):
|
||||||
".geoip <ip> - Performs a location check on <ip>."
|
".geoip <ip> - Performs a location check on <ip>."
|
||||||
api_key = bot.config.get("api_keys", {}).get("geoip", None)
|
api_key = bot.config.get("api_keys", {}).get("geoip", None)
|
||||||
if api_key is None:
|
if api_key is None:
|
||||||
return "error: no api key set"
|
return "error: no api key set"
|
||||||
if inp == nick:
|
|
||||||
ip = host
|
give = find_location(inp, api_key)
|
||||||
else:
|
if give["country"] not in ["", " ", "-", " - ", None]:
|
||||||
ip = inp
|
|
||||||
give = find_location(ip, api_key)
|
|
||||||
if give["country"] not in ["", " ", "-", " - "]:
|
|
||||||
if give["state"] == give["city"]:
|
if give["state"] == give["city"]:
|
||||||
localstring = give["city"]
|
localstring = give["city"]
|
||||||
else:
|
else:
|
||||||
|
|
Reference in a new issue