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.

Developer Relations · SpeechifyAI Labs
2 min read

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:

  1. Slack sends an event when a message is posted.
  2. The bot receives it and pulls the message text.
  3. It calls POST /v1/audio/speech to synthesize the audio.
  4. 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.

Privacy preferences

Choose what we may store on this device. You can change this at any time from the footer.

Strictly necessary

Sign-in, security, load balancing, and remembering your privacy choices. These cannot be switched off.

Always on

Analytics

How the site is used in aggregate - which pages get read, where people get stuck - so we can improve it.

Marketing

Measures which campaigns bring people here, and lets us show relevant ads on other platforms.