Example #1
0
def commands(cmd=None):
    if cmd == "restart":
        Commands.restart_bot()
        return jsonify("Success")

    elif cmd == "stop":
        Commands.stop_bot(get_bot())
        return jsonify("Success")

    return render_template('commands.html', cmd=cmd)
def commands(cmd=None):
    if cmd == "restart":
        Commands.restart_bot()
        return jsonify("Success")

    elif cmd == "stop":
        Commands.stop_bot(get_bot())
        return jsonify("Success")

    return render_template('commands.html',
                           cmd=cmd,
                           metrics_enabled=get_metrics_enabled(),
                           disclaimer=DISCLAIMER)
Example #3
0
def commands(cmd=None):
    if cmd == "update":
        Commands.update(logger, catch=True)
        return jsonify("Success")

    elif cmd == "restart":
        Commands.restart_bot(get_bot(), args="--web")
        return jsonify("Success")

    elif cmd == "stop":
        Commands.stop_bot(get_bot())
        return jsonify("Success")

    return render_template('commands.html', cmd=cmd)
Example #4
0
 def close_callback():
     Commands.stop_bot(get_bot())
Example #5
0
 def command_stop(_, update):
     # TODO add confirmation
     update.message.reply_text("I'm leaving this world...")
     get_bot().stop_threads()
     Commands.stop_bot(get_bot())
Example #6
0
 def command_stop(_, update):
     # TODO add confirmation
     update.message.reply_text("I'm leaving this world...")
     Commands.stop_bot(get_bot())