Okay *now* it posts to the proper url
This commit is contained in:
parent
34927807e7
commit
5e4c372d38
|
@ -40,6 +40,8 @@ headers = CaseInsensitiveDict()
|
|||
headers["Content-Type"] = "application/json"
|
||||
headers["Authorization"] = "Bearer {}".format(config["access_token"])
|
||||
|
||||
post_url = "%s/api/integrations/chat/send" % config["owncast_server"]
|
||||
|
||||
|
||||
def parse_webhook():
|
||||
hook_type = request.json["type"]
|
||||
|
@ -51,10 +53,11 @@ def parse_webhook():
|
|||
if data:
|
||||
send_message(data)
|
||||
|
||||
|
||||
def send_message(data):
|
||||
data = '{"body": "%s"}' % data
|
||||
resp = requests.post(
|
||||
config["owncast_server"],
|
||||
post_url,
|
||||
headers=headers,
|
||||
data=data.encode('utf-8'))
|
||||
|
||||
|
|
|
@ -13,7 +13,8 @@ except ModuleNotFoundError:
|
|||
|
||||
class Quote:
|
||||
def __init__(self, database, user, password):
|
||||
self.conn = psycopg2.connect(database=database, user=user, password=password)
|
||||
self.conn = psycopg2.connect(
|
||||
database=database, user=user, password=password)
|
||||
self.num_quotes = self._get_num_quotes()
|
||||
|
||||
def insert(self, owner, submitter, text):
|
||||
|
|
Loading…
Reference in New Issue