From 85c4df92502333d78dcd246c0efd952c6775002a Mon Sep 17 00:00:00 2001 From: Lili Date: Thu, 5 Jan 2023 14:32:53 +0100 Subject: [PATCH] add an error message to points read too --- tlapbot/owncast_webhooks.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tlapbot/owncast_webhooks.py b/tlapbot/owncast_webhooks.py index 3647c50..ac0060b 100644 --- a/tlapbot/owncast_webhooks.py +++ b/tlapbot/owncast_webhooks.py @@ -39,7 +39,10 @@ def owncast_webhook(): send_help() elif data["eventData"]["body"].startswith(f"{prefix}points"): points = read_users_points(db, user_id) - send_chat(f"{display_name}'s points: {points}") + if points is None: + send_chat("Error reading points.") + else: + send_chat(f"{display_name}'s points: {points}") elif data["eventData"]["body"].startswith(f"{prefix}name_update"): # Forces name update in case bot didn't catch the NAME_CHANGE # event. Also removes saved usernames from users with same name