From f16f6cc92564bcd0c1d8831711d583ef5336771b Mon Sep 17 00:00:00 2001 From: Lili Date: Wed, 24 Aug 2022 15:55:55 +0200 Subject: [PATCH] add drink --- tlapbot/owncast_webhooks.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tlapbot/owncast_webhooks.py b/tlapbot/owncast_webhooks.py index c72de4b..fa0f16f 100644 --- a/tlapbot/owncast_webhooks.py +++ b/tlapbot/owncast_webhooks.py @@ -1,7 +1,7 @@ from flask import Flask,request,json,Blueprint from sqlite3 import Error from tlapbot.db import get_db -from tlapbot.owncast_helpers import user_exists, add_user_to_database, send_chat, give_points_to_user, read_users_points +from tlapbot.owncast_helpers import * bp = Blueprint('owncast_webhooks', __name__) @@ -26,6 +26,12 @@ def owncast_webhook(): message = "{}'s points: {}".format(display_name, points) print(message) send_chat(message) + elif "!drink" in data["eventData"]["body"]: + points = read_users_points(db, user_id) + if points is not None: + if points > 60: + use_points(db, user_id, 60) + send_chat("Enjoy your DRINK........... sips") else: # DEBUG: give points for message - give_points_to_user(db, user_id, 10) + give_points_to_chat(db) return data \ No newline at end of file