summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorsuhas <hi@suhas.one>2023-11-16 23:25:18 -0600
committersuhas <hi@suhas.one>2023-11-16 23:25:18 -0600
commit92069ffda5f1866f597d678593f377754d0e14e4 (patch)
treec83c85cc689d8a710c1df4a3dc8eeef674d44af3
parentf75eb0581364dd96f0b58cbdfdc4021efb75bcc3 (diff)
downloadqbb-92069ffda5f1866f597d678593f377754d0e14e4.tar.gz
finally fixed db issues i think
-rw-r--r--cogs/__pycache__/stats.cpython-311.pycbin4143 -> 3970 bytes
-rw-r--r--cogs/stats.py10
-rw-r--r--components/__pycache__/AnswerModal.cpython-311.pycbin10282 -> 10307 bytes
3 files changed, 6 insertions, 4 deletions
diff --git a/cogs/__pycache__/stats.cpython-311.pyc b/cogs/__pycache__/stats.cpython-311.pyc
index dde7701..e992a76 100644
--- a/cogs/__pycache__/stats.cpython-311.pyc
+++ b/cogs/__pycache__/stats.cpython-311.pyc
Binary files differdiff --git a/cogs/stats.py b/cogs/stats.py
index 03031ec..071d8d5 100644
--- a/cogs/stats.py
+++ b/cogs/stats.py
@@ -2,7 +2,8 @@ from discord.ext.commands import Cog, Bot
 from discord.app_commands import command
 from discord import Interaction, Embed, Color
 from prisma import Prisma
-from prisma.models import User, CategoryBreakdown
+# from prisma.models import User, CategoryBreakdown
+# from prisma import get_client
 from common.types import category_field_translations
 
 reverse_categories = {v: k for k, v in category_field_translations.items()}
@@ -14,10 +15,11 @@ class Stats(Cog):
 
     @command(description="Get your statistics for qbb")
     async def stats(self, ctx: Interaction):
-        db = Prisma(auto_register=True)
+        db = Prisma()
+        # db = get_client()
         await db.connect()
-        stats = await User.prisma().find_first(where={'id': ctx.user.id})
-        cb = await CategoryBreakdown.prisma().find_first(where={'userId': ctx.user.id})
+        stats = await db.user.find_first(where={'id': ctx.user.id})
+        cb = await db.categorybreakdown.find_first(where={'userId': ctx.user.id})
         if stats is None or cb is None:
             embed = Embed(title="No Stats!", description="You have no stats! Trying using the bot and then running this command", color=Color.red())
             return await ctx.response.send_message(embed=embed)
diff --git a/components/__pycache__/AnswerModal.cpython-311.pyc b/components/__pycache__/AnswerModal.cpython-311.pyc
index 8b217c5..1640197 100644
--- a/components/__pycache__/AnswerModal.cpython-311.pyc
+++ b/components/__pycache__/AnswerModal.cpython-311.pyc
Binary files differ