A powerful Discord bot that automatically translates messages and provides real-time voice captions!
- Language Detection: Currently checks for Arabic and Korean characters (may be modified to detect more in the future)
- Multiple Translation Backends: Choose from 3 different translation services
- Interactive Backend Selection: Switch translation providers on-the-fly with dropdown menus
- Live Speech-to-Text: Transcribes voice chat conversations in real-time
- Multi-User Support: Shows who's speaking with usernames/nicknames
- Powered by Groq: Uses whisper-large-v3 for transcription and translation
- Channel Management: Use
/listenand/ignorecommands to control where translations happen - Backend Customization: Set default translation backend or switch per-message
- Resource Efficient: Written in Go for minimal resource usage
AI-Powered (Prompted):
- Cerebras
- Mistral
- ArliAI (currently disabled in code due to unreliable uptime)
Direct API:
- TranslateAPI
- MyMemory
For API key setup, refer to each service's documentation.
/listen- Start translating messages in the current channel/ignore- Stop translating messages in the current channel
/backend [name]- Switch default translation backend/backend(no args) - Show current backend
/captions on- Start real-time captions in your voice channel/captions off- Stop captions and leave voice channel
- Go 1.22+: Install Go
- C/C++ Build Tools: Required for TEN-VAD and Opus decoding (CGO).
- Ubuntu/Debian:
sudo apt-get install gcc build-essential libopus-dev libc++-dev libc++abi-dev
- Ubuntu/Debian:
- Discord Bot Token: Create at Discord Developer Portal
- API Keys: Get keys for your preferred translation services
-
Clone this repository
-
Build the bot:
go build ./cmd/bot
-
Create
config.json(copy fromconfig.example.json) and add your keys:{ "discord_token": "YOUR_DISCORD_BOT_TOKEN", "translate_api_key": "YOUR_TRANSLATEAPI_KEY", "cerebras_api_key": "YOUR_CEREBRAS_API_KEY", "cerebras_model": "gpt-oss-120b", "mistral_api_key": "YOUR_MISTRAL_API_KEY", "mistral_model": "mistral-large-latest", "groq_api_key": "YOUR_GROQ_API_KEY", "mymemory_email": "YOUR_EMAIL@example.com", "backend": "TranslateAPI", "target_channels": [] }
Replace YOUR_CLIENT_ID with your bot's Application ID:
https://discord.com/api/oauth2/authorize?client_id=YOUR_CLIENT_ID&permissions=536873984&scope=bot
Required Permissions:
- Manage Webhooks
- View Channels
- Send Messages
Start the bot:
./bot -config config.json- Invite the bot to your server
- Use
/listenin any channel to enable translations - Arabic and Korean messages will be automatically translated to English
- Use the dropdown menu on translated messages to try different backends
- For voice chats, use
/captions onin the voice channel chat to enable live transcription
Each translated message includes a dropdown menu to instantly re-translate using different backends - perfect for comparing translation quality!
The bot only processes Arabic and Korean messages, saving API costs by skipping English and other languages.
Captions show speaker names, support multiple users, and maintain conversation history for context.
Run locally:
go run ./cmd/bot/main.go- Voice captions require
captions_enabled: truein config - Translation backends can be configured in
config.json - Channel preferences persist between bot restarts
- Language detection can be modified to support additional languages
Built with Go and DiscordGo | GitHub