diff --git a/jarvis/cogs/settings.py b/jarvis/cogs/settings.py index 80638ff..0e6c25a 100644 --- a/jarvis/cogs/settings.py +++ b/jarvis/cogs/settings.py @@ -1,6 +1,6 @@ import discord import jarvis -from discord import Role +from discord import Role, TextChannel from discord.ext import commands from discord_slash import cog_ext from discord_slash.utils.manage_commands import create_option @@ -45,6 +45,27 @@ class SettingsCog(commands.Cog): self.update_settings("mute", role.id, ctx.guild.id) await ctx.send(f"Settings applied. New mute role is `{role.name}`") + @cog_ext.cog_subcommand( + base="settings", + name="modlog", + description="Set modlog channel", + options=[ + create_option( + name="channel", + description="Modlog channel", + option_type=7, + required=True, + ) + ], + ) + @admin_or_permissions(mute_members=True) + async def _modlog(self, ctx, channel: TextChannel): + await ctx.defer() + self.update_settings("modlog", channel.id, ctx.guild.id) + await ctx.send( + f"Settings applied. New modlog channel is `{channel.name}`" + ) + def setup(bot): bot.add_cog(SettingsCog(bot))