This is a Python Discord TTS (text-to-speech) bot that uses the ElevenLabs AI API to generate high-quality speech from text messages sent in a Discord server. The bot is containerized using Docker for easy deployment and management.
config.yaml
file in the root directory of the project, containing the following information:discord_bot_token: <yourToken>
eleven_key: <yourKey>
eleven_voiceID: <yourVoiceID>
Replace <yourToken>
with your Discord bot token, <yourKey>
with your ElevenLabs API key and <yourVoiceID>
with your selected voice model ID which can be found using the Elevenlabs API.
Build the Docker image using the following command:
docker build -t tts-bot .
Run the Docker container and mount your config file using the following command:
docker run -d tts-bot -v </path/to/config.yaml>:/config.yaml
Replace </path/to/config.yaml>
with the path to your local config.yaml file.
config.yaml
file in the root directory of the project, containing the following information:discord_bot_token: <yourToken>
eleven_key: <yourKey>
eleven_voiceID: <yourVoiceID>
Replace <yourToken>
with your Discord bot token, <yourKey>
with your ElevenLabs API key and <yourVoiceID>
with your selected voice model ID which can be found using the Elevenlabs API.
pip install --no-cache-dir -r requirements.txt
python TTS-Bot.py
Once the bot is up and running in your Discord server, simply type a message in any channel and the bot will respond with the text-to-speech version of your message.
You can also use the !tts
command to force the bot to read a specific message, like this:
!tts "<your message here>"