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
|
# Broken by The Noodle
|
||||||
# Improved by Lukeroge
|
# Improved by Lukeroge
|
||||||
from util import hook
|
from util import hook
|
||||||
|
import sys
|
||||||
|
|
||||||
# Added to make the move to a new auth system a lot easier
|
# Added to make the move to a new auth system a lot easier
|
||||||
def isadmin(input):
|
def isadmin(input):
|
||||||
|
@ -10,6 +11,20 @@ def isadmin(input):
|
||||||
else:
|
else:
|
||||||
return False
|
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
|
@hook.command
|
||||||
def join(inp, input=None, db=None, notice=None):
|
def join(inp, input=None, db=None, notice=None):
|
||||||
".join <channel> -- joins a channel"
|
".join <channel> -- joins a channel"
|
||||||
|
@ -19,6 +34,7 @@ def join(inp, input=None, db=None, notice=None):
|
||||||
notice("Attempting to join " + inp + "...")
|
notice("Attempting to join " + inp + "...")
|
||||||
input.conn.send("JOIN " + inp)
|
input.conn.send("JOIN " + inp)
|
||||||
|
|
||||||
|
|
||||||
@hook.command
|
@hook.command
|
||||||
def cycle(inp, input=None, db=None, notice=None):
|
def cycle(inp, input=None, db=None, notice=None):
|
||||||
".cycle <channel> -- cycles a channel"
|
".cycle <channel> -- cycles a channel"
|
||||||
|
|
Reference in a new issue