From dc68887c82816412c3a3e00fac88106b541984dc Mon Sep 17 00:00:00 2001 From: Lili Date: Fri, 13 Jan 2023 18:51:44 +0100 Subject: [PATCH] change redeem categories to list format --- tlapbot/default_redeems.py | 4 ++-- tlapbot/owncast_helpers.py | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tlapbot/default_redeems.py b/tlapbot/default_redeems.py index 828728e..6df5bbf 100644 --- a/tlapbot/default_redeems.py +++ b/tlapbot/default_redeems.py @@ -2,6 +2,6 @@ REDEEMS={ "hydrate": {"price": 60, "type": "list"}, "lurk": {"price": 1, "type": "counter", "info": "Let us know you're going to lurk."}, "react": {"price": 200, "type": "note", "info": "Attach link to a video for me to react to."}, - "request": {"price": 100, "type": "note", "info": "Request a level, gamemode, skin, etc."} - "inactive": {"price": 100, "type": "note", "info": "Example redeem that is inactive by default", "category": "inactive"} + "request": {"price": 100, "type": "note", "info": "Request a level, gamemode, skin, etc."}, + "inactive": {"price": 100, "type": "note", "info": "Example redeem that is inactive by default", "category": ["inactive"]} } \ No newline at end of file diff --git a/tlapbot/owncast_helpers.py b/tlapbot/owncast_helpers.py index 0ac83bc..9d7ef7d 100644 --- a/tlapbot/owncast_helpers.py +++ b/tlapbot/owncast_helpers.py @@ -236,7 +236,10 @@ def remove_emoji(message): def is_redeem_active(redeem, active_categories): - if "category" in redeem[1] and redeem[1]["category"] not in active_categories: + if "category" in redeem[1]: + for category in redeem[1]["category"]: + if category in active_categories: + return True return False return True