Add reset_rules command and default rules constant

This commit is contained in:
Codex 2025-06-07 01:17:10 +00:00 committed by Slipstream
parent 571d3710e0
commit 7dccc7ee4a
Signed by: slipstream
GPG Key ID: 13E498CE010AC6FD
2 changed files with 15 additions and 1 deletions

View File

@ -767,6 +767,18 @@ class AIModerationCog(commands.Cog):
f"Server rules updated from {channel.mention}.", ephemeral=False
)
@config_subgroup.command(
name="reset_rules",
description="Reset server rules to the default hardcoded version.",
)
@app_commands.checks.has_permissions(administrator=True)
async def reset_rules(self, interaction: discord.Interaction) -> None:
"""Reset the server rules to the default string."""
aimod_config_module.SERVER_RULES = aimod_config_module.DEFAULT_SERVER_RULES
await interaction.response.send_message(
"Server rules have been reset to the default.", ephemeral=False
)
@infractions_subgroup.command(
name="view",
description="View a user's AI moderation infraction history (mod/admin only).",

View File

@ -119,7 +119,7 @@ async def add_user_infraction(
await save_user_infractions()
SERVER_RULES = """
DEFAULT_SERVER_RULES = """
# Server Rules
* **NSFW Content:**
@ -159,6 +159,8 @@ If you witness someone breaking these rules, please ping an `@Moderator` with de
Use the bot command `/modapp apply`
"""
SERVER_RULES = DEFAULT_SERVER_RULES
SUICIDAL_HELP_RESOURCES = """
Hey, I'm really concerned to hear you're feeling this way. Please know that you're not alone and there are people who want to support you.
Your well-being is important to us on this server.