Update Akeno/utils/base_sqlite.py
Browse files
Akeno/utils/base_sqlite.py
CHANGED
@@ -28,9 +28,10 @@ async def get_prefix(user_id: int):
|
|
28 |
return result
|
29 |
|
30 |
def fetch_prefix_from_db(user_id: int):
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
|
36 |
-
|
|
|
|
28 |
return result
|
29 |
|
30 |
def fetch_prefix_from_db(user_id: int):
|
31 |
+
with conn.cursor() as cursor:
|
32 |
+
cursor.execute('SELECT prefix FROM prefixes WHERE user_id=?', (user_id,))
|
33 |
+
result = cursor.fetchone()
|
34 |
+
return result[0] if result else None
|
35 |
|
36 |
+
async def close_connection():
|
37 |
+
conn.close()
|