changed api
This commit is contained in:
parent
65a723b5df
commit
d682baa864
@ -55,7 +55,7 @@ def command_check():
|
|||||||
return flask.make_response('', 404)
|
return flask.make_response('', 404)
|
||||||
|
|
||||||
|
|
||||||
@api.route('/api/v1/exec', methods=['GET'])
|
@api.route('/api/v1/exec_command', methods=['GET'])
|
||||||
def exec_command():
|
def exec_command():
|
||||||
if 'command_name' not in request.args:
|
if 'command_name' not in request.args:
|
||||||
return flask.make_response('{\"text\":"Argument \'command_name\' not in request"}', 400)
|
return flask.make_response('{\"text\":"Argument \'command_name\' not in request"}', 400)
|
||||||
|
|||||||
@ -76,7 +76,7 @@ class Twitch_Module():
|
|||||||
def exec_command(self, realMessage: twitch.chat.Message, command: str, rest: str):
|
def exec_command(self, realMessage: twitch.chat.Message, command: str, rest: str):
|
||||||
# todo need to url-escape command and rest
|
# 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})
|
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)
|
resp = requests.get(url)
|
||||||
if resp.status_code == 200:
|
if resp.status_code == 200:
|
||||||
print("Got the following message: %s" % resp.text)
|
print("Got the following message: %s" % resp.text)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user