Removed DerpCode

This commit is contained in:
Luke Rogers 2012-05-07 11:58:29 +12:00
parent 20b6ebd749
commit 8396b7d36c

View file

@ -25,17 +25,14 @@ def timezone(ip):
@hook.command
@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>."
api_key = bot.config.get("api_keys", {}).get("geoip", None)
if api_key is None:
return "error: no api key set"
if inp == nick:
ip = host
else:
ip = inp
give = find_location(ip, api_key)
if give["country"] not in ["", " ", "-", " - "]:
give = find_location(inp, api_key)
if give["country"] not in ["", " ", "-", " - ", None]:
if give["state"] == give["city"]:
localstring = give["city"]
else: