diff options
author | suhas <hi@suhas.one> | 2023-11-16 23:25:18 -0600 |
---|---|---|
committer | suhas <hi@suhas.one> | 2023-11-16 23:25:18 -0600 |
commit | 92069ffda5f1866f597d678593f377754d0e14e4 (patch) | |
tree | c83c85cc689d8a710c1df4a3dc8eeef674d44af3 /cogs/stats.py | |
parent | f75eb0581364dd96f0b58cbdfdc4021efb75bcc3 (diff) | |
download | qbb-92069ffda5f1866f597d678593f377754d0e14e4.tar.gz |
finally fixed db issues i think
Diffstat (limited to 'cogs/stats.py')
-rw-r--r-- | cogs/stats.py | 10 |
1 files changed, 6 insertions, 4 deletions
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) |