diff --git a/jarvis/cogs/modlog/command.py b/jarvis/cogs/modlog/command.py deleted file mode 100644 index f846f4c..0000000 --- a/jarvis/cogs/modlog/command.py +++ /dev/null @@ -1,38 +0,0 @@ -"""J.A.R.V.I.S. ModlogCommandCog.""" -from dis_snek import InteractionContext, Snake, listen -from dis_snek.models.discord.channel import DMChannel -from dis_snek.models.discord.embed import EmbedField - -from jarvis.db.models import Setting -from jarvis.utils import build_embed - - -class ModlogCommandCog(object): - """J.A.R.V.I.S. ModlogCommandCog.""" - - def __init__(self, bot: Snake): - self.bot = bot - self.bot.add_listener(self.on_command) - - @listen() - async def on_command(self, ctx: InteractionContext) -> None: - """Process on_slash_command events.""" - if not isinstance(ctx.channel, DMChannel) and ctx.name not in ["pw"]: - modlog = Setting.objects(guild=ctx.guild.id, setting="modlog").first() - if modlog: - channel = await ctx.guild.get_channel(modlog.value) - args = " ".join(f"{k}:v" for k, v in ctx.kwargs.items()) - fields = [ - EmbedField(name="Command", value=f"{ctx.invoked_name} {args}", inline=False), - ] - embed = build_embed( - title="Command Invoked", - description=f"{ctx.author.mention} invoked a command", - fields=fields, - color="#fc9e3f", - ) - embed.set_author(name=ctx.author.username, icon_url=ctx.author.display_avatar.url) - embed.set_footer( - text=f"{ctx.author.username}#{ctx.author.discriminator} | {ctx.author.id}" - ) - await channel.send(embed=embed)