Skip to main content
Build a Telegram bot that turns pasted text or attached documents into a verbatim reading, spoken summary, or two-voice podcast. OpenClaw handles the assistant workflow and Rime generates the voice note. The samples compare the same podcast-style reading through the custom Rime skill and OpenClaw’s default TTS: The custom skill also presents a selectable Rime voice menu before generating audio.

Prerequisites

To follow this guide, you need:

Step 1: Create a Telegram bot and connect it to OpenClaw

This guide uses Telegram as the interface to OpenClaw. You can adapt it to another messaging service. First, create a new bot using Telegram’s BotFather:
  1. Open Telegram and search for @BotFather.
  2. Send /newbot and follow the prompts to choose a name and username.
  3. BotFather replies with your bot token, which looks like 123456789:ABCdefGHIjklMNOpqrsTUVwxyz.
Add the bot token to ~/.openclaw/.env:
Then enable the Telegram plugin in the ~/.openclaw/openclaw.json file:
Restart the gateway to pick up the new token:
Verify the basic text chat functionality by messaging your bot in Telegram. The first time you message the bot, it shows an access not configured message with an access code. Copy the access code and run the following command in your terminal to pair the bot with OpenClaw:

Step 2: Add your Rime API key

OpenClaw reads environment variables from the ~/.openclaw/.env file. Add your Rime API key to it:

Step 3: Disable OpenClaw’s built-in TTS

OpenClaw has a built-in TTS system that the assistant uses by default. Disable it so OpenClaw uses the Rime skill you add in Step 4 instead. Update your openclaw.json file as follows:
This configuration:
  1. Turns off auto-TTS so the built-in pipeline doesn’t generate audio automatically
  2. Disables Edge TTS so it can’t be used as a fallback
  3. Denies the built-in tts tool so the LLM can’t call it directly

Step 4: Install the rime-reader skill

The rime-reader skill reads documents aloud in three modes:
  • In verbatim mode, it reads the document aloud, word for word, in your chosen voice.
  • In summary mode, it summarizes the document’s content in your chosen voice.
  • In podcast mode, two AI hosts, each with a different voice, summarize and discuss the content.
Install the rime-reader skill by cloning it from the following repository into your ~/.openclaw/skills/ directory:
The skill folder contains a single Python script (rime.py) that handles all three modes and a SKILL.md that teaches the LLM how to use it.

How rime.py works

The script has three modes, driven by the following command-line arguments:
  • A file path for document reading
  • --text for a single utterance
  • --segments for podcast
All three arguments share the same synthesis and encoding pipeline.

Chunking

In verbatim and summary mode, rime.py breaks long text into sentence-aligned chunks of roughly 400 characters so that no single API call is too large.

Synthesis

The script then sends the chunks to the Rime API, which synthesizes them and returns raw audio bytes.

Stitching

The script concatenates the bytes from each chunk into a single bytearray and generates silence between the chunks. You can specify a voice for each segment in podcast mode:

Encoding

Then, rime.py encodes the bytearray by making an ffmpeg call that converts the raw audio buffer to OGG Opus, the format that Telegram expects:
The script prints the output .ogg path to stdout. The LLM reads this and uses it in a MEDIA: directive with [[audio_as_voice]] to deliver it as a Telegram voice note bubble.

Step 5: Register the skill and configure the personality

Enable the skill in ~/.openclaw/openclaw.json:

Personality (SOUL.md)

The ~/.openclaw/workspace/SOUL.md file configures OpenClaw’s agent personality. The LLM reads the file at the start of every session. Add the Document Reading section below to your SOUL.md file. Without it, the bot skips the rime-reader skill and generates audio using whichever TTS model it finds first. Since you disabled the default TTS model in Step 3, it would fail to generate any audio and fall back to replying in text.

Step 6: Test the flow

Restart the gateway before testing the document reading flow:
  1. In Telegram, start a fresh session by sending /new to your bot.
  2. Send a document or paste text in the chat and ask the bot to read it.
  3. The bot asks you to choose a delivery mode: verbatim, summary, or podcast. Choose verbatim.
  4. The bot prompts you to pick a voice.
  5. After you pick a voice, the bot returns a voice note of your text.

Tuning

SOUL.md drives the bot’s behavior. Edit the file directly, or tell the bot in your Telegram chat to update it for you.

Voice

Set a default voice for your assistant by editing SOUL.md, or by sending the bot a Telegram message: “Use Transom next time.” You can use any Coda voice: atrium, lyra, transom, parapet, fern, thalassa, truss, sirius, eliphas, lintel, or one of the many others listed on Rime’s Voices page.

Podcast personality

The LLM writes the podcast script before synthesizing it, so you can steer the tone. Try adding a line such as the following to the Document Reading section of your SOUL.md:
Alternatively, skip editing SOUL.md entirely and tell the bot: “Make the podcast hosts argue like an old married couple.” The LLM will adapt the script on the fly.

Skip the prompts

If you always want the same voice and delivery mode, you can hardcode them in SOUL.md to skip the bot prompts. For example, you could replace the first two steps with the following instruction:
Since OpenClaw loads SOUL.md afresh every session, your changes take effect immediately after you send /new in Telegram.