A Discord bot that can transcribe and translate Discord Voice Messages.
- Uses the DeepL API for translation and Google's Speech Recognition API for transcription.
- Python 3.8+
- discord.py
- pydub
- speech recognition
- deepl
Run the following:
pip install -r requirements.txt
Note Bot requires Intents to be enabled in the developer portal & an API key for the DeepL API.
- Clone the repository:
git clone https://github.com/dromzeh/vmt.git
- Rename the
config.example.json
file toconfig.json
insidesrc/config
and fill in the necessary values (See Configuration)
Once the configuration file has been filled, you may run the bot using one of the following methods:
- Install the requirements
pip install -r requirements.txt
- Run the bot inside the
/src
folder:python main.py
Assuming docker
and docker-compose
are installed
docker-compose -f compose.yaml up
- To use the bot, simply reply to a voice message with the
transcribe
command. The bot will transcribe the voice message and post the transcription as a reply, if you don't reply, the bot will find the most recent voice message in the channel and transcribe it instead. - If you want to automatically translate the text, you can just add the language code as an argument, such as :
vmt transcribe es
for Spanish, full list is available atvmt languages
or here. - The bot will then automatically translate the text using the DeepL API.
The config.json file contains the following fields:
discord_token
: Your Discord bot token.deepl_api_key
: Your DeepL API key.language_codes
: A dictionary of language codes and their corresponding language names.
Click to expand
"language_codes": {
"BG": "Bulgarian",
"CS": "Czech",
"DA": "Danish",
"DE": "German",
"EL": "Greek",
"EN-GB": "English (British)",
"EN-US": "English (American)",
"ES": "Spanish",
"ET": "Estonian",
"FI": "Finnish",
"FR": "French",
"HU": "Hungarian",
"ID": "Indonesian",
"IT": "Italian",
"JA": "Japanese",
"KO": "Korean",
"LT": "Lithuanian",
"LV": "Latvian",
"NB": "Norwegian (Bokmål)",
"NL": "Dutch",
"PL": "Polish",
"PT-BR": "Portuguese (Brazilian)",
"PT-PT": "Portuguese",
"RO": "Romanian",
"RU": "Russian",
"SK": "Slovak",
"SL": "Slovenian",
"SV": "Swedish",
"TR": "Turkish",
"UK": "Ukrainian",
"ZH": "Chinese (simplified)"
}
This project is licensed under the MIT License - see the LICENSE file for details.