Skip to content

Commit 40abf4d

Browse files
committed
fix: use proper sql statements for creating user and chat
1 parent bda2806 commit 40abf4d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

database/database.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,8 @@ def add_user(self, user_id, lang_id, first_name, last_name, username):
137137

138138
def _add_user(self, user_id, lang_id, first_name, last_name, username):
139139
try:
140-
self.cursor.execute("INSERT INTO users VALUES (?, ?, ?, ?, ?);", [str(user_id), lang_id, first_name, last_name, username])
140+
self.cursor.execute("INSERT INTO users VALUES (?, ?, ?, ?, 0, 0, 0, 0);", [str(user_id), first_name, last_name, username])
141+
self.cursor.execute("INSERT INTO chats VALUES (?, ?);", [str(user_id), lang_id])
141142
self.connection.commit()
142143
except sqlite3.IntegrityError:
143144
return

0 commit comments

Comments
 (0)