From 7dccc7ee4adfef53b74cd1c5cc84611d1e83e5cb Mon Sep 17 00:00:00 2001 From: Codex Date: Sat, 7 Jun 2025 01:17:10 +0000 Subject: [PATCH] Add reset_rules command and default rules constant --- cogs/aimod_cog.py | 12 ++++++++++++ cogs/aimod_config.py | 4 +++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/cogs/aimod_cog.py b/cogs/aimod_cog.py index df22242..e6bd2d3 100644 --- a/cogs/aimod_cog.py +++ b/cogs/aimod_cog.py @@ -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).", diff --git a/cogs/aimod_config.py b/cogs/aimod_config.py index c701157..cec8df5 100644 --- a/cogs/aimod_config.py +++ b/cogs/aimod_config.py @@ -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.