Built a Talking News Bot with ElevenLabs and Telegram in 30 Minutes

Tanisha SharmaTanisha Sharma
4 min read

Have you ever found yourself scrolling through news articles and thinking,

“I wish someone could read this article out loud to me while I cook or drive.”

I did too.

So I designed a bot that fetches the hottest news, converts it into audio using ElevenLabs, and delivers it straight into your Telegram inbox — much like a news anchor, but cooler.

I created this blog that teaches you step-by-step how I made News-to-Voice Bot, from idea to implementation — and you can build one too.


🧠 The Idea: Why Build This?

The thought process was simple — to enable the daily reading of news through voice automation.

As AI voice tools like ElevenLabs now offer hyper-realistic text-to-speech and platforms like Telegram make delivery frictionless via bots, I wanted to combine these two:

  • ✅ Fetch top news stories from an RSS feed

  • 🎙️ Convert them into audio using ElevenLabs API

  • 📬 Send the audio file to your Telegram

You get an on-demand podcast of global headlines. Every. Single. Day.


⚙️ Stack Overview

We’ll use Python to orchestrate everything:

  • 📰 feedparser – for reading RSS feeds

  • 🎧 ElevenLabs API – converts text to human-like voice

  • 📬 Telegram Bot API – delivers voice to your phone


🛠️ Setting Up: What You Need

Before diving into the code, here’s what you’ll need:

🔑 API Keys

  • ElevenLabs:
    Create a free account at elevenlabs.io and get your API key from the dashboard.

  • Telegram Bot:

    1. Search for @BotFather on Telegram

    2. Create a new bot and save the bot token

    3. Open a chat with your bot and send a message

    4. Visit https://api.telegram.org/bot<YOUR_BOT_TOKEN>/getUpdates to get your chat_id


🧪 .env Configuration

In your project folder, create a .env file and add the following:

ELEVENLABS_API_KEY=your_elevenlabs_key
TELEGRAM_BOT_TOKEN=your_telegram_bot_token
TELEGRAM_CHAT_ID=your_telegram_chat_id
VOICE_ID=your_voice_id

You’re now ready to build.


🧩 Step 1: Fetch Top News Stories

We use an RSS feed to get the top stories via feedparser. This could be NYTimes, BBC, or anything else.

🔍 Code Snippet

def get_top_news(rss_url, max_items=3):
    feed = feedparser.parse(rss_url)
    if not feed.entries:
        raise ValueError("No news items found in RSS feed.")

    top_items = feed.entries[:max_items]
    news_text = "\n\n".join(
        [f"Headline: {item.title}\nSummary: {item.summary}" for item in top_items]
    )
    return news_text

This gives us a nicely formatted string like:

Headline: Wildfires Rage in Canada
Summary: Record blaze, thousands evacuated as wildfires raged across Greece.

Headline: AI Regulation Debate Intensifies
Summary: Lawmakers worldwide are now...

🔊 Step 2: Convert News to Audio (TTS)

We’ll use ElevenLabs’ Text-to-Speech API to convert the news to a .mp3 file.

🧠 Why ElevenLabs?

We could’ve opted for gTTS or Google’s Cloud TTS — but ElevenLabs sounds way more realistic.

🎙️ Code Snippet

def text_to_speech_elevenlabs(text, voice_id, api_key, output_file="output.mp3"):
    url = f"https://api.elevenlabs.io/v1/text-to-speech/{voice_id}"
    headers = {
        "Accept": "audio/mpeg",
        "Content-Type": "application/json",
        "xi-api-key": api_key
    }
    payload = {
        "text": text,
        "model_id": "eleven_monolingual_v1",
        "voice_settings": {
            "stability": 0.5,
            "similarity_boost": 0.75
        }
    }
    response = requests.post(url, json=payload, headers=headers)

    if response.status_code == 200:
        with open(output_file, "wb") as f:
            f.write(response.content)
        return output_file
    else:
        raise RuntimeError(f"TTS Error: {response.status_code} - {response.text}")

This produces a clean .mp3 audio file that sounds like an actual news anchor.


📲 Step 3: Deliver It to Telegram

After generating the audio, we send it to Telegram using the Bot API.

📤 Code Snippet

def send_audio_to_telegram(bot_token, chat_id, audio_path):
    url = f"https://api.telegram.org/bot{bot_token}/sendAudio"
    with open(audio_path, "rb") as audio_file:
        files = {"audio": audio_file}
        data = {"chat_id": chat_id, "caption": "🗞️ Here’s your audio news update!"}
        response = requests.post(url, data=data, files=files)

    if response.status_code != 200:
        raise RuntimeError(f"Telegram send failed: {response.status_code} - {response.text}")

Just like that — your Telegram bot delivers audio news, right into your inbox.


🔁 Wrapping It All Together

The main() function ties all parts together:

def main():
    try:
        print("📡 Fetching news...")
        news = get_top_news(RSS_FEED_URL)

        print("🎙️ Converting to speech...")
        audio_path = text_to_speech_elevenlabs(news, VOICE_ID, ELEVENLABS_API_KEY)

        print("📨 Sending to Telegram...")
        send_audio_to_telegram(TELEGRAM_BOT_TOKEN, TELEGRAM_CHAT_ID, audio_path)

        print("✅ All done!")

    except Exception as e:
        print(f"❌ Error: {e}")

🧪 Testing It

You can run the script using:

python news_bot.py

You’ll now receive a voice-based news update — every time you run it.


💡 Ideas to Extend

  • ⏰ Set up a daily cron job using GitHub Actions or AWS Lambda

  • 🗣️ Add voice selection with more ElevenLabs options

  • 📰 Customize to pull news from tech blogs or subreddits

  • 🎧 Embed audio on a personal site using Telegram’s widget


📦 Repo & Source Code

You can find the complete code here:
👉 https://github.com/tanisha-byte/newsbot
Feel free to fork, remix, and make it your own.


🚀 Final Thoughts

We’re entering an era where bots don’t just respond — they narrate.

With this side project, I’ve built a small slice of the future: a personalized news anchor that speaks to you.

If you’re hacking around with ElevenLabs or bots, I’d love to see what you come up with — newsletters, story narrators, bedtime updates?

Feel free to DM me on Telegram or connect on LinkedIn if you remix this!

0
Subscribe to my newsletter

Read articles from Tanisha Sharma directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Tanisha Sharma
Tanisha Sharma

A seasoned developer with a strong desire to solve problems by innovating through technology.