A simple Text-To-Speech (TTS) bot for Discord. It allows members to use commands or type in a specific channel to make the bot speak the given text in a voice channel.
- Join Voice Channel: The bot can join a voice channel.
- Leave Voice Channel: The bot can leave a voice channel.
- Speak: The bot can convert text to speech and speak it in a voice channel.
- Mention Replacement: Converts user mentions in the text to actual usernames.
- Auto-Response in TTS Channel: If a user sends a message in a channel named "tts", the bot automatically converts the text to speech and speaks it in the user's voice channel.
- Automatic Join: If a user types in the "tts" channel, the bot will auto-join the user's voice channel (if it's not already in one) and begin speaking.
-
Clone the repository:
git clone https://github.com/Ashesh3/discord-tts-bot
-
Navigate to the project directory:
cd discord-tts-bot
-
Install the required dependencies:
npm install
-
Update the
BOT_TOKEN
in the code with your Discord bot token. -
Run the bot:
node index.js
- /join - Makes the bot join your current voice channel.
- /leave - Makes the bot leave the current voice channel.
- /say [text] - Converts the provided text to speech and plays it in the voice channel.
Alternatively, you can type your message in a channel named tts
without any command to make the bot speak that message.
- The bot needs permission to join voice channels.
- Make sure to grant the bot the required permissions when inviting it to your server.
- This bot is set to use Hindi (
hi
) voice with an Indian (co.in
) accent. You can change this by modifying the respective parameters in thetts.synthesize
method.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Happy Coding! 🚀