diff --git a/standalone_command.py b/standalone_command.py index 6de3f90..cacc298 100644 --- a/standalone_command.py +++ b/standalone_command.py @@ -10,12 +10,14 @@ def init(): #todo load entire command library and cache it here pass + def is_command(command:str)->bool: if command == "!echo": return True else: return False + @api.route('/api/v1/exec', methods=['GET']) def handle_command(command, rest): if command == "!echo": @@ -23,7 +25,7 @@ def handle_command(command, rest): return flask.make_response("{message:\"%s\"}" % message, 200, {"Content-Type": "application/json"}) @api.route('/api/v1/command', methods=['GET']) -def is_command(): +def command_check(): if 'name' in request.args: if is_command(request.args['name']): return flask.make_response('', 200)