show user's points on dashboard

This commit is contained in:
2022-10-18 14:04:15 +02:00
parent ecb794b8fa
commit c12bcd68c2
3 changed files with 35 additions and 2 deletions
+11
View File
@@ -45,6 +45,17 @@ def read_users_points(db, user_id):
print("To user:", user_id)
def read_users_points_from_username(db, username):
try:
cursor = db.execute(
"SELECT points FROM points WHERE name = ?",
(username,)
)
return cursor.fetchone()[0]
except Error as e:
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(