Skip to main content

Translation

Message translation using DeepL and audio transcription using Groq Whisper. The cog provides slash commands and context menus (right-click on a message).

Required API Keys

This cog requires a DeepL API key configured in the dashboard. Audio transcription additionally requires a Groq API key. Keys are encrypted (Fernet) and stored per-guild.

Context Menus

Translate Message

Translates message text to the user's preferred language.

How to use: Right-click on a message → Apps → Translate Message

Behavior:

  1. Extracts text from the message (content + embed title/description/fields/footer)
  2. Checks the user's language preference
  3. If no preference → displays a modal with a language code field
  4. Translates via DeepL API
  5. Returns the translation as an ephemeral message

Limits: Max 5000 characters of text to translate
Errors:

  • Message has no text to translate
  • Missing DeepL API key
  • Invalid key (HTTP 403)
  • API limit exceeded (HTTP 456)
  • Timeout / network error

Transcribe & Translate

Transcribes an audio attachment and translates the transcription.

How to use: Right-click on a message with an audio attachment → Apps → Transcribe & Translate

Behavior:

  1. Finds the first audio/video attachment in the message
  2. Checks the user's language preference
  3. If no preference → modal with language code
  4. Downloads the audio file
  5. Sends to Groq Whisper API → transcription
  6. Translates transcription via DeepL → result
  7. Returns embed with two fields: original transcription + translation

Supported formats: .ogg, .mp3, .wav, .m4a, .flac, .webm, .mp4
Size limit: 25 MB
Errors:

  • No audio attachment
  • File too large (>25 MB)
  • Missing Groq API key
  • Transcription or translation error

Slash Commands

/setlang

Sets the preferred translation language (saved globally, works on all servers).

ParameterTypeRequiredDescription
(none)Displays language selection menu

Permissions: Everyone

Example: /setlang → select language from dropdown

Behavior:

  1. Displays dropdown with language list (paginated, max 25 per page)
  2. ◀/▶ buttons for navigating between pages
  3. After selection → saves preference in user_language_prefs database
  4. Edits original message with confirmation

Success: "Language set to: [name] ([code])"


/languages

Displays a list of all supported translation languages.

ParameterTypeRequiredDescription
(none)

Permissions: Everyone

Example: /languages

Success: Ephemeral embed with a list of ~30 languages in format `CODE` — Name


Supported Languages

CodeLanguageCodeLanguage
BGBulgarianLTLithuanian
CSCzechLVLatvian
DADanishNBNorwegian
DEGermanNLDutch
ELGreekPLPolish
EN-GBEnglish (British)PT-BRPortuguese (BR)
EN-USEnglish (American)PT-PTPortuguese (EU)
ESSpanishRORomanian
ETEstonianRURussian
FIFinnishSKSlovak
FRFrenchSLSlovenian
HUHungarianSVSwedish
IDIndonesianTRTurkish
ITItalianUKUkrainian
JAJapaneseZHChinese
KOKorean

Configuration

The cog requires API keys configured in the dashboard:

KeyDescriptionRequired
deepl_api_keyDeepL key (Free or Pro)Yes
groq_api_keyGroq key (for Whisper)Only for transcription
Free vs Pro Keys

The bot automatically detects the DeepL key type:

  • Keys ending with :fx → Free API (api-free.deepl.com)
  • Others → Pro API (api.deepl.com)
Key Cache

The decrypted DeepL key is cached for 30 minutes in bot memory to avoid repeated decryption.