Initial commit
This commit is contained in:
commit
1e174a0789
24 files changed
+5499
No files matched your search
@@ -0,0 +1,137 @@
|
||||
# Echoion Music Bot
|
||||
|
||||
A modern music bot for TeamSpeak 3, featuring YouTube integration, playlist support, and hot-reload capabilities.
|
||||
|
||||
## Features
|
||||
|
||||
- 🎵 **YouTube Integration** - Play music directly from YouTube URLs or search queries
|
||||
- 📋 **Playlist Support** - Queue management with shuffle, repeat, and skip functionality
|
||||
- 🎧 **High Quality Audio** - Supports up to 48kHz stereo audio
|
||||
- 🔄 **Hot Reload** - Update the bot without disconnecting from the server
|
||||
- ⚙️ **Configurable** - JSON-based configuration system
|
||||
- 🔊 **TeamSpeak Native** - Uses TeamSpeak's native audio system for best quality
|
||||
|
||||
## Building
|
||||
|
||||
### Requirements
|
||||
|
||||
- C++26 compatible compiler (GCC 15+, Clang 18+, or MSVC 2022+)
|
||||
- CMake 3.28+
|
||||
- Qt6 (for desktop client)
|
||||
- FFmpeg (for audio decoding)
|
||||
- Glaze library (JSON parsing)
|
||||
- TeamSpeak 3 Client SDK
|
||||
|
||||
### Build Instructions
|
||||
|
||||
```bash
|
||||
mkdir build && cd build
|
||||
cmake ..
|
||||
cmake --build .
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
Copy `config.example.json` to your config directory:
|
||||
|
||||
- **Linux**: `~/.config/echoion/config.json`
|
||||
- **Windows**: `%APPDATA%\echoion\config.json`
|
||||
- **macOS**: `~/Library/Application Support/echoion/config.json`
|
||||
|
||||
Edit the configuration file with your server details:
|
||||
|
||||
```json
|
||||
{
|
||||
"server": {
|
||||
"address": "your.server.com",
|
||||
"port": 9987,
|
||||
"nickname": "MusicBot",
|
||||
"serverPassword": ""
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Installation
|
||||
|
||||
### TeamSpeak Plugin
|
||||
|
||||
1. Build the project
|
||||
2. Copy the plugin to your TeamSpeak plugins folder:
|
||||
- **Linux**: `~/.ts3client/plugins/`
|
||||
- **Windows**: `%APPDATA%\TS3Client\plugins\`
|
||||
3. Enable the plugin in TeamSpeak's plugins menu
|
||||
|
||||
## Commands
|
||||
|
||||
All commands use the configured prefix (default: `!`)
|
||||
|
||||
| Command | Description | Example |
|
||||
|---------|-------------|---------|
|
||||
| `!play <query>` | Play a song or add to queue | `!play never gonna give you up` |
|
||||
| `!pause` | Pause playback | `!pause` |
|
||||
| `!resume` | Resume playback | `!resume` |
|
||||
| `!stop` | Stop playback | `!stop` |
|
||||
| `!skip` | Skip current track | `!skip` |
|
||||
| `!queue` | Show current queue | `!queue` |
|
||||
| `!clear` | Clear the queue | `!clear` |
|
||||
| `!shuffle` | Toggle shuffle mode | `!shuffle` |
|
||||
| `!repeat` | Toggle repeat mode | `!repeat` |
|
||||
| `!volume <0-100>` | Set volume | `!volume 50` |
|
||||
| `!nowplaying` | Show current track | `!nowplaying` |
|
||||
| `!search <query>` | Search YouTube | `!search daft punk` |
|
||||
|
||||
## Architecture
|
||||
|
||||
The bot consists of three main components:
|
||||
|
||||
1. **EchoionApi** - Shared interfaces and types
|
||||
2. **EchoionCore** - Core music playback logic (hot-reloadable)
|
||||
3. **EchoionPlugin** - TeamSpeak plugin wrapper
|
||||
|
||||
### Audio Flow
|
||||
|
||||
```
|
||||
YouTube URL → NetworkClient → AudioDecoder → MusicManager → Core → PluginInterface → TeamSpeak
|
||||
```
|
||||
|
||||
Audio is decoded using FFmpeg, processed at 48kHz stereo, and sent to TeamSpeak's custom audio device.
|
||||
|
||||
## Development
|
||||
|
||||
### Hot Reload
|
||||
|
||||
The core library can be hot-reloaded without disconnecting from the server:
|
||||
|
||||
1. Build the new core: `cmake --build . --target EchoionCore`
|
||||
2. Use the "Reload Core" menu item or send plugin command `reload`
|
||||
|
||||
### Adding Commands
|
||||
|
||||
To add a new command:
|
||||
|
||||
1. Create a new command class in `EchoionCore/src/commands/`
|
||||
2. Inherit from `CommandBase`
|
||||
3. Register in `CommandManager::initialize()`
|
||||
|
||||
Example:
|
||||
|
||||
```cpp
|
||||
class MyCommand : public CommandBase {
|
||||
public:
|
||||
MyCommand() : CommandBase("mycommand", "Description") {}
|
||||
|
||||
Api::Result<std::string> execute(uint64_t clientId, const std::vector<std::string>& args) override {
|
||||
return "Hello, World!";
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
MIT License - See LICENSE file for details
|
||||
|
||||
## Credits
|
||||
|
||||
- TeamSpeak Systems GmbH for the TeamSpeak SDK
|
||||
- FFmpeg team for audio decoding
|
||||
- Glaze library for JSON handling
|
||||
Reference in new issue
Block a user