765 Commits

Author SHA1 Message Date
1a6330537f
feat: Implement command usage tracking
Introduces a new `command_usage_counters` table to track how many times specific commands are used between two users.

- Adds `_ensure_usage_table_exists` to create the table if it doesn't exist.
- Implements `_increment_usage_counter` to update or insert usage counts.
- Adds `_get_usage_count` to retrieve usage counts.
- Integrates usage tracking into the `molest` command (both slash and legacy).
- Adds logging for database operations related to usage tracking.
2025-05-26 21:45:30 -06:00
8eb52a925b
feat: Enhance guild command preparation to support custom groups and improve type handling 2025-05-26 16:29:37 -06:00
b7321f9bed
fix: Await asynchronous command creation in GuildCommandSyncer 2025-05-26 16:26:58 -06:00
d89645ca28
Refactor: Store group customizations as objects
Changes the `group_customizations` data structure to store a dictionary containing `name` and `description` for each group, rather than just the custom name. This aligns with how command customizations are stored and prepares for future additions like custom group descriptions.

Updates the dashboard UI and settings cog to correctly display the new group customization format, while maintaining backward compatibility for existing data.
2025-05-26 16:23:47 -06:00
0008327bd0
feat: Add command to list available command groups for debugging 2025-05-26 16:18:49 -06:00
92c07a8430
fix: Ignore DM messages and reactions in leveling system for guilds only 2025-05-26 15:49:43 -06:00
2609c6ea8b
feat: Enhance custom bot management with improved cleanup and resource handling 2025-05-26 15:45:44 -06:00
f6e70a85c0
feat: Provide default values for required fields in user settings during global settings update 2025-05-26 15:37:15 -06:00
0571033ca2
fix: Update error message for owner-only command to include link to web dashboard 2025-05-26 15:31:13 -06:00
cab07d09db
feat: Refactor utility exports for improved accessibility in the dashboard 2025-05-26 15:28:59 -06:00
cfb768cc33
feat: Initialize custom bot from dashboard and add DOM utilities
- Move `initCustomBot` call from `DOMContentLoaded` listener in `custom-bot.js` to `initDashboard` in `utils.js`.
- Ensure `initCustomBot` is called only after user authentication is checked and dashboard elements are ready.
- Add `show`, `hide`, and `toggle` utility functions to the `DOM` object in `utils.js` for managing element visibility.
2025-05-26 15:25:55 -06:00
c61ccd5ca4
feat: Add endpoint to retrieve authenticated user information and enhance global settings model 2025-05-26 15:22:12 -06:00
0677b7e168
feat: Implement custom bot configuration dashboard
This commit introduces a new custom bot configuration dashboard, providing a streamlined interface for managing bot settings.

Key changes include:
- **UI/UX Enhancements:**
    - Added new CSS for a modern, responsive dashboard layout, including header, navigation, and form styling.
    - Implemented a dynamic bot status indicator (online/offline).
    - Improved form validation and user feedback mechanisms.
- **Frontend Logic:**
    - Refactored `custom-bot.js` to handle loading, saving, and validating bot settings.
    - Integrated `showFeedback` utility for consistent user notifications.
    - Updated API calls to use `fetch` for better control and error handling.
- **HTML Structure:**
    - Modified `index.html` to incorporate the new dashboard layout and elements.
- **Utility Functions:**
    - Added `showFeedback` function in `utils.js` for displaying success/error messages.

This feature significantly improves the user experience for configuring custom bots.
2025-05-26 15:19:26 -06:00
d09a0897c6
feat: add OwnerUtilsCog with DM command for owner-only messaging and enhanced error handling 2025-05-26 15:05:15 -06:00
195b95d575
feat: implement owner check for slash_change_avatar command and improve error handling 2025-05-26 14:52:35 -06:00
61b433360c
feat: update change_avatar command to restrict usage to bot owner only and enhance error messages 2025-05-26 14:43:03 -06:00
1b0fdb86ca
feat: update instruction for character responses to use lowercase text style 2025-05-26 13:58:46 -06:00
5c0ea71b69
fix: clarify instruction on username usage in TetoCog's character prompt 2025-05-26 13:56:32 -06:00
9af3a9eb42
Refactor: Enhance Ame-chan's character prompt for TetoCog
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.
2025-05-26 13:54:58 -06:00
pancakes-proxy
1b48d2eb6e feat: update character persona for TetoCog to reflect Ame-chan's traits and behaviors 2025-05-26 07:56:51 -04:00
632a876d6c
feat: add DictionaryCog for word definition and dictionary lookup commands 2025-05-25 23:02:24 -06:00
62c752a569
feat: implement web search functionality using Tavily API and add related commands 2025-05-23 16:08:53 -06:00
d04d2649a9
feat: add more diverse kiss and hug messages for enhanced user interaction 2025-05-23 15:38:32 -06:00
31e7321f74
fix: improve user lookup in marriage commands to work in DMs
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
2025-05-22 21:24:29 -06:00
1b7e96f2a5
refactor: Update marriage logic to use fetch_user for better compatibility in guild and DM contexts 2025-05-22 21:21:53 -06:00
7309767ecb
refactor: Update marriage cog to use discord.User instead of discord.Member for user parameters 2025-05-22 21:08:28 -06:00
bb0a6e5734
refactor: Clarify system prompt for Teto AI regarding user message context and username usage 2025-05-22 21:07:17 -06:00
97e4de1383
refactor: Enhance dashboard initialization and error handling to fix white screen issue and improve user experience 2025-05-21 18:37:54 -06:00
2e6136caec
refactor: Improve custom bot management by adding import error handling and updating bot initialization logic 2025-05-21 18:20:33 -06:00
77973d5573
refactor: Enhance database connection handling by prioritizing API server's pool and adding error handling 2025-05-21 18:16:39 -06:00
172f5907b3
feat: Implement custom bot management dashboard
- 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.
2025-05-21 18:11:17 -06:00
0c2e599f77
refactor: Implement fallback mechanisms for guild retrieval and improve error handling in dashboard API 2025-05-21 17:29:03 -06:00
1be8ed88f9
refactor: Improve DM sending process in receive_number_data by using background tasks and adding REST API fallback 2025-05-21 17:12:35 -06:00
1d10cc4c40
fix: Simplify error logging in receive_number_data by removing traceback details 2025-05-21 17:10:48 -06:00
3dbed19952
Fix: Enhance error logging in receive_number_data with traceback details 2025-05-21 17:09:07 -06:00
e34013ec96
feat: Add backward compatibility aliases for NumberData fields and improve Discord message handling 2025-05-21 17:05:33 -06:00
69b53811ad
Refactor: Use API helper for Discord DM sending in receive_number_data
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.
2025-05-21 17:01:44 -06:00
3dc3a2d9ae
refactor: Replace multiprocessing with threading for API and markdown servers to avoid conflicts 2025-05-21 16:59:15 -06:00
5ea3ef1e45
feat: Add /card API endpoint and static file serving
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.
2025-05-21 16:45:20 -06:00
15f51108dd
Fix: Escape CSS curly braces in HTML templates
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.
2025-05-21 13:38:48 -06:00
0386b9f4ff
feat: Add markdown server for legal documents
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.
2025-05-21 13:34:16 -06:00
d98a69769b
Use correct endpoint for file processing status checks
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.
2025-05-21 12:34:54 -06:00
59a228f7b4
feat: Refactor Teto image fetching and response handling for improved error management and interaction support 2025-05-21 12:27:39 -06:00
92e4deda5f
feat: Include file extension in upload URLs
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.
2025-05-21 12:25:09 -06:00
47353d7c8b
feat: Poll for file processing status after upload
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.
2025-05-21 12:23:49 -06:00
6ac3a6d5bc
Fix: Correct file URL generation for uploaded files
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.
2025-05-21 12:02:28 -06:00
bcc42664d0
fix: Update API base URL by removing trailing segment for correct endpoint usage 2025-05-21 11:59:23 -06:00
c6ad3aeae0
fix: Update API base URL and improve request logging in UploadCog 2025-05-21 11:54:31 -06:00
bfd0d606ab
feat: Add timeout and interaction control to captcha modal
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.
2025-05-21 11:50:19 -06:00
04c2dd75b9
Refactor: Simplify captcha interaction and API logic
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.
2025-05-21 11:46:26 -06:00