From 905b0ceb50d9a0f6c7c84ea3de5df7dd3508b078 Mon Sep 17 00:00:00 2001 From: Zevaryx Date: Thu, 5 Aug 2021 17:21:41 -0600 Subject: [PATCH] Migrate cogs/modlog/command to models --- jarvis/cogs/modlog/command.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/jarvis/cogs/modlog/command.py b/jarvis/cogs/modlog/command.py index 34c07c8..db7d148 100644 --- a/jarvis/cogs/modlog/command.py +++ b/jarvis/cogs/modlog/command.py @@ -2,7 +2,7 @@ from discord import DMChannel from discord.ext import commands from discord_slash import SlashContext -from jarvis.db.types import Setting +from jarvis.db.models import Setting from jarvis.utils import build_embed from jarvis.utils.field import Field @@ -14,7 +14,9 @@ class ModlogCommandCog(commands.Cog): @commands.Cog.listener() async def on_slash_command(self, ctx: SlashContext): if not isinstance(ctx.channel, DMChannel) and ctx.name not in ["pw"]: - modlog = Setting.get(guild=ctx.guild.id, setting="modlog") + modlog = Setting.objects( + guild=ctx.guild.id, setting="modlog" + ).first() if modlog: channel = ctx.guild.get_channel(modlog.value) fields = [