init-db typo fixes
This commit is contained in:
parent
3c5a09b2de
commit
dda415f87a
|
@ -27,10 +27,12 @@ def insert_counters(db):
|
||||||
if redeem_info["type"] == "counter":
|
if redeem_info["type"] == "counter":
|
||||||
try:
|
try:
|
||||||
cursor = db.execute(
|
cursor = db.execute(
|
||||||
"INSERT INTO counters(name, count) VALUES(?, 0)",
|
"INSERT INTO counters(name, count) VALUES(?, 0)",
|
||||||
(redeem,)
|
(redeem,)
|
||||||
)
|
)
|
||||||
db.commit()
|
db.commit()
|
||||||
|
except Error as e:
|
||||||
|
print("Failed inserting counters to db:", e.args[0])
|
||||||
|
|
||||||
def init_db():
|
def init_db():
|
||||||
db = get_db()
|
db = get_db()
|
||||||
|
|
|
@ -3,7 +3,7 @@ from tlapbot.db import get_db
|
||||||
from tlapbot.owncast_helpers import (use_points, add_to_redeem_queue,
|
from tlapbot.owncast_helpers import (use_points, add_to_redeem_queue,
|
||||||
add_to_counter, read_users_points, send_chat)
|
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)
|
split_message = message[1:].split(maxsplit=1)
|
||||||
redeem = split_message[0]
|
redeem = split_message[0]
|
||||||
if len(split_message) == 1:
|
if len(split_message) == 1:
|
||||||
|
|
|
@ -9,7 +9,7 @@ CREATE TABLE points (
|
||||||
|
|
||||||
CREATE TABLE counters (
|
CREATE TABLE counters (
|
||||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||||
name TEXT NOT NULL
|
name TEXT NOT NULL,
|
||||||
count INTEGER NOT NULL
|
count INTEGER NOT NULL
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue