A Discord bot that reads text messages in voice chat channels and converts them to speech using Google's free Text-to-Speech service.
- Converts text messages to Mutilang speech in real-time
- Automatically joins the same voice channel as the message author
- Completely free - no API key required
- Simple command system
- Node.js (v16.9.0 or higher)
- A Discord account and a Discord bot token
- Clone or download this repository
- Install dependencies:
npm install - Configure your environment variables:
- Rename
.env.exampleto.env - Add your Discord bot token
- Rename
- Go to the Discord Developer Portal
- Create a new application
- Go to the "Bot" tab and click "Add Bot"
- Click "Reset Token" and copy your token
- Enable the following Privileged Gateway Intents:
- MESSAGE CONTENT INTENT
- GUILD MEMBERS INTENT
- SERVER MEMBERS INTENT
- Go to the Discord Developer Portal
- Select your application
- Go to the "OAuth2" tab
- In the "OAuth2 URL Generator", select the following scopes:
botapplications.commands
- Select the following bot permissions:
- Send Messages
- Connect
- Speak
- Read Message History
- Copy the generated URL and open it in your browser
- Select the server where you want to add the bot and authorize
-
Start the bot:
node index.js -
Use the following commands in your Discord server:
!join- Makes the bot join your voice channel!leave- Makes the bot leave the voice channel!help- Shows all available commands
-
Just type messages in any text channel while being in a voice channel, and the bot will read them aloud in Vietnamese.
- Google Translate TTS has a limit of 200 characters per request
- Only standard Vietnamese voice is available
- Internet connection is required for the bot to function
This project is licensed under the MIT License - see the LICENSE file for details.