Add userlog setting, change permissions for modlog to admin only

This commit is contained in:
Zeva Rose 2021-07-02 01:16:48 -06:00
parent e3273ea081
commit ec99d0fb87

View file

@ -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): async def _modlog(self, ctx, channel: TextChannel):
await ctx.defer() await ctx.defer()
self.update_settings("modlog", channel.id, ctx.guild.id) self.update_settings("modlog", channel.id, ctx.guild.id)
await ctx.send( 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}"
) )