added debugging prints

This commit is contained in:
dtookey 2021-04-20 21:45:48 -04:00
parent d720481c26
commit 9a9174f687
2 changed files with 5 additions and 2 deletions

View File

@ -22,6 +22,7 @@ def is_command(command:str)->bool:
def handle_command(command, rest): def handle_command(command, rest):
if command == "!echo": if command == "!echo":
message = "Got payload [%s]" % rest message = "Got payload [%s]" % rest
print(message)
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'])

View File

@ -1,10 +1,11 @@
from json import loads
import re import re
from json import loads
from urllib.parse import urlencode
import requests import requests
import twitch import twitch
import twitch.chat import twitch.chat
from urllib.parse import urlencode, quote_plus
import config as config import config as config
import credentials import credentials
from cooldowns import Cooldown_Module from cooldowns import Cooldown_Module
@ -98,6 +99,7 @@ class Twitch_Module():
url = "http://localhost:5000/api/v1/exec?%s" % params url = "http://localhost:5000/api/v1/exec?%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)
data = loads(resp.text) data = loads(resp.text)
msg = data['message'] msg = data['message']
if msg is not None: if msg is not None: