Giter Club home page Giter Club logo

discord-tts-bot's Introduction

Discord TTS Bot

This is a simple TTS Bot that uses the Google Translate TTS API. With this bot you can send Text-to-Speech messages in multiple languages.

Requirements

To self-host this bot you'll need the following:

ffmpeg should be installed by default on Linux and MacOS, in case it isn't, install it with your package manager. For Windows users, head over to ffmpeg's official website to download the binary which will need to be added to your $PATH. If you don't know how to add folders to your $PATH, check out this guide.

Installation

In order to self-host this bot, first you'll need to clone this repository.

git clone https://github.com/moonstar-x/discord-tts-bot.git

Then, inside the config folder, rename the file settings.json.example to settings.json and edit the file with your own Discord Token and the prefix you wish to use. If you don't have a discord token yet, you can see a guide on how to create it here. Your file should look like this.

{
  "discord_token": "YOUR_DISCORD_TOKEN",
  "prefix": "$",
  "allow_more_than_200_chars": "yes"
}

The allow_more_than_200_chars property lets you choose wether you want TTS messages longer than 200 characters to be played (default: yes).

Install the dependencies:

npm install

You can now run your bot:

npm start

Deploying to Heroku

To deploy to Heroku, you can click on the image below and login to your account.

Deploy

You can now go back to your app's Overview, make sure you disable the web dyno and enable the bot dyno. Your bot should now be up and running. Remember you can always check your bot's console if you access the View Logs in the More dropdown menu.

Usage

Here's a list of all the commands for the bot:

Command Description
$say <message> Send a TTS message in your voice channel.
$aeiou <message> Send an aeiou (similar to Moonbase Alpha) TTS message in your voice channel.
$stop Stop the TTS bot and leave the channel.
$lang <lang_code> Change the TTS language.
$langs Display a list of the supported languages.
$speed <number> Change the TTS spoken speed (must be between 1% and 100%).
$help Display a help message with all the available commands.

Up until now, these settings are saved in memory, which means if the bot crashes/restarts, all of these settings will go back to default (Language: English, Speed: 100%).

Language Support

Here's a list of all the supported languages:

Language Code Language Name
af Afrikaans
hy Armenian
id Indonesian
bn Bengali
ca Catalan
cs Czech
da Danish
de German
en English
es Spanish
fil Filipino
fr French
hr Croatian
is Icelandic
it Italian
jv Javanese
km Khmer
lv Latvian
hu Hungarian
ml Malayalam
mr Marathi
nl Dutch
ne Nepali
nb Norwegian
pl Polish
pt Portuguese
ro Romanian
si Sinhala
sk Slovak
su Sundanese
sw Swahili
fi Finnish
sv Swedish
ta Tamil
te Telugu
vi Vietnamese
tr Turkish
el Greek
ru Russian
sr Serbian
uk Ukranian
ar Arabic
hi Hindi
th Thai
ko Korean
cmn Chinese
ja Japanese

Add this bot to your server

You can add this bot to your server by clicking the image below:

Invite this bot to your server

Author

This bot was made by moonstar-x.

discord-tts-bot's People

Contributors

moonstar-x avatar pcjax avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.