diff --git a/main.py b/main.py index b7d3880..e36dd86 100644 --- a/main.py +++ b/main.py @@ -7,6 +7,7 @@ import time import atexit import sys import uuid +import json db_path = 'mate.db' conn = sqlite3.connect(db_path, check_same_thread=False) @@ -278,8 +279,10 @@ def get_id(): if users.qsize() == 0: c.execute(f"UPDATE users SET balance = balance - 1 WHERE id={tag[1]}") conn.commit() + c.execute(f"SELECT * FROM users WHERE id={tag[1]}") + user = c.fetchall() socketio.emit("update", "update") - return make_response("True") + return make_response(json.dumps({"username":user[1], "balance":user[2]})) socketio.emit("update", "update") return make_response("False")