Update plugins/admin.py
This commit is contained in:
parent
5a285c4f77
commit
475ef0ebbc
1 changed files with 16 additions and 0 deletions
|
@ -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 <channel> -- cycles a channel"
|
||||
|
|
Reference in a new issue