fixed is_command shadowing
This commit is contained in:
parent
6d2e6765f7
commit
d720481c26
@ -10,12 +10,14 @@ def init():
|
|||||||
#todo load entire command library and cache it here
|
#todo load entire command library and cache it here
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
def is_command(command:str)->bool:
|
def is_command(command:str)->bool:
|
||||||
if command == "!echo":
|
if command == "!echo":
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
@api.route('/api/v1/exec', methods=['GET'])
|
@api.route('/api/v1/exec', methods=['GET'])
|
||||||
def handle_command(command, rest):
|
def handle_command(command, rest):
|
||||||
if command == "!echo":
|
if command == "!echo":
|
||||||
@ -23,7 +25,7 @@ def handle_command(command, rest):
|
|||||||
return flask.make_response("{message:\"%s\"}" % message, 200, {"Content-Type": "application/json"})
|
return flask.make_response("{message:\"%s\"}" % message, 200, {"Content-Type": "application/json"})
|
||||||
|
|
||||||
@api.route('/api/v1/command', methods=['GET'])
|
@api.route('/api/v1/command', methods=['GET'])
|
||||||
def is_command():
|
def command_check():
|
||||||
if 'name' in request.args:
|
if 'name' in request.args:
|
||||||
if is_command(request.args['name']):
|
if is_command(request.args['name']):
|
||||||
return flask.make_response('', 200)
|
return flask.make_response('', 200)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user