Discord text-to-speech bot using OpenAI TTS
- Features
- Requirements
- Setup
- Usage
- Development
- Testing
- Troubleshooting
- Security
- Configuration
- Operations
- Commands
- Events
- Intents and permissions
- Support
- Links
- License
ttsbot reads messages from one linked Discord text channel and speaks them in a voice channel with OpenAI text-to-speech.
Use Node.js 26 or later. Create a Discord application. Request an OpenAI API key. Enable the Message Content privileged intent.
Copy .env.example to .env. Set the required credentials. Install dependencies with npm ci. Run npm start.
Invite the bot with the bot and applications.commands scopes. Use /join from a voice channel to link it to the current text channel.
Read the user guide for setup, configuration, commands, and operation. Read release notes for version history.
Read AGENTS.md before changing repository files. Find user documents in docs/README.md. Read maintained rules in specs/README.md.
Run npm test for aggregate validation. Run npm run lint, npm run audit, or npm run format:check for focused checks.
Check the user guide troubleshooting section for configuration, Discord, audio, and health problems.
Keep DISCORD_TOKEN and OPENAI_API_KEY out of Git. The health server has no authentication.
Direct Node startup listens on loopback. Docker listens inside its container. Map published host ports to loopback. Use network rules to control wider access.
Set DISCORD_CLIENT_ID, DISCORD_TOKEN, and OPENAI_API_KEY before startup. The user guide lists all environment variables, defaults, and valid ranges.
Build the container with docker build -t ttsbot:local ..
Read the Docker instructions and systemd instructions.
The GHCR package is public, so anyone can pull its version tags. The workflow builds for its runner's default architecture and publishes after validation. Publication does not deploy. Record the image digest before deployment.
Use /help, /join, /leave, /voice, /skip, and /stop.
Read command descriptions for behavior and options.
The bot handles Discord client readiness, slash command interactions, and server messages. It ignores bot messages and messages outside the linked text channel.
Enable the Guilds, Guild Messages, Message Content, and Guild Voice States intents. Grant View Channels and Send Messages in the text channel. Grant Connect and Speak in the voice channel.
For help, questions, or to chat with the author and community, visit:


