You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: purchase_logger.py
+37-5Lines changed: 37 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ def __init__(self, bot):
13
13
self.database=sqlite3.connect('database.db')
14
14
self.cursor=self.database.cursor()
15
15
16
-
self.database.execute("CREATE TABLE IF NOT EXISTS purchases(user_id INT, category STRING, title STRING, description STRING, cost FLOAT)")
16
+
self.database.execute("CREATE TABLE IF NOT EXISTS purchases(user_id INT, category STRING, title STRING, description STRING, cost FLOAT, timestamp DATETIME DEFAULT CURRENT_TIMESTAMP)")
17
17
self.database.execute("CREATE TABLE IF NOT EXISTS categories(user_id INT, category STRING)")
18
18
19
19
@@ -33,7 +33,7 @@ async def add_category(
33
33
):
34
34
"""Adds a category into the category list that is called when using a command involving any purchases"""
35
35
36
-
# Fetching all added categories by user in database
36
+
# Fetching all added categories by user in databasenextcord.errors.ApplicationInvokeError: Command raised an exception: OperationalError: table purchases has 6 columns but 5 values were supplied
37
37
categories=self.fetch_categories(interaction)
38
38
39
39
ifcategoryincategories:
@@ -58,7 +58,7 @@ async def clear_categories(
58
58
):
59
59
"""Removes a category from the category list that is called when using a command involving any purchases"""
60
60
pass
61
-
61
+
62
62
63
63
@category.subcommand(description="Removes a category from the available list")
64
64
asyncdefremove_category(
@@ -69,8 +69,39 @@ async def remove_category(
69
69
"""Removes a category from the category list that is called when using a command involving any purchases"""
0 commit comments