This Discord bot allows users to stream audio from their PC to a Discord voice channel. It includes a web interface for managing user preferences and bot settings.
- Join and leave voice channels
- Stream system audio to Discord voice channels
- Web interface for managing users and preferences
- RESTful API for user management
- Python 3.8+
- FFmpeg
- Discord Bot Token
- (Optional) Virtual environment
-
Clone the repository:
git clone https://github.com/yourusername/discord-audio-bot.git cd discord-audio-bot
-
(Optional) Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install the required packages:
pip install -r requirements.txt
-
Install FFmpeg:
- On Windows: Download from https://ffmpeg.org/download.html and add it to your PATH.
- On macOS: Use Homebrew:
brew install ffmpeg
- On Linux: Use your package manager, e.g.,
sudo apt-get install ffmpeg
- Copy
config/config.example.json
toconfig/config.json
. - Edit
config/config.json
and fill in your Discord bot token and other settings.
-
Start the bot and web server:
python main.py
-
In Discord, invite the bot to your server and use the following commands:
!join
: Bot joins your current voice channel!leave
: Bot leaves the voice channel!stream [duration]
: Bot streams audio for the specified duration (default: 5 seconds)
-
Access the web interface at
http://localhost:5000
(or the host/port specified in your config).
discord_audio_bot/
│
├── config/
│ ├── config.json
│ └── config_schema.json
│
├── bot/
│ ├── __init__.py
│ ├── audio_handler.py
│ └── commands.py
│
├── web/
│ ├── __init__.py
│ ├── routes.py
│ └── templates/
│ └── index.html
│
├── database/
│ └── models.py
│
├── main.py
├── requirements.txt
└── README.md
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
This bot is for educational purposes only. Ensure you have the right to stream any audio content and that you comply with Discord's Terms of Service and API usage guidelines.