Skip to content

Cassxbt/Roma-trans-bot

Repository files navigation

Roma

Multi-platform AI translation bot for Discord and Telegram. Parallel output to 10 languages, OpenAI Whisper voice transcription, and automatic provider fallback across DeepL, Azure, and LibreTranslate.

License: MIT Python Platform

Overview

Roma orchestrates multiple translation providers with intelligent fallback logic, serving both Discord and Telegram from a unified Python backend. A single natural language command routes through DeepL for quality, falls back through Azure Translator and LibreTranslate if needed, and returns parallel translations for up to 10 target languages simultaneously. Voice messages are transcribed in real time via Whisper before entering the same pipeline.

Features

  • 100+ languages — parallel translation to up to 10 target languages in a single command
  • Multi-provider fallback — DeepL (primary) → Azure Translator → LibreTranslate with automatic retry
  • Voice pipeline — OpenAI Whisper transcribes audio messages before routing through translation
  • Natural language commands!translate hello to Spanish French German parses without strict syntax
  • Smart caching — instant responses on repeated translations and transcriptions
  • Dual platform — single codebase serving both Discord and Telegram

Architecture

graph TD
    A[Discord / Telegram] --> B[Bot Layer]
    B --> C[ROMA Orchestrator]
    C --> D{Provider Selection}
    D --> E[DeepL]
    D --> F[Azure Translator]
    D --> G[LibreTranslate]
    E & F & G --> H[Translation Response]
    I[Voice Message] --> J[Whisper ASR]
    J --> C
Loading

Tech Stack

Component Technology
Runtime Python 3.12+
Framework ROMA (Sentient)
Discord discord.py
Telegram python-telegram-bot
Translation DeepL · Azure Translator · LibreTranslate
Voice OpenAI Whisper
REST API FastAPI + uvicorn
Frontend React + TypeScript

Quickstart

Prerequisites: Python 3.12+, API keys for at least one translation provider and one platform bot token.

git clone https://github.com/cassxbt/Roma-trans-bot
cd Roma-trans-bot
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env
# Fill in your keys, then:
python run_discord_bot.py   # or run_telegram_bot.py

Configuration

Variable Description Required
DEEPL_API_KEY DeepL translation API key Yes (primary provider)
AZURE_TRANSLATOR_KEY Azure Cognitive Services key No (fallback)
LIBRE_TRANSLATE_URL LibreTranslate instance URL No (fallback)
DISCORD_TOKEN Discord bot application token Discord only
TELEGRAM_TOKEN Telegram bot API token Telegram only
OPENAI_API_KEY OpenAI key for Whisper ASR Voice features only

Usage

Discord

!translate hello to Spanish French German

Telegram — search @Transent_bot

/translate hello to Spanish French German

Voice — send a voice message to any supported channel. Roma transcribes it automatically and returns the translation.

Parallel output example:

Input:  "hello"
ES:     "hola"
FR:     "bonjour"
DE:     "hallo"

Contributing

Pull requests are welcome. For major changes, open an issue first. Run pytest before submitting.

License

MIT

About

Multi-platform AI translation agent for Discord and Telegram. 100+ languages, OpenAI Whisper voice input, provider fallback.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors