fix(moderation): fixed history config settings
Some checks failed
Pylint / Pylint (3.10) (push) Failing after 46s

This commit is contained in:
Seaswimmer 2023-12-15 10:05:07 -05:00
parent 1bd0a6d23b
commit 939ecebb50
Signed by: cswimr
GPG key ID: 1EBC234EEDA901AE

View file

@ -1363,10 +1363,10 @@ class Moderation(commands.Cog):
"""Manage configuration for the /history command.""" """Manage configuration for the /history command."""
@moderationset_history.command(name='ephemeral', aliases=['hidden', 'hide']) @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.""" """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 self.config.user(ctx.author).history_ephemeral.set(enabled)
await ctx.send(f"Ephemeral setting set to {await self.config.user(ctx.author).ephemeral()}") await ctx.send(f"Ephemeral setting set to {enabled}")
@moderationset_history.command(name='pagesize') @moderationset_history.command(name='pagesize')
async def moderationset_history_user_pagesize(self, ctx: commands.Context, pagesize: int): 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.""" """Manage configuration for the /history command's inline argument."""
@moderationset_history_inline.command(name='toggle') @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.""" """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 self.config.user(ctx.author).history_inline.set(enabled)
await ctx.send(f"Inline setting set to {await self.config.user(ctx.author).history_inline()}") await ctx.send(f"Inline setting set to {enabled}")
@moderationset_history_inline.command(name='pagesize') @moderationset_history_inline.command(name='pagesize')
async def moderationset_history_user_inline_pagesize(self, ctx: commands.Context, pagesize: int): 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']) @moderationset_history_guild.command(name='ephemeral', aliases=['hidden', 'hide'])
@checks.admin() @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.""" """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 self.config.guild(ctx.guild).history_ephemeral.set(enabled)
await ctx.send(f"Ephemeral setting set to {await self.config.guild(ctx.guild).ephemeral()}") await ctx.send(f"Ephemeral setting set to {enabled}")
@moderationset_history_guild.command(name='pagesize') @moderationset_history_guild.command(name='pagesize')
@checks.admin() @checks.admin()
@ -1416,10 +1416,10 @@ class Moderation(commands.Cog):
@moderationset_history_guild_inline.command(name='toggle') @moderationset_history_guild_inline.command(name='toggle')
@checks.admin() @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.""" """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 self.config.guild(ctx.guild).history_inline.set(enabled)
await ctx.send(f"Inline setting set to {await self.config.guild(ctx.guild).history_inline()}") await ctx.send(f"Inline setting set to {enabled}")
@moderationset_history_guild_inline.command(name='pagesize') @moderationset_history_guild_inline.command(name='pagesize')
@checks.admin() @checks.admin()