From d720481c26d5cbb9b39f6ea73d4fe39aeac67f87 Mon Sep 17 00:00:00 2001 From: dtookey Date: Tue, 20 Apr 2021 21:42:27 -0400 Subject: [PATCH] fixed is_command shadowing --- standalone_command.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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)