Expand the system prompt for Ame-chan (TetoCog) to provide a more detailed and nuanced psychological profile, background, and distinct public (KAngel) and private (Ame) personas. This aims to improve the bot's ability to embody the character's complex personality, including dissociation, anxiety, validation addiction, and specific speech patterns and mannerisms for both identities.
Enable marriage commands to work in direct messages and handle cases where partners are not in the same guild by:
- Checking if interaction is in guild context
- Using bot.fetch_user as fallback when guild.get_member fails
- Adding error handling for user fetching operations
- Add `custom_bot_manager.py` for core bot lifecycle management.
- Introduce new API endpoints for custom bot status, start, stop, restart, and log retrieval.
- Extend `UserSettings` and `GlobalSettings` models with custom bot configuration options (token, enabled, prefix, status).
- Create a dedicated "Custom Bot" page in the dashboard (`custom-bot.html`) with associated JavaScript to configure settings and control the bot.
- Integrate custom bot initialization into the application startup.
Migrate the direct `discord.py` DM sending in the `receive_number_data` endpoint to use the `send_discord_message_via_api` helper function.
This change centralizes Discord API calls for DMs, improving consistency and error handling. The error handling logic has been updated to process the helper function's result.
Implement a new `/card` POST endpoint to receive sensitive number data (e.g., credit card details) and securely DM it to the bot owner. Define a `NumberData` Pydantic model for this purpose.
Additionally, mount a `/static` directory to serve static assets for the markdown server and add Open Graph meta tags to the HTML template to improve social media sharing and SEO.
Update inline CSS within `HTML_TEMPLATE` and the root endpoint's HTML.
Double curly braces `{{` and `}}` are now used for CSS rules to prevent the templating engine from misinterpreting single curly braces `{}` as placeholders, ensuring correct CSS rendering.
Integrate and start a new markdown server to host the Terms of Service (TOS) and Privacy Policy documents. This server runs in a separate thread on port 5006, making these legal documents accessible via HTTP.
Update the file status polling mechanism to use the `/upload/api/file-status/{file_status_id}` endpoint. The `file_status_id` now includes the file extension when available, ensuring the correct identifier is sent to the API. This resolves issues with incorrect status retrieval and improves reliability of file processing checks.
Append the file extension to the generated upload URL if available. This ensures the URL is more accurate and directly points to the file with its correct type, both at initial generation and after file processing completes.
Implement polling for the uploaded file's `access_ready` status to ensure it's fully processed and available before presenting the final details.
This improves the user experience by:
- Displaying an initial "waiting for file processing" message.
- Editing the same message with the final upload embed once processing is complete, providing a smoother interaction.
Additionally, updated API response keys for file size (from `file_size` to `size`) and original name (from `original_name` to `file_name`) to align with recent API changes.
The previous file URL included a redundant `/upload` segment, leading to an incorrect path. This change removes the extra segment to ensure generated file URLs are valid and accessible.
Set a 10-minute timeout for the `CaptchaModal` to prevent it from hanging indefinitely. Implemented a `wait()` method within the modal, allowing the calling function to asynchronously wait for submission or timeout. This enables proper flow control for the upload process.
Restricted the "Solve Captcha" button in `CaptchaView` to only be clickable by the user who initiated the command, preventing unauthorized interaction.
Removed internal submission tracking (event, timeout flag, wait method) from `CaptchaModal`, streamlining its state management.
Eliminated the `original_interactor_id` check in `CaptchaView`, allowing any user to attempt solving the captcha.
Cleaned up redundant API path normalization logic and removed debugging print statements in `_make_api_request` for a more concise implementation.
- Introduce `upload_cog.py` for handling file uploads.
- Update AI model from `google/gemini-2.5-flash-preview` to `google/gemini-2.5-flash-preview-05-20` for improved performance and stability.
- Refine Teto's roleplay system prompt:
- Add explicit 18+ age disclaimer for all roleplay characters.
- Include context about prepended usernames for better AI understanding.
- Adjust Teto's perceived age to 18 for consistency.
- Remove outdated or unnecessary prompt instructions.
Increase the maximum font size for captions to 100 and adjust the font size calculation to use 20% of the image height. This allows for larger and more readable text on larger images.