From 92069ffda5f1866f597d678593f377754d0e14e4 Mon Sep 17 00:00:00 2001 From: suhas Date: Thu, 16 Nov 2023 23:25:18 -0600 Subject: finally fixed db issues i think --- cogs/__pycache__/stats.cpython-311.pyc | Bin 4143 -> 3970 bytes cogs/stats.py | 10 ++++++---- components/__pycache__/AnswerModal.cpython-311.pyc | Bin 10282 -> 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 Binary files a/cogs/__pycache__/stats.cpython-311.pyc and b/cogs/__pycache__/stats.cpython-311.pyc differ diff --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 Binary files a/components/__pycache__/AnswerModal.cpython-311.pyc and b/components/__pycache__/AnswerModal.cpython-311.pyc differ -- cgit 1.4.1-2-gfad0