Real-time AI voice chat in Discord voice channels. Talk to an AI assistant like a phone call.
[中文] Discord 语音频道 AI 实时语音对话机器人,像打电话一样和 AI 聊天。
User speaks → Discord PCM audio → Silence detection → Whisper STT
↓
LLM generates reply
↓
Play audio ← FFmpeg decode ← Edge-TTS synthesis ← AI text reply
- 🎤 Real-time Voice Chat — Speak naturally in Discord voice channels
- 🧠 LLM-powered Responses — Uses any OpenAI-compatible API
- 🗣️ Whisper STT — Local speech-to-text with OpenAI Whisper
- 🔊 Edge-TTS — High-quality text-to-speech with Microsoft Edge voices
- 🔇 Silence Detection — Automatically detects when you stop talking
- Python 3.10+
- FFmpeg installed
- A separate Discord Bot Token (cannot share with other bots)
# Install dependencies
pip install -r requirements.txt
# Configure
cp .env.example .env
# Edit .env with your bot token and API keys
# Run
python bot.py- Go to Discord Developer Portal
- Create New Application
- Go to Bot → Copy Token, enable Message Content Intent
- OAuth2 → URL Generator: Scopes:
bot, Permissions:Connect,Speak,Use Voice Activity,Send Messages - Invite bot to your server with the generated URL
- Language: Python
- STT: OpenAI Whisper (local)
- TTS: edge-tts (Microsoft Edge voices)
- LLM: Any OpenAI-compatible API
- Audio: FFmpeg, discord.py voice
| Variable | Description |
|---|---|
DISCORD_TOKEN |
Bot token (dedicated, not shared) |
GUILD_ID |
Discord server ID |
AI_BASE_URL |
OpenAI-compatible API endpoint |
AI_API_KEY |
API key for LLM |
AI_MODEL |
Model name |
WHISPER_MODEL |
Whisper model size (tiny/base/small/medium/large) |
TTS_VOICE |
Edge-TTS voice name |
SYSTEM_PROMPT |
AI personality prompt |
PRs welcome! Please test with a real Discord voice channel before submitting.