aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
blob: 8e71dbec70c48345580340818669012e761bee6e (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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# 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
- `/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)