fixed is_command shadowing

This commit is contained in:
dtookey 2021-04-20 21:42:27 -04:00
parent 6d2e6765f7
commit d720481c26

View File

@ -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)