From bf49aa16cdc9b76d7205d5994c9afe17bb5c736d Mon Sep 17 00:00:00 2001 From: Lili Date: Tue, 18 Oct 2022 14:40:16 +0200 Subject: [PATCH] make help send all redeems (the help function needs a rewrite) --- tlapbot/owncast_webhooks.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tlapbot/owncast_webhooks.py b/tlapbot/owncast_webhooks.py index ed9cee1..da7badd 100644 --- a/tlapbot/owncast_webhooks.py +++ b/tlapbot/owncast_webhooks.py @@ -1,4 +1,4 @@ -from flask import Flask, request, json, Blueprint +from flask import Flask, request, json, Blueprint, current_app from sqlite3 import Error from tlapbot.db import get_db from tlapbot.owncast_helpers import (add_user_to_database, change_display_name, @@ -28,9 +28,12 @@ def owncast_webhook(): print(f'{data["eventData"]["body"]}') if "!help" in data["eventData"]["body"]: message = """Tlapbot commands: + !help to see this help message. !points to see your points. - !drink to redeem a pitíčko for 60 points. - That's it for now.""" + !name_update to force name update if tlapbot didn't catch it. + Tlapbot redeems:\n""" + for redeem, redeem_info in current_app.config['REDEEMS'].items(): + message += (f"!{redeem} for {redeem_info['price']} points.\n") # TODO: also make this customizable send_chat(message) elif "!points" in data["eventData"]["body"]: