From 475ef0ebbc7a430728f42c8f06a903da35c22c75 Mon Sep 17 00:00:00 2001 From: lukeroge Date: Sun, 26 Feb 2012 19:47:13 +1300 Subject: [PATCH] Update plugins/admin.py --- plugins/admin.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/plugins/admin.py b/plugins/admin.py index 50efade..6416c9a 100644 --- a/plugins/admin.py +++ b/plugins/admin.py @@ -2,6 +2,7 @@ # Broken by The Noodle # Improved by Lukeroge from util import hook +import sys # Added to make the move to a new auth system a lot easier def isadmin(input): @@ -9,6 +10,20 @@ def isadmin(input): return True else: return False + +@hook.command +def quit(inp, input=None, db=None, notice=None): + ".quit [reason] -- kills the bot" + if not isadmin(input): + notice("Only bot admins can use this command!") + return + if inp: + input.conn.send("QUIT :Kill switch activated by "+input.nick+" (" + inp + ")" + else: + input.conn.send("QUIT :Kill switch activated by "+input.nick+" (no reason)") + time.sleep(3) + sys.exit() + @hook.command def join(inp, input=None, db=None, notice=None): @@ -19,6 +34,7 @@ def join(inp, input=None, db=None, notice=None): notice("Attempting to join " + inp + "...") input.conn.send("JOIN " + inp) + @hook.command def cycle(inp, input=None, db=None, notice=None): ".cycle -- cycles a channel"