Compare commits
No commits in common. "c48d89c5af68f590ec80cf45b0e779594c2d935e" and "79902eca86496ec9a32724c5c6e8064e4e936ef5" have entirely different histories.
c48d89c5af
...
79902eca86
@ -87,15 +87,16 @@ class Twitch_Module():
|
|||||||
|
|
||||||
def is_command(self, word: str) -> bool:
|
def is_command(self, word: str) -> bool:
|
||||||
# todo need to url-escape word
|
# todo need to url-escape word
|
||||||
clean_param = urlencode({'name': word})
|
clean_param = urlencode(word, quote_via=quote_plus)
|
||||||
url = "http://localhost:5000/api/v1/command?%s" % clean_param
|
url = "http://localhost:5000/api/v1/command?name=%s" % clean_param
|
||||||
resp = requests.get(url)
|
resp = requests.get(url)
|
||||||
return resp.status_code == 200
|
return resp.status_code == 200
|
||||||
|
|
||||||
def exec_command(self, command: str, rest: str):
|
def exec_command(self, command: str, rest: str):
|
||||||
#todo need to url-escape command and rest
|
#todo need to url-escape command and rest
|
||||||
params = urlencode({'command_name': command, 'rest': rest})
|
clean_command = urlencode(command, quote_via=quote_plus)
|
||||||
url = "http://localhost:5000/api/v1/exec?%s" % params
|
clean_rest = urlencode(rest, quote_via=quote_plus)
|
||||||
|
url = "http://localhost:5000/api/v1/exec?command_name=%s&rest=%s" % (clean_command, clean_rest)
|
||||||
resp = requests.get(url)
|
resp = requests.get(url)
|
||||||
if resp.status_code == 200:
|
if resp.status_code == 200:
|
||||||
data = loads(resp.text)
|
data = loads(resp.text)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user