idkfelix / TTS-Bot

Python Discord TTS (text-to-speech) bot that uses the ElevenLabs AI API to generate high-quality speech from text messages
1 stars 0 forks source link
ai discord-bot elevenlabs
 

TTS Bot

 

A Dockerised Python TTS Discord Bot Using Elevenlabs AI

  Docker Badge   Python Badge   Discord Badge

Description

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.

Features

Requirements

Docker Setup

  1. Clone this repository to your local machine
  2. Create a 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.

  1. Build the Docker image using the following command:

    docker build -t tts-bot .
  2. 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.

Local Setup

  1. Clone this repository to your local machine
  2. Create a 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.

  1. Install the requirements.txt with pypi using the following command:
pip install --no-cache-dir -r requirements.txt
  1. run the TTS-Bot.py file with python using the following command:
python TTS-Bot.py

Usage

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>"