From 70c0b844e2a5c26ad384e3f0c7c19768d0745b1c Mon Sep 17 00:00:00 2001 From: Luke Rogers Date: Mon, 21 Nov 2011 20:14:21 +1300 Subject: [PATCH] Renamed location.py > geoip.py, tweaked code --- plugins/{location.py => geoip.py} | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) rename plugins/{location.py => geoip.py} (87%) diff --git a/plugins/location.py b/plugins/geoip.py similarity index 87% rename from plugins/location.py rename to plugins/geoip.py index 83f6af7..6c05a78 100644 --- a/plugins/location.py +++ b/plugins/geoip.py @@ -20,11 +20,10 @@ def timezone(ip): return int(time) @hook.command -def locations(inp, say = None, me = None, bot = None): - ".location - Performs a GeoIP check on the ip given." +@hook.command("location") +def geoip(inp, say = None, bot = None): + ".geoip - Performs a location check on the ip given." api = bot.config['api_keys']['geoip'] - if api == "": - return "No API key" give = find_location(inp, api) if give["country"] not in [""," ","-"," - "]: if give["state"] == give["city"]: @@ -36,3 +35,4 @@ def locations(inp, say = None, me = None, bot = None): else: say("Either that wasn't an IP or I cannot locate it in my database. :(") return +