Skip to main content

Translation

The Translation module integrates the DeepL API for translating text messages and Groq Whisper for transcribing voice messages. It works through the context menu (right-click on a message).

Enabling the Module

  1. Dashboard → Your server → toggle Translation
  2. Click Edit and enter the DeepL API key
  3. Optionally: enter the Groq API key (for audio transcription)
  4. Save changes
API Key Required

The Translation module requires a DeepL API key to function. Without it, translation will not be possible. Keys are encrypted (Fernet) before being saved to the database.

Get a free key at: https://www.deepl.com/pro-api

Configuration

API keys are stored at the guild config level (not in cog_settings):

OptionTypeDescription
deepl_api_key_encryptedstringEncrypted DeepL API key
groq_api_key_encryptedstringEncrypted Groq API key (optional)

Dashboard

The edit panel contains:

  • DeepL API Key — password field (masked)
  • Groq API Key — password field (optional, for audio transcription)
  • Key status information (configured / missing)

Context Menus

After enabling the module, the message context menu (right-click → Apps) shows:

Translate Message

Translates the message text to the user's preferred language.

Flow:

  1. Extracts text from the message (content + embed title/description/fields/footer)
  2. Checks user's language preferences
  3. If no preference — displays a modal asking for language selection
  4. Translates via DeepL API
  5. Displays the translation ephemerally

Transcribe & Translate

Transcribes a voice/audio message and translates the transcription.

Flow:

  1. Looks for an audio attachment in the message
  2. Checks size (max 25 MB)
  3. Checks user's language preferences
  4. Transcribes via Groq Whisper API
  5. Translates the transcription via DeepL API
  6. Displays both (original + translation) in an ephemeral embed
Supported Audio Formats

.ogg, .mp3, .wav, .m4a, .flac, .webm, .mp4 and any files with content-type audio/* or video/* (voice messages).

Commands

/setlang

Sets the user's preferred translation language (global, cross-server).

Displays a dropdown menu with pagination (25 languages per page) — after selection, saves the preference to the database.

/languages

Displays a list of all supported DeepL languages (ephemeral).

Supported Languages

DeepL supports 31 target languages:

CodeLanguage
BGBulgarian
CSCzech
DADanish
DEGerman
ELGreek
EN-GBEnglish (British)
EN-USEnglish (American)
ESSpanish
ETEstonian
FIFinnish
FRFrench
HUHungarian
IDIndonesian
ITItalian
JAJapanese
KOKorean
LTLithuanian
LVLatvian
NBNorwegian
NLDutch
PLPolish
PT-BRPortuguese (Brazilian)
PT-PTPortuguese (European)
RORomanian
RURussian
SKSlovak
SLSlovenian
SVSwedish
TRTurkish
UKUkrainian
ZHChinese (simplified)

Language Preferences

Target language resolution order:

  1. translator_lang in the user_language_prefs table (set via /setlang)
  2. User's interface language (from LanguageManager)
  3. Modal asking for manual selection

The preference is global — once set, it works on all servers with ArcBot.

Limits

LimitValue
Text to translate5000 characters
Audio file25 MB
API key cache30 minutes
API timeout30s (DeepL), 120s (Groq)

Error Handling

HTTP CodeAction
403Invalid API key — cache invalidated
456DeepL limit exhausted — user notified
OtherGeneric "API error" message

Listened Events

The module does not listen to events — it works exclusively through context menus and slash commands.

Tips

Best practices
  • Use /setlang once — the bot will remember your language permanently
  • DeepL Free allows 500,000 characters/month — sufficient for most servers
  • Groq API is optional — without it, "Transcribe & Translate" won't be available
  • DeepL API keys ending with :fx are free keys
Privacy

Translations are displayed ephemerally (visible only to the user). Message content is sent to the DeepL/Groq API for processing.