diff --git a/tlapbot/db.py b/tlapbot/db.py index e9890f7..0dac1ec 100644 --- a/tlapbot/db.py +++ b/tlapbot/db.py @@ -68,7 +68,7 @@ def refresh_counters(): db.commit() except Error as e: print("Error occured deleting old counters:", e.args[0]) - + for redeem, redeem_info in current_app.config['REDEEMS'].items(): if redeem_info["type"] == "counter": try: diff --git a/tlapbot/help_message.py b/tlapbot/help_message.py index af2d4cd..f9a7d89 100644 --- a/tlapbot/help_message.py +++ b/tlapbot/help_message.py @@ -20,4 +20,4 @@ def send_help(): message.append(f"!{redeem} for {redeem_info['price']} points.\n") else: message.append("Check the dashboard for a list of currently active redeems.") - send_chat(''.join(message)) \ No newline at end of file + send_chat(''.join(message)) diff --git a/tlapbot/owncast_helpers.py b/tlapbot/owncast_helpers.py index 1ed92d3..57e185d 100644 --- a/tlapbot/owncast_helpers.py +++ b/tlapbot/owncast_helpers.py @@ -55,6 +55,7 @@ def read_all_users_with_username(db, username): print("Error occured reading points from username:", e.args[0]) print("To user:", username) + def give_points_to_user(db, user_id, points): try: db.execute( @@ -108,7 +109,7 @@ def add_user_to_database(db, user_id, display_name): "INSERT INTO points(id, name, points) VALUES(?, ?, 10)", (user_id, display_name) ) - if user is not None and user[1] == None: + if user is not None and user[1] is None: cursor.execute( """UPDATE points SET name = ? @@ -157,8 +158,6 @@ def add_to_redeem_queue(db, user_id, redeem_name, note=None): print("To user:", user_id, " with redeem:", redeem_name, "with note:", note) - - def all_counters(db): try: cursor = db.execute( @@ -198,7 +197,7 @@ def remove_duplicate_usernames(db, user_id, username): """UPDATE points SET name = NULL WHERE name = ? AND NOT id = ?""", - (username, user_id) + (username, user_id) ) db.commit() except Error as e: diff --git a/tlapbot/owncast_redeem_dashboard.py b/tlapbot/owncast_redeem_dashboard.py index b5de116..f0c4976 100644 --- a/tlapbot/owncast_redeem_dashboard.py +++ b/tlapbot/owncast_redeem_dashboard.py @@ -16,7 +16,7 @@ def dashboard(): username = request.args.get("username") if username is not None: users = read_all_users_with_username(db, username) - else: + else: users = [] utc_timezone = timezone.utc return render_template('dashboard.html',