128 lines
2.9 KiB
Markdown
128 lines
2.9 KiB
Markdown
# HOI4 ELO Discord Bot
|
|
|
|
Ein Discord Bot für Hearts of Iron IV, der über Coolify deployed werden kann.
|
|
|
|
## Features
|
|
|
|
- **Basic Commands**: Ping, Info, Server-Informationen
|
|
- **HOI4 Theme**: Speziell für Hearts of Iron IV Communities
|
|
- **Docker Support**: Bereit für Deployment über Coolify
|
|
- **Error Handling**: Robuste Fehlerbehandlung
|
|
- **Logging**: Ausführliche Logs für Debugging
|
|
|
|
## Verfügbare Befehle
|
|
|
|
- `!ping` - Zeigt die Bot-Latenz an
|
|
- `!info` - Zeigt Bot-Informationen an
|
|
- `!help_hoi4` - Zeigt alle verfügbaren Befehle an
|
|
- `!server_info` - Zeigt Informationen über den aktuellen Server
|
|
|
|
## Setup für Coolify
|
|
|
|
### 1. Discord Bot erstellen
|
|
|
|
1. Gehe zu https://discord.com/developers/applications
|
|
2. Erstelle eine neue Application
|
|
3. Gehe zu "Bot" und erstelle einen Bot
|
|
4. Kopiere den Bot Token
|
|
|
|
### 2. Bot Permissions
|
|
|
|
Der Bot benötigt folgende Permissions:
|
|
- `Send Messages`
|
|
- `Read Message History`
|
|
- `Use Slash Commands`
|
|
- `Embed Links`
|
|
- `Read Messages/View Channels`
|
|
|
|
### 3. Coolify Deployment
|
|
|
|
1. **Repository**: Verbinde dein Git Repository mit Coolify
|
|
2. **Umgebungsvariablen**: Setze folgende Variable in Coolify:
|
|
- `DISCORD_TOKEN` = Dein Bot Token
|
|
|
|
3. **Build Settings**:
|
|
- Coolify wird automatisch das Dockerfile verwenden
|
|
- Port: Der Bot läuft als Service, kein HTTP-Port erforderlich
|
|
|
|
4. **Deploy**: Starte das Deployment
|
|
|
|
## Lokale Entwicklung
|
|
|
|
### Voraussetzungen
|
|
- Python 3.10+
|
|
- pip
|
|
|
|
### Installation
|
|
|
|
1. Repository klonen
|
|
2. Dependencies installieren:
|
|
```bash
|
|
pip install -r requirements.txt
|
|
```
|
|
|
|
3. `.env` Datei erstellen:
|
|
```bash
|
|
cp .env.example .env
|
|
```
|
|
|
|
4. Discord Token in `.env` eintragen:
|
|
```
|
|
DISCORD_TOKEN=your_actual_bot_token_here
|
|
```
|
|
|
|
5. Bot starten:
|
|
```bash
|
|
python app.py
|
|
```
|
|
|
|
## Docker
|
|
|
|
### Lokal mit Docker testen
|
|
|
|
```bash
|
|
# Image bauen
|
|
docker build -t hoi4-elo-bot .
|
|
|
|
# Container starten
|
|
docker run -e DISCORD_TOKEN=your_token_here hoi4-elo-bot
|
|
```
|
|
|
|
## Projekt Struktur
|
|
|
|
```
|
|
.
|
|
├── app.py # Haupt-Bot-Datei
|
|
├── requirements.txt # Python Dependencies
|
|
├── Dockerfile # Docker Konfiguration
|
|
├── .env.example # Beispiel Umgebungsvariablen
|
|
└── README.md # Diese Datei
|
|
```
|
|
|
|
## Erweiterungen
|
|
|
|
Der Bot ist so strukturiert, dass du einfach weitere Commands hinzufügen kannst:
|
|
|
|
```python
|
|
@bot.command(name='my_command')
|
|
async def my_command(ctx):
|
|
await ctx.send("Hello World!")
|
|
```
|
|
|
|
## Troubleshooting
|
|
|
|
### Bot startet nicht
|
|
- Überprüfe ob der Discord Token korrekt gesetzt ist
|
|
- Schaue in die Logs: `docker logs <container_name>`
|
|
|
|
### Bot reagiert nicht auf Befehle
|
|
- Stelle sicher, dass der Bot die richtigen Permissions hat
|
|
- Überprüfe ob Message Content Intent aktiviert ist
|
|
|
|
### Coolify Logs anschauen
|
|
- Gehe zu deinem Coolify Service
|
|
- Klicke auf "Logs" um die Bot-Ausgabe zu sehen
|
|
|
|
## Support
|
|
|
|
Bei Problemen schaue in die Coolify Logs oder überprüfe die Discord Developer Console für weitere Informationen. |