From 8b8013ed38303b4d8dff49b06e6d63c58accd92a Mon Sep 17 00:00:00 2001 From: neersighted Date: Sun, 29 Apr 2012 20:38:38 -0700 Subject: [PATCH] added geoNICK to geoip.py --- plugins/geoip.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/geoip.py b/plugins/geoip.py index 7912b1a..472cfe6 100755 --- a/plugins/geoip.py +++ b/plugins/geoip.py @@ -25,12 +25,16 @@ def timezone(ip): @hook.command @hook.command("location") -def geoip(inp, say=None, bot=None): +def geoip(inp, say=None, nick=None, host=None, bot=None): ".geoip - Performs a location check on ." api_key = bot.config.get("api_keys", {}).get("geoip", None) if api_key is None: return "error: no api key set" - give = find_location(inp, api_key) + if inp == nick: + ip = host + else: + ip = inp + give = find_location(ip, api_key) if give["country"] not in ["", " ", "-", " - "]: if give["state"] == give["city"]: localstring = give["city"]