changed api

This commit is contained in:
Alex Orid 2021-04-26 14:49:28 -04:00
parent 65a723b5df
commit d682baa864
2 changed files with 2 additions and 2 deletions

View File

@ -55,7 +55,7 @@ def command_check():
return flask.make_response('', 404)
@api.route('/api/v1/exec', methods=['GET'])
@api.route('/api/v1/exec_command', methods=['GET'])
def exec_command():
if 'command_name' not in request.args:
return flask.make_response('{\"text\":"Argument \'command_name\' not in request"}', 400)

View File

@ -76,7 +76,7 @@ class Twitch_Module():
def exec_command(self, realMessage: twitch.chat.Message, command: str, rest: str):
# todo need to url-escape command and rest
params = urlencode({'command_source': commands.command_base.AbstractCommand.CommandSource.Twitch,'user_name': realMessage.sender, 'command_name': command, 'rest': rest, 'bonus_data': realMessage})
url = "http://standalone_command:6009/api/v1/exec?%s" % params
url = "http://standalone_command:6009/api/v1/exec_command?%s" % params
resp = requests.get(url)
if resp.status_code == 200:
print("Got the following message: %s" % resp.text)