Expand and clarify the server rules within the `aimod.py` cog. This includes:
- Adding bullet points and sub-points for better readability.
- Providing more detailed explanations for rules like NSFW content and respectful conduct.
- Adding new rules regarding channel usage and gore.
- Including sections on reporting violations and moderator applications.
- Rename "Channel Age-Restricted" to "Channel Age-Restricted/NSFW" in AI prompts for better clarity on Discord's NSFW channel designation.
- Add a critical instruction to the AI prompt to strictly enforce JSON-only output, preventing extraneous text and ensuring reliable parsing.
This change introduces:
- `fetch_openrouter_key()` function to retrieve the key from
`OPENROUTER_KEY_FETCH_URL`.
- A new `MOD_LOG_API_SECRET` environment variable for authorization
with the key fetching service.
- Integration into `ModerationCog.cog_load()` to fetch the key
dynamically when the cog loads.
This approach enhances API key management and security by centralizing
key distribution.
- Reorganizes application commands across cogs into logical groups and subgroups for improved usability and maintainability.
- Introduces a local Hugging Face Transformer model (Gemma 2B IT) to provide context-aware emoji suggestions, enhancing bot interaction.
- Converts remaining hybrid commands to pure application commands.
- Updates global command disable check registration and includes minor UI and error handling improvements.
Incorporates replied-to messages and recent channel history into the AI analysis prompt.
This provides the model with greater conversational context, improving its ability to differentiate banter and jokes from actual rule violations.
Integrate channel category and age-restricted status into the AI moderation prompt.
This allows the AI to consider whether a channel is officially marked as NSFW by Discord settings when evaluating content against NSFW rules, leading to more accurate and context-aware moderation.
Splits the generic `modset` command into type-safe subcommands under a `modset_group` for improved usability and discoverability.
Introduces loading of AI model names from `data/openrouter_models.json` to provide dynamic autocomplete suggestions for the `modsetmodel` command.
Removes the `setup_hook` as commands are now registered automatically.