# Senator Sperma A Discord bot with music playback, TTS, web search, and utility commands. Requires Python 3.13 (py-cord doesn't support 3.14 yet). ## Setup ### 1. Clone & Create Virtual Environment ```bash git clone https://codeberg.org/salmonik/senator-sperma cd senator-sperma python -m venv .venv source .venv/bin/activate # Linux/macOS # or .venv\Scripts\activate # Windows ``` ### 2. Install Dependencies ```bash pip install -r requirements.txt ``` You also need `ffmpeg` and `zbar` library and installed system-wide ### 3. Create .env File Create a `.env` file in the project root: ```bash cp .env.example .env ``` Edit `.env` with your credentials: ```env # Required TOKEN=your_discord_bot_token # Optional - Bot Configuration STATUS_CHANNEL_ID=123456789012345678 # Channel for startup message ASSISTANT_KEYWORD=jarvis # Keyword to trigger AI assistant # Optional - File Server (for music /search commands) COPYPARTY_URL=http://localhost:8080 COPYPARTY_PASSWORD=your_password # Optional - AI commands OPENROUTER_API_KEY= ``` ### 6. Run the Bot ```bash python main.py ``` ## Configuration All settings are optional - defaults are provided if not set. | Variable | Description | Default | |---------|-------------|---------| | `TOKEN` | Discord bot token | (required) | | `STATUS_CHANNEL_ID` | Channel for startup message | none | | `ASSISTANT_KEYWORD` | Keyword to trigger AI assistant | `jarvis` | | `COPYPARTY_URL` | File server base URL | `http://localhost:8080` | | `COPYPARTY_PASSWORD` | File server password | none | | `OPENROUTER_API_KEY` | AI API key (for /senator command) | none | ## Commands ### Music - `/play` - Play music from file server or an internet audio stream - `/stop` - Stop playback - `/join` - Join voice channel - `/loop` - Loop current track ### Utility - `/search` - Search files on server - `/web` - DuckDuckGo search - `/download` - Download video/audio - `/tts` - Text to speech - `/qr_koduj` / `qr_dekoduj` - QR encode/decode - `/funkcja` - Math plot - `/kompresja` - Compress images - `/konwersja` - Convert audio/video ## Dependencies - `ffmpeg` - System-wide audio processing - `py-cord` - Discord library (due to instable nature of discord's voice features, py-cord has to be installed directly from git)