Build a Slack bot that reads messages aloud with the Speechify API
Build a Slack bot that reads channel messages aloud with the Speechify API. Wire events, synthesize audio, and post the clip back to the channel.
A Slack bot that turns channel messages into audio. Members hear a message read naturally when they need it spoken, or drop the clip into a thread for offline listening. The runnable demo (demos/slack-bot-speechify) is a self-contained Node bot you can copy and run.
How does the bot work?
Flow:
- Slack sends an event when a message is posted.
- The bot receives it and pulls the message text.
- It calls
POST /v1/audio/speechto synthesize the audio. - It uploads the audio back to the channel or thread.
The demo uses Slack’s Socket Mode, so there is no public URL to expose. A socket-mode bot connects to Slack directly; event subscriptions arrive over the socket instead of a webhook.
How do I wire Slack events?
Create a Slack app and add the message event subscription. With Socket Mode, point the bot’s app token at your server and events flow over the socket. Using the classic Request URL instead? Verify the URL challenge Slack sends on setup, respond quickly on the challenge, then handle real events in the background.
How do I generate and post the audio?
Synthesize the message text to a file, then upload it to the channel with Slack’s files API. The runnable demo shows the full wiring, and it skips bot traffic so the bot never reads itself aloud.
How do I pick which messages to read?
Filter by channel or by a command, so the bot reads only what you ask it to. Reading every message is noise. Gate it behind a trigger.
FAQ
Does the bot need a server?
Yes, something has to receive Slack events and call the Speechify API. A small server or edge function works; Socket Mode means it does not need a public URL.
Which endpoint does it call?
POST /v1/audio/speech to generate the clip, then Slack’s file upload API to post it.
Can it stream instead?
Yes. Use POST /v1/audio/stream when you want playback to start before a long message finishes generating.