Skip to content

Simple Discord Text-to-Speech Bot for Voice Channel. This is a mirror of my personal repo, but issues and PRs on here also accepted.

License

Notifications You must be signed in to change notification settings

AnthonyKwon/chattybot

Repository files navigation

💬 Chatty: Simple Discord Text-to-Speech Bot

Chatty is a simple, open-source Text-to-Speech (TTS) bot for Discord, designed to bring your server's voice channels to life. Built with Node.js, it's configurable and easy to set up.

✨ Features

  • High-Quality TTS: Utilizes Google Cloud Text-to-Speech for natural-sounding voices.
  • Multi-language Support: Configurable to work with different languages.
  • Easy to Use: Simple commands to join/leave voice channels and manage the bot.
  • Configurable: Customize the bot's behavior, TTS voice, and more through simple JSON configuration files.

📋 Requirements

  • Node.js version 22.12.0 or higher
  • Build Tools for sodium
    • Windows user can install dependencies by this command:

      npm install --global --production --add-python-to-path windows-build-tools
    • macOS/Linux needs packages below:

      • make
      • gcc with C++ support
      • libtool

🚀 Installation

  1. Clone the repository

    git clone https://github.com/AnthonyKwon/chattybot.git -b 4.0.0
    cd chattybot
  2. Install dependencies

    npm install
  3. Configure the bot

    Please refer Configuration section to do it.

  4. Build the application

    npm run build
  5. Register slash commands

    npm run register

⚙️ Configuration

Chatty is configured through three files in the configs/ directory:

  • general.json: For general bot settings, such as your Discord bot token and default locale.
  • tts.json: For Text-to-Speech settings, like voice gender, speed, and pitch.
  • gcp-credentials.json: Your Google Cloud Platform credentials file.

Please refer CONFIGURATION.md for more details.

▶️ Usage

Authentication

You can authenticate with Google Cloud TTS in two ways:

  1. Workload Identity Federation (Recommended): Set the GOOGLE_APPLICATION_CREDENTIALS environment variable to the path of your credentials file:

    export GOOGLE_APPLICATION_CREDENTIALS=/path/to/your/credentials
  2. Service Account Keys: Place your service account key file in the configs/ directory and name it gcp-credentials.json.

Running the Bot

There are two ways to run Chatty:

  • Production Mode (Recommended for most cases):

    npm start

    This will start the bot with minimal console logging.

  • Development Mode:

    You have to register command as development mode first, with:

    npm run registerDev

    Then you can start as development mode with command below.

    npm run dev

    This will start the bot in development mode, with more verbose logging.

We also have systemd unit file and docker image for automation.

🙌 Contributing

Pull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.

📜 License

This project is licensed under the GNU General Public License, version 2.

About

Simple Discord Text-to-Speech Bot for Voice Channel. This is a mirror of my personal repo, but issues and PRs on here also accepted.

Topics

Resources

License

Stars

Watchers

Forks