From 7722bdf6089728cc4919a2eb08fab72f30822e9d Mon Sep 17 00:00:00 2001 From: Lili Date: Tue, 6 Feb 2024 20:15:58 +0100 Subject: [PATCH] add redeem name warning to init --- tlapbot/__init__.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tlapbot/__init__.py b/tlapbot/__init__.py index 5a550bb..a5b201b 100644 --- a/tlapbot/__init__.py +++ b/tlapbot/__init__.py @@ -35,6 +35,12 @@ def create_app(test_config=None): if len(app.config['PREFIX']) != 1: raise RuntimeError("Prefix is >1 character. " "Change your config to set 1-character prefix.") + + # Check for spaces in redeems (they won't work) + for redeem, _ in app.config['REDEEMS']: + if ' ' in redeem: + app.logger.warning(f"Redeem {redeem} has spaces in its name. It will be impossible to redeem.") + # prepare webhooks and redeem dashboard blueprints from . import owncast_webhooks