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: Optionally 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
/translateto turn translations on or off per channel - Backend Customization: Set config defaults for new channels and override backend/dropdown settings per channel
- 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.
/translate- Show this channel's translation status and defaults/translate enabled:on- Enable translations in the current channel using saved or config-default settings/translate enabled:on backend:TranslateAPI interaction_selection:off- Enable or update this channel with a specific backend and dropdown preference/translate enabled:off- Disable translations in the current channel while keeping its saved settings
/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", "interaction_select_enabled": true, "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
/translate enabled:onin any channel to enable translations - Arabic and Korean messages will be automatically translated to English
- If the channel has interaction selection enabled, 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 can include a dropdown menu to instantly re-translate using different backends. Set interaction_select_enabled in config for new channels, or override it per channel with /translate.
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 backendandinteraction_select_enabledinconfig.jsonact as defaults for newly enabled channels- Channel preferences persist between bot restarts
- Language detection can be modified to support additional languages
Built with Go and DiscordGo | GitHub