forked from blizzthewolf/SeaCogs
feat(moderation): updated configs
This commit is contained in:
parent
1c624ee8ab
commit
8335e63bfa
1 changed files with 46 additions and 25 deletions
|
@ -1079,18 +1079,28 @@ class Moderation(commands.Cog):
|
||||||
|
|
||||||
await ctx.send(embed=embed)
|
await ctx.send(embed=embed)
|
||||||
|
|
||||||
@moderationset.group(autohelp=True, name='history')
|
@moderationset.group(autohelp=True, name='user')
|
||||||
async def moderationset_history(self, ctx: commands.Context):
|
async def moderationset_user(self, ctx: commands.Context):
|
||||||
|
"""Manage configurations for user configuration options."""
|
||||||
|
|
||||||
|
@moderationset_user.command(name='autoevidence')
|
||||||
|
async def moderationset_user_autoevidence(self, ctx: commands.Context, enabled: bool):
|
||||||
|
"""Toggle if the evidenceformat codeblock should be sent automatically."""
|
||||||
|
await config.user(ctx.author).auto_evidenceformat.set(enabled)
|
||||||
|
await ctx.send(f"Auto evidenceformat setting set to {enabled}")
|
||||||
|
|
||||||
|
@moderationset_user.group(autohelp=True, name='history')
|
||||||
|
async def moderationset_user_history(self, ctx: commands.Context):
|
||||||
"""Manage configuration for the /history command."""
|
"""Manage configuration for the /history command."""
|
||||||
|
|
||||||
@moderationset_history.command(name='ephemeral', aliases=['hidden', 'hide'])
|
@moderationset_user_history.command(name='ephemeral', aliases=['hidden', 'hide'])
|
||||||
async def moderationset_history_user_ephemeral(self, ctx: commands.Context, enabled: bool):
|
async def moderationset_user_history_ephemeral(self, ctx: commands.Context, enabled: bool):
|
||||||
"""Toggle if the /history command should be ephemeral."""
|
"""Toggle if the /history command should be ephemeral."""
|
||||||
await config.user(ctx.author).history_ephemeral.set(enabled)
|
await config.user(ctx.author).history_ephemeral.set(enabled)
|
||||||
await ctx.send(f"Ephemeral setting set to {enabled}")
|
await ctx.send(f"Ephemeral setting set to {enabled}")
|
||||||
|
|
||||||
@moderationset_history.command(name='pagesize')
|
@moderationset_user_history.command(name='pagesize')
|
||||||
async def moderationset_history_user_pagesize(self, ctx: commands.Context, pagesize: int):
|
async def moderationset_user_history_pagesize(self, ctx: commands.Context, pagesize: int):
|
||||||
"""Set the amount of cases to display per page."""
|
"""Set the amount of cases to display per page."""
|
||||||
if pagesize > 20:
|
if pagesize > 20:
|
||||||
await ctx.send("Pagesize cannot be greater than 20!")
|
await ctx.send("Pagesize cannot be greater than 20!")
|
||||||
|
@ -1101,18 +1111,18 @@ class Moderation(commands.Cog):
|
||||||
await config.user(ctx.author).history_pagesize.set(pagesize)
|
await config.user(ctx.author).history_pagesize.set(pagesize)
|
||||||
await ctx.send(f"Pagesize set to {await config.user(ctx.author).history_pagesize()}")
|
await ctx.send(f"Pagesize set to {await config.user(ctx.author).history_pagesize()}")
|
||||||
|
|
||||||
@moderationset_history.group(name='inline')
|
@moderationset_user_history.group(name='inline')
|
||||||
async def moderationset_history_inline(self, ctx: commands.Context):
|
async def moderationset_user_history_inline(self, ctx: commands.Context):
|
||||||
"""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_user_history_inline.command(name='toggle')
|
||||||
async def moderationset_history_user_inline_toggle(self, ctx: commands.Context, enabled: bool):
|
async def moderationset_user_history_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 config.user(ctx.author).history_inline.set(enabled)
|
await config.user(ctx.author).history_inline.set(enabled)
|
||||||
await ctx.send(f"Inline setting set to {enabled}")
|
await ctx.send(f"Inline setting set to {enabled}")
|
||||||
|
|
||||||
@moderationset_history_inline.command(name='pagesize')
|
@moderationset_user_history_inline.command(name='pagesize')
|
||||||
async def moderationset_history_user_inline_pagesize(self, ctx: commands.Context, pagesize: int):
|
async def moderationset_user_history_inline_pagesize(self, ctx: commands.Context, pagesize: int):
|
||||||
"""Set the amount of cases to display per page."""
|
"""Set the amount of cases to display per page."""
|
||||||
if pagesize > 20:
|
if pagesize > 20:
|
||||||
await ctx.send("Pagesize cannot be greater than 20!")
|
await ctx.send("Pagesize cannot be greater than 20!")
|
||||||
|
@ -1123,21 +1133,32 @@ class Moderation(commands.Cog):
|
||||||
await config.user(ctx.author).history_inline_pagesize.set(pagesize)
|
await config.user(ctx.author).history_inline_pagesize.set(pagesize)
|
||||||
await ctx.send(f"Inline pagesize set to {await config.user(ctx.author).history_inline_pagesize()}")
|
await ctx.send(f"Inline pagesize set to {await config.user(ctx.author).history_inline_pagesize()}")
|
||||||
|
|
||||||
@moderationset_history.group(autohelp=True, name='guild')
|
@moderationset.group(autohelp=True, name='guild')
|
||||||
@checks.admin()
|
@checks.admin()
|
||||||
async def moderationset_history_guild(self, ctx: commands.Context):
|
async def moderationset_guild(self, ctx: commands.Context):
|
||||||
"""Manage configuration for the /history command, per guild."""
|
"""Manage default configurations for user configuration options, per guild."""
|
||||||
|
|
||||||
@moderationset_history_guild.command(name='ephemeral', aliases=['hidden', 'hide'])
|
@moderationset_guild.command(name='autoevidence')
|
||||||
|
async def moderationset_guild_autoevidence(self, ctx: commands.Context, enabled: bool):
|
||||||
|
"""Toggle if the evidenceformat codeblock should be sent automatically."""
|
||||||
|
await config.guild(ctx.guild).auto_evidenceformat.set(enabled)
|
||||||
|
await ctx.send(f"Auto evidenceformat setting set to {enabled}")
|
||||||
|
|
||||||
|
@moderationset_guild.group(autohelp=True, name='history')
|
||||||
@checks.admin()
|
@checks.admin()
|
||||||
async def moderationset_history_guild_ephemeral(self, ctx: commands.Context, enabled: bool):
|
async def moderationset_guild_history(self, ctx: commands.Context):
|
||||||
|
"""Manage configuration for the /history command."""
|
||||||
|
|
||||||
|
@moderationset_guild_history.command(name='ephemeral', aliases=['hidden', 'hide'])
|
||||||
|
@checks.admin()
|
||||||
|
async def moderationset_guild_history_ephemeral(self, ctx: commands.Context, enabled: bool):
|
||||||
"""Toggle if the /history command should be ephemeral."""
|
"""Toggle if the /history command should be ephemeral."""
|
||||||
await config.guild(ctx.guild).history_ephemeral.set(enabled)
|
await config.guild(ctx.guild).history_ephemeral.set(enabled)
|
||||||
await ctx.send(f"Ephemeral setting set to {enabled}")
|
await ctx.send(f"Ephemeral setting set to {enabled}")
|
||||||
|
|
||||||
@moderationset_history_guild.command(name='pagesize')
|
@moderationset_guild_history.command(name='pagesize')
|
||||||
@checks.admin()
|
@checks.admin()
|
||||||
async def moderationset_history_guild_pagesize(self, ctx: commands.Context, pagesize: int):
|
async def moderationset_guild_history_pagesize(self, ctx: commands.Context, pagesize: int):
|
||||||
"""Set the amount of cases to display per page."""
|
"""Set the amount of cases to display per page."""
|
||||||
if pagesize > 20:
|
if pagesize > 20:
|
||||||
await ctx.send("Pagesize cannot be greater than 20!")
|
await ctx.send("Pagesize cannot be greater than 20!")
|
||||||
|
@ -1148,21 +1169,21 @@ class Moderation(commands.Cog):
|
||||||
await config.guild(ctx.guild).history_pagesize.set(pagesize)
|
await config.guild(ctx.guild).history_pagesize.set(pagesize)
|
||||||
await ctx.send(f"Pagesize set to {await config.guild(ctx.guild).history_pagesize()}")
|
await ctx.send(f"Pagesize set to {await config.guild(ctx.guild).history_pagesize()}")
|
||||||
|
|
||||||
@moderationset_history_guild.group(name='inline')
|
@moderationset_guild_history.group(name='inline')
|
||||||
@checks.admin()
|
@checks.admin()
|
||||||
async def moderationset_history_guild_inline(self, ctx: commands.Context):
|
async def moderationset_guild_history_inline(self, ctx: commands.Context):
|
||||||
"""Manage configuration for the /history command's inline argument."""
|
"""Manage configuration for the /history command's inline argument."""
|
||||||
|
|
||||||
@moderationset_history_guild_inline.command(name='toggle')
|
@moderationset_guild_history_inline.command(name='toggle')
|
||||||
@checks.admin()
|
@checks.admin()
|
||||||
async def moderationset_history_guild_inline_toggle(self, ctx: commands.Context, enabled: bool):
|
async def moderationset_guild_history_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 config.guild(ctx.guild).history_inline.set(enabled)
|
await config.guild(ctx.guild).history_inline.set(enabled)
|
||||||
await ctx.send(f"Inline setting set to {enabled}")
|
await ctx.send(f"Inline setting set to {enabled}")
|
||||||
|
|
||||||
@moderationset_history_guild_inline.command(name='pagesize')
|
@moderationset_guild_history_inline.command(name='pagesize')
|
||||||
@checks.admin()
|
@checks.admin()
|
||||||
async def moderationset_history_guild_inline_pagesize(self, ctx: commands.Context, pagesize: int):
|
async def moderationset_guild_history_inline_pagesize(self, ctx: commands.Context, pagesize: int):
|
||||||
"""Set the amount of cases to display per page."""
|
"""Set the amount of cases to display per page."""
|
||||||
if pagesize > 20:
|
if pagesize > 20:
|
||||||
await ctx.send("Pagesize cannot be greater than 20!")
|
await ctx.send("Pagesize cannot be greater than 20!")
|
||||||
|
|
Loading…
Reference in a new issue