From dda415f87ac5aea815e8dddc2b5f8e13dfa061b9 Mon Sep 17 00:00:00 2001 From: Lili Date: Thu, 13 Oct 2022 13:29:38 +0200 Subject: [PATCH] init-db typo fixes --- tlapbot/db.py | 8 +++++--- tlapbot/redeems_handler.py | 2 +- tlapbot/schema.sql | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/tlapbot/db.py b/tlapbot/db.py index e591486..9d897d6 100644 --- a/tlapbot/db.py +++ b/tlapbot/db.py @@ -27,10 +27,12 @@ def insert_counters(db): if redeem_info["type"] == "counter": try: cursor = db.execute( - "INSERT INTO counters(name, count) VALUES(?, 0)", - (redeem,) - ) + "INSERT INTO counters(name, count) VALUES(?, 0)", + (redeem,) + ) db.commit() + except Error as e: + print("Failed inserting counters to db:", e.args[0]) def init_db(): db = get_db() diff --git a/tlapbot/redeems_handler.py b/tlapbot/redeems_handler.py index db2f233..d1be064 100644 --- a/tlapbot/redeems_handler.py +++ b/tlapbot/redeems_handler.py @@ -3,7 +3,7 @@ from tlapbot.db import get_db from tlapbot.owncast_helpers import (use_points, add_to_redeem_queue, add_to_counter, read_users_points, send_chat) -def handle_redeem(message, user_id) +def handle_redeem(message, user_id): split_message = message[1:].split(maxsplit=1) redeem = split_message[0] if len(split_message) == 1: diff --git a/tlapbot/schema.sql b/tlapbot/schema.sql index 99fca09..549540c 100644 --- a/tlapbot/schema.sql +++ b/tlapbot/schema.sql @@ -9,7 +9,7 @@ CREATE TABLE points ( CREATE TABLE counters ( id INTEGER PRIMARY KEY AUTOINCREMENT, - name TEXT NOT NULL + name TEXT NOT NULL, count INTEGER NOT NULL );