This commit is contained in:
neersighted 2012-02-28 21:09:40 -08:00
parent c014d91ec2
commit eec12aa9e4
7 changed files with 28 additions and 18 deletions

View file

@ -3,35 +3,40 @@
# Improved by Lukeroge
# Further improved by neersighted
from util import hook
import sys, subprocess, time
import sys
import subprocess
import time
@hook.command(autohelp=False)
def quit(inp, input=None, db=None, notice=None):
".quit [reason] -- Kills the bot, with [reason] reason as its quit message."
".quit [reason] -- Kills the bot, with [reason] as its quit message."
if not input.nick in input.bot.config["admins"]:
notice("Only bot admins can use this command!")
return
if inp:
input.conn.send("QUIT :Bot killed by "+input.nick+" (" + inp + ")")
input.conn.send("QUIT :Bot killed by " + input.nick + " (" + inp + ")")
else:
input.conn.send("QUIT :Bot killed by "+input.nick+" (no reason)")
input.conn.send("QUIT :Bot killed by " + input.nick + " (no reason)")
time.sleep(3)
sys.exit()
@hook.command(autohelp=False)
def restart(inp, input=None, db=None, notice=None):
".restart [reason] -- Restarts the bot, with [reason] reason as its quit message."
".restart [reason] -- Restarts the bot, with [reason] as its quit message."
if not input.nick in input.bot.config["admins"]:
notice("Only bot admins can use this command!")
return
if inp:
input.conn.send("QUIT :Bot restarted by "+input.nick+" (" + inp + ")")
input.conn.send("QUIT :Bot restarted by " + input.nick + " (" + inp + ")")
else:
input.conn.send("QUIT :Bot restarted by "+input.nick+" (no reason)")
input.conn.send("QUIT :Bot restarted by " + input.nick + " (no reason)")
time.sleep(3)
subprocess.call(['lib/restart.py'])
sys.exit()
@hook.command
def join(inp, input=None, db=None, notice=None):
".join <channel> -- Joins <channel>."