def handle_adminstop(bot, ievent): """ no arguments - stop the bot. """ ievent.untildone = True if bot.ownercheck(ievent.userhost): mainhandler.put(0, globalshutdown) else: ievent.reply("you are not the owner of the bot") return ievent.done(silent=True)
def handle_reboot(bot, ievent): """ reboot the bot. """ if bot.isgae: ievent.reply("this command doesn't work on the GAE") return ievent.reply("rebooting") time.sleep(3) if ievent.rest == "cold": stateful = False else: stateful = True if stateful: mainhandler.put(0, reboot_stateful, bot, ievent, getfleet(), partyline) else: bot.exit() mainhandler.put(0, reboot)
def handle_reboot(bot, ievent): """ no arguments - reboot the bot. """ ievent.reply("rebooting") #time.sleep(3) if ievent.rest == "cold": stateful = False else: stateful = True if stateful: if bot.type == "tornado": callback = functools.partial(reboot_stateful, bot, ievent, getfleet(), partyline) bot.server.io_loop.add_callback(callback) else: mainhandler.put(0, reboot_stateful, bot, ievent, getfleet(), partyline) else: getfleet().exit() mainhandler.put(0, reboot)
def handle_reboot(bot, ievent): """ no arguments - reboot the bot. """ if bot.isgae: ievent.reply("this command doesn't work on the GAE") return ievent.reply("rebooting") time.sleep(3) if ievent.rest == "cold": stateful = False else: stateful = True if stateful: if bot.type == "tornado": bot.ioloop.add_callback(lambda: reboot_stateful(bot, ievent, getfleet(), partyline)) else: mainhandler.put(0, reboot_stateful, bot, ievent, getfleet(), partyline) else: getfleet().exit() mainhandler.put(0, reboot)
def handle_adminstop(bot, ievent): if bot.isgae: ievent.reply("this command doesn't work on the GAE") ; return mainhandler.put(0, globalshutdown)
def handle_adminstop(bot, ievent): """ no arguments - stop the bot. """ if bot.isgae: ievent.reply("this command doesn't work on the GAE") ; return if bot.ownercheck(ievent.userhost): mainhandler.put(0, globalshutdown) else: ievent.reply("you are not the owner of the bot")
def handle_adminstop(bot, ievent): if bot.isgae: ievent.reply("this command doesn't work on the GAE") return mainhandler.put(0, globalshutdown)
def handle_adminstop(bot, ievent): """ no arguments - stop the bot. """ ievent.untildone = True if bot.ownercheck(ievent.userhost): mainhandler.put(0, globalshutdown) else: ievent.reply("you are not the owner of the bot") ; return ievent.done(silent=True)