Migrate cogs/modlog/command to models
This commit is contained in:
parent
6286f59abe
commit
905b0ceb50
1 changed files with 4 additions and 2 deletions
|
@ -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 = [
|
||||
|
|
Loading…
Add table
Reference in a new issue