discord-tts

July 7, 2026 ยท View on GitHub

A Discord bot providing Text-to-Speech (TTS) in voice channels using Pocket-TTS for fast, CPU based inference.

Features

  • No GPU needed!
  • Voice cloning!
  • Use Django's built-in admin pages to manage voices!
  • Automatic TTS for muted users (if configured with message intent)!

Running the Bot

Linux/WSL

Docker Compose

  • Make sure docker is installed
  • Use the docker-compose.prod.yml file as a guide to deploy it.
  • If you cloned the repository, use docker-compose.local.yml to build and deploy it.

Local/Development

  • Make sure docker and uv is installed
  • Use the regular docker-compose.yml for Redis.
  • uv sync
  • make migrate
  • make dev

Windows

Download WSL2, then follow the instructions above.

Voice Cloning

  • You must log into HuggingFace and accept the agreement in the model page. Then, provide HF_TOKEN as an environment variable.
  • Add new voices by logging into the admin panel and using that to upload audio files.
  • By default, Django's admin will be on /admin on port 8000. If the DJANGO_SUPERUSER_USERNAME and DJANGO_SUPERUSER_PASSWORD env variables are filled in, then it will automatically create an admin user of those types.

Dependency & Environment Setup

  • Python 3.14+ required
  • Install dependencies using uv:
    uv sync
    
  • Install ffmpeg (see ffmpeg download page)
  • Copy the .env.example to the .env file and fill in the information.

Bot Commands

  • /join - Join the voice channel you are in and bind to the current text channel
  • /leave - Leave the current voice channel
  • /say - Make the bot speak text (optional: specify a voice)
  • /multi - Open a modal to play multiple voicelines with different voices
  • /stop - Stop current playback and clear the queue for the channel
  • /skip - Skip the current or next message in the queue
  • /settings - Adjust your personal preferences
  • /voice - Change your selected voice

Format for multi command:

<voice_name>: <text>
alba: Hello everyone! How are you doing?
marius: I'm doing good!

Web UI

There's a web ui in Django, hosted in / if you run the default server. It's a really simple UI that will allow you to play text outside of Discord. Note that it doesn't have any authentication nor authorization, so do not expose it to the open web!!!

Contributing

Contributions welcome! Please:

  • Suggest new features
  • Submit bug reports and pull requests
  • Help extend functionality

Open an issue or PR on GitHub to get involved.