From 939ecebb504b50620c1b8018f194602f452fc3ee Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Fri, 15 Dec 2023 10:05:07 -0500 Subject: [PATCH] fix(moderation): fixed history config settings --- moderation/moderation.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/moderation/moderation.py b/moderation/moderation.py index 43c91a9..a15acf3 100644 --- a/moderation/moderation.py +++ b/moderation/moderation.py @@ -1363,10 +1363,10 @@ class Moderation(commands.Cog): """Manage configuration for the /history command.""" @moderationset_history.command(name='ephemeral', aliases=['hidden', 'hide']) - async def moderationset_history_user_ephemeral(self, ctx: commands.Context): + async def moderationset_history_user_ephemeral(self, ctx: commands.Context, enabled: bool): """Toggle if the /history command should be ephemeral.""" - await self.config.user(ctx.author).history_ephemeral.set(not await self.config.user(ctx.author).ephemeral()) - await ctx.send(f"Ephemeral setting set to {await self.config.user(ctx.author).ephemeral()}") + await self.config.user(ctx.author).history_ephemeral.set(enabled) + await ctx.send(f"Ephemeral setting set to {enabled}") @moderationset_history.command(name='pagesize') async def moderationset_history_user_pagesize(self, ctx: commands.Context, pagesize: int): @@ -1379,10 +1379,10 @@ class Moderation(commands.Cog): """Manage configuration for the /history command's inline argument.""" @moderationset_history_inline.command(name='toggle') - async def moderationset_history_user_inline_toggle(self, ctx: commands.Context): + async def moderationset_history_user_inline_toggle(self, ctx: commands.Context, enabled: bool): """Enable the /history command's inline argument by default.""" - await self.config.user(ctx.author).history_inline.set(not await self.config.user(ctx.author).history_inline()) - await ctx.send(f"Inline setting set to {await self.config.user(ctx.author).history_inline()}") + await self.config.user(ctx.author).history_inline.set(enabled) + await ctx.send(f"Inline setting set to {enabled}") @moderationset_history_inline.command(name='pagesize') async def moderationset_history_user_inline_pagesize(self, ctx: commands.Context, pagesize: int): @@ -1397,10 +1397,10 @@ class Moderation(commands.Cog): @moderationset_history_guild.command(name='ephemeral', aliases=['hidden', 'hide']) @checks.admin() - async def moderationset_history_guild_ephemeral(self, ctx: commands.Context): + async def moderationset_history_guild_ephemeral(self, ctx: commands.Context, enabled: bool): """Toggle if the /history command should be ephemeral.""" - await self.config.guild(ctx.guild).history_ephemeral.set(not await self.config.guild(ctx.guild).ephemeral()) - await ctx.send(f"Ephemeral setting set to {await self.config.guild(ctx.guild).ephemeral()}") + await self.config.guild(ctx.guild).history_ephemeral.set(enabled) + await ctx.send(f"Ephemeral setting set to {enabled}") @moderationset_history_guild.command(name='pagesize') @checks.admin() @@ -1416,10 +1416,10 @@ class Moderation(commands.Cog): @moderationset_history_guild_inline.command(name='toggle') @checks.admin() - async def moderationset_history_guild_inline_toggle(self, ctx: commands.Context): + async def moderationset_history_guild_inline_toggle(self, ctx: commands.Context, enabled: bool): """Enable the /history command's inline argument by default.""" - await self.config.guild(ctx.guild).history_inline.set(not await self.config.guild(ctx.guild).history_inline()) - await ctx.send(f"Inline setting set to {await self.config.guild(ctx.guild).history_inline()}") + await self.config.guild(ctx.guild).history_inline.set(enabled) + await ctx.send(f"Inline setting set to {enabled}") @moderationset_history_guild_inline.command(name='pagesize') @checks.admin()