2.0 KiB
2.0 KiB
Custom Instructions for GitHub Copilot
Project Overview
This is a Python project named ANewDawn. It uses Docker for containerization (Dockerfile, docker-compose.yml). Key files include main.py and settings.py.
Development Environment
- Operating System: Windows
- Default Shell: PowerShell (
pwsh.exe). Please generate terminal commands compatible with PowerShell.
Coding Standards
- Linting & Formatting: We use
rufffor linting and formatting. Adhere toruffstandards. Configuration is in.github/workflows/ruff.ymland possiblypyproject.tomlorruff.toml. - Python Version: 3.13
- Dependencies: Managed using
uvand listed inpyproject.toml. Commands include:uv run pytestfor testing.uv add <package_name>for package installation.uv sync --upgradefor dependency updates.uv run python main.pyto run the project.
General Guidelines
- Follow Python best practices.
- Write clear, concise code.
- Add comments only for complex logic.
- Ensure compatibility with the Docker environment.
- Use
uvcommands for package management and scripts. - Use
dockeranddocker-composefor container tasks:- Build:
docker build -t <image_name> . - Run:
docker run <image_name>ordocker-compose up. - Stop/Remove:
docker stop <container_id>anddocker rm <container_id>.
- Build:
Discord Bot Functionality
- Chat Interaction: Responds to messages containing "lovibot" or its mention (
<@345000831499894795>) using the OpenAI chat API (gpt-4o-mini). Seeon_messageevent handler andmisc.chatfunction. - Slash Commands:
/ask <text>: Directly ask the AI a question. Usesmisc.chat.
- Context Menu Commands:
Enhance Image: Right-click on a message with an image to enhance it using OpenCV methods (enhance_image1,enhance_image2,enhance_image3).
- User Restrictions: Interaction is limited to users listed in
misc.get_allowed_users(). Image creation has additional restrictions.