blob: 8d0b7435d45689acffbb2669486f71356fb39031 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
# Agent Instructions for Senator Sperma
## Required Setup
- Requires **Python 3.13** (3.14 not supported - py-cord incompatibility)
- System dependencies: `ffmpeg`, `zbar` library (installed system-wide)
- Bot token in `.env` file (copy from `.env.example`)
## Commands
- Run bot: `.venv/bin/python main.py`
- Type check: `.venv/bin/basedpyright`
- Test: `.venv/bin/pytest`
## Architecture
- Slash commands defined as cogs in `cogs/*.py`
- Discord API uses `discord.ApplicationContext`
- Music auto-complete queries copyparty server (`COPYPARTY_URL` config)
## Environment
- Copyparty URL for read-only access is COPYPARTY_URL
- Copyparty URL for write-only access is COPYPARTY_URL_UPLOAD
- Above should be accessed using COPYPARTY_PASSWORD as a cookie
- Channel for vclogs and alike is STATUS_CHANNEL_ID
- Trigger word for assistant is ASSISTANT_KEYWORD
## Testing
- Tests in `tests/cogs/test_*.py`
- Uses pytest-asyncio with `asyncio_default_fixture_loop_scope = function`
- `conftest.py` provides fixtures for mocking Discord objects
- **Slow integration tests** marked with `@pytest.mark.slow`
- Test real-world feature usage with longer execution times
- Includes: voice session tracking, cron job execution, music playback lifecycle, downloader flow, trigger responses
- Run only fast tests: `.venv/bin/pytest -m "not slow"`
- Run only slow tests: `.venv/bin/pytest -m slow`
|