From ec99d0fb8719b5137755dc7b45d567329ece8656 Mon Sep 17 00:00:00 2001 From: Zevaryx Date: Fri, 2 Jul 2021 01:16:48 -0600 Subject: [PATCH] Add userlog setting, change permissions for modlog to admin only --- jarvis/cogs/settings.py | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/jarvis/cogs/settings.py b/jarvis/cogs/settings.py index 0e6c25a..8131318 100644 --- a/jarvis/cogs/settings.py +++ b/jarvis/cogs/settings.py @@ -58,12 +58,33 @@ class SettingsCog(commands.Cog): ) ], ) - @admin_or_permissions(mute_members=True) + @commands.has_permissions(administrator=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}`" + f"Settings applied. New modlog channel is {channel.mention}" + ) + + @cog_ext.cog_subcommand( + base="settings", + name="userlog", + description="Set userlog channel", + options=[ + create_option( + name="channel", + description="Userlog channel", + option_type=7, + required=True, + ) + ], + ) + @commands.has_permissions(administrator=True) + async def _modlog(self, ctx, channel: TextChannel): + await ctx.defer() + self.update_settings("userlog", channel.id, ctx.guild.id) + await ctx.send( + f"Settings applied. New userlog channel is {channel.mention}" )