Skip to content

Akryst/Textalk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Textalk

Discord TTS bot powered by Amazon Polly.

Requirements

  • Node.js 18+
  • AWS account with Polly access
  • Discord bot token

Note: An AWS account is required to use this bot. If you find a way to use TTS without AWS, or want to add support for another provider, feel free to open an Issue.

Setup

git clone https://github.com/Akryst/Textalk
cd Textalk
npm install
cp .env.example .env
# Fill in your credentials in .env
node deploy-commands.js
npm start

.env

DISCORD_TOKEN=your_discord_bot_token
CLIENT_ID=your_discord_application_client_id

AWS_REGION=us-east-1
AWS_ACCESS_KEY_ID=your_aws_access_key
AWS_SECRET_ACCESS_KEY=your_aws_secret_key

Commands

Command Permission Description
/set-channel Manage Guild Sets the current channel as the TTS channel. Every message sent here will be read aloud when the author is in a voice channel.
/set-channel action:Disable TTS Manage Guild Disables TTS for the server.
/voices Everyone Lists all available Amazon Polly voices.
/voices set:<voice-id> Everyone Sets the server voice (e.g. /voices set:Joanna).

Available Voices

ID Language Gender
Joanna English (US) Female
Matthew English (US) Male
Amy English (UK) Female
Brian English (UK) Male
Lupe Spanish (US) Female
Pedro Spanish (US) Male
Lucia Spanish (ES) Female
Enrique Spanish (ES) Male
Mia Spanish (MX) Female

How it works

  1. Admin runs /set-channel in a text channel
  2. Users join a voice channel
  3. Users send messages in the configured channel
  4. Bot joins the voice channel and reads the message aloud via Amazon Polly
  5. Bot disconnects automatically after 5 minutes of inactivity

Project structure

index.js              entry point
deploy-commands.js    register slash commands with Discord
config/config.js      all configuration and voice list
commands/
  set-channel.js
  voices.js
events/
  ready.js
  interactionCreate.js
  messageCreate.js
utils/
  tts.js              Amazon Polly synthesis
  audio.js            voice connection, queue, inactivity timer
  database.js         guild settings persisted to data/guild_settings.json

AWS IAM setup

  1. Go to IAM → Users → Create user
  2. Attach policy: AmazonPollyFullAccess
  3. Security credentials → Create access key → Application outside AWS
  4. Copy the Access key ID and Secret access key to your .env

License

MIT

About

A Text-to-Speech bot for Discord

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors