diff --git a/tlapbot/default_config.py b/tlapbot/default_config.py index 2cb5bc2..1afe300 100644 --- a/tlapbot/default_config.py +++ b/tlapbot/default_config.py @@ -1,3 +1,4 @@ SECRET_KEY='dev' DATABASE='./instance/tlapbot.sqlite' -OWNCAST_ACCESS_TOKEN='' \ No newline at end of file +OWNCAST_ACCESS_TOKEN='' +OWNCAST_INSTANCE_URL='http://localhost:8080' \ No newline at end of file diff --git a/tlapbot/owncastWebhooks.py b/tlapbot/owncastWebhooks.py index 776d46a..0029fcd 100644 --- a/tlapbot/owncastWebhooks.py +++ b/tlapbot/owncastWebhooks.py @@ -36,7 +36,7 @@ def addUserToDatabase(user_id, db): print("To user:", user_id) def sendChat(message): # TODO: url to constant? - url = 'http://localhost:8080/api/integrations/chat/send' + url = current_app.config['OWNCAST_INSTANCE_URL'] + '/api/integrations/chat/send' headers = {"Authorization": "Bearer " + current_app.config['OWNCAST_ACCESS_TOKEN']} r = requests.post(url, headers=headers, json={"body": message}) return r.json()