From 73194a0fc875fdad8341ee744c18723cc31dbffb Mon Sep 17 00:00:00 2001 From: Lili Date: Mon, 7 Nov 2022 17:31:01 +0100 Subject: [PATCH] add new functionality to config, info to redeems --- tlapbot/default_config.py | 3 ++- tlapbot/default_redeems.py | 4 ++-- tlapbot/owncast_redeem_dashboard.py | 4 +++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/tlapbot/default_config.py b/tlapbot/default_config.py index 57f4d85..f24abb8 100644 --- a/tlapbot/default_config.py +++ b/tlapbot/default_config.py @@ -2,4 +2,5 @@ SECRET_KEY='dev' OWNCAST_ACCESS_TOKEN='' OWNCAST_INSTANCE_URL='http://localhost:8080' POINTS_CYCLE_TIME=600 -POINTS_AMOUNT_GIVEN=10 \ No newline at end of file +POINTS_AMOUNT_GIVEN=10 +LIST_REDEEMS=True \ No newline at end of file diff --git a/tlapbot/default_redeems.py b/tlapbot/default_redeems.py index 6956e1c..32d9c0f 100644 --- a/tlapbot/default_redeems.py +++ b/tlapbot/default_redeems.py @@ -1,6 +1,6 @@ REDEEMS={ "hydrate": {"price": 60, "type": "list"}, "lurk": {"price": 1, "type": "counter"}, - "react": {"price": 200, "type": "note"}, - "request": {"price": 100, "type": "note"} + "react": {"price": 200, "type": "note", "info": "Attach a link to a video for me to react to."}, + "request": {"price": 100, "type": "note", "info": "Request a gamemode, level, skin, etc."} } \ No newline at end of file diff --git a/tlapbot/owncast_redeem_dashboard.py b/tlapbot/owncast_redeem_dashboard.py index 263f301..b5de116 100644 --- a/tlapbot/owncast_redeem_dashboard.py +++ b/tlapbot/owncast_redeem_dashboard.py @@ -1,4 +1,4 @@ -from flask import render_template, Blueprint, request +from flask import render_template, Blueprint, request, current_app from tlapbot.db import get_db from tlapbot.owncast_helpers import (pretty_redeem_queue, all_counters, read_all_users_with_username) @@ -12,6 +12,7 @@ def dashboard(): db = get_db() queue = pretty_redeem_queue(db) counters = all_counters(db) + redeems = current_app.config['REDEEMS'] username = request.args.get("username") if username is not None: users = read_all_users_with_username(db, username) @@ -21,6 +22,7 @@ def dashboard(): return render_template('dashboard.html', queue=queue, counters=counters, + redeems=redeems, username=username, users=users, utc_timezone=utc_timezone)