Steps
Create a bot with BotFather
In Telegram, open @BotFather, send
/newbot, pick a name and a username ending inbot. BotFather replies with a token like123456789:AA.... Keep it secret: anyone with it can post as your bot.Find your chat id
Send any message to your new bot (or add it to a group and send a message there), then open
https://api.telegram.org/botYOUR_TOKEN/getUpdatesin a browser and look for"chat":{"id":...}. A private chat id is a positive number; groups and channels start with a minus sign (supergroups and channels with-100). For a public channel you can also use@yourchannel, after adding the bot as an admin with permission to post.Download the free agent
Get the free RSS to Discord agent. Despite the name, it also posts to Telegram and Slack. It's one Python file, standard library only, no server or bot process to keep running.
Set your feeds, keywords and Telegram details
Copy
.env.exampleto.envand setFEEDS(comma-separated feed URLs),KEYWORDS(comma-separated, case-insensitive, matched in the title and summary; leave empty to get everything),TELEGRAM_BOT_TOKENandTELEGRAM_CHAT_ID. You can leaveDISCORD_WEBHOOK_URLempty. Check what would be sent withpython3 rss_to_discord.py --dry-run.Run it on a schedule
The first real run only remembers what's already in the feeds, so you don't get flooded. After that, each new matching item is sent once. Run it every 15 to 30 minutes:
*/15 * * * * cd /path/to/rss-to-discord && set -a && . ./.env && set +a && /usr/bin/python3 rss_to_discord.py >> run.log 2>&1No always-on computer? A GitHub Actions workflow with
schedule: - cron: '*/15 * * * *'and your values as repository secrets works too (commit theseen_rss.jsonstate file or cache it between runs, or every run will look like a first run).
An example .env
FEEDS=https://hnrss.org/newest?q=python,https://github.com/n8n-io/n8n/releases.atom
KEYWORDS=python,n8n@
TELEGRAM_BOT_TOKEN=123456789:AA...
TELEGRAM_CHAT_ID=-1001234567890
# optional: also post to Discord and/or Slack
DISCORD_WEBHOOK_URL=
SLACK_WEBHOOK_URL=When we ran the dry run with the Hacker News search feed https://hnrss.org/newest?q=python and KEYWORDS=python, it printed only the matching new stories with their links. Each Telegram message is the item title in bold plus the link, sent with HTML formatting so titles containing < or & don't break it.
How the keyword filter works
- Each keyword is a plain, case-insensitive text match on the item's title and summary.
KEYWORDS=discord,webhooksends items containing either word. - Short keywords match inside longer words (
aialso matches "email"), so use distinctive terms or phrases. - Many sites can filter for you before the agent does: Hacker News via hnrss.org (
/newest?q=WORD), Reddit via search feeds (see Reddit keyword alerts in Telegram), GitHub via releases.atom (see GitHub releases in Telegram).
Good to know
- Rate limits: Telegram limits how fast a bot can post, especially into groups. If it answers 429, the agent waits the
retry_afterseconds Telegram asks for and tries again. It also sends at mostMAX_PER_RUNitems per run (10 by default). - Bot can't post in my channel: the bot must be an admin of the channel. In groups, it must be a member; if you just added it, send a message in the group before calling getUpdates.
- getUpdates is empty: send the bot a fresh message first, and make sure no other program uses the same token with a webhook.
- Prefer n8n? An RSS Read node, a Filter node on the title, Remove Duplicates across executions and n8n's Telegram node (Send Message) do the same job.
- The page has no feed? Watch the page itself with a website change alert in Discord or Telegram: you get the lines that changed.
Skip the setup: free Telegram-ready download
The RSS to Discord agent does all of this. Despite the name, it sends to Telegram too: just set TELEGRAM_BOT_TOKEN and TELEGRAM_CHAT_ID and leave the Discord webhook empty. It's tested, MIT-licensed, and comes as an n8n workflow plus a Python script.
FAQ
Do I need to host a Telegram bot?
No. The script only calls Telegram's sendMessage API when there's something new, then exits. Nothing has to stay online between runs.
Can it send to several chats?
One TELEGRAM_CHAT_ID per copy. Run a second copy with its own .env and STATE_FILE for another chat, or post to a channel that everyone joins.
Can I get Discord or Slack too?
Yes. Set DISCORD_WEBHOOK_URL and/or SLACK_WEBHOOK_URL as well, and every new item goes to each of them.
Is it free?
Yes. The agent is MIT-licensed, and Telegram's Bot API is free to use.
Related guides
- Send RSS feeds to Slack with a keyword filter (free, incoming webhook)
- Reddit keyword alerts in Telegram (free, no API key)
- YouTube new video notifications in Telegram (free, with or without Shorts)
- Send GitHub releases, issues and pull requests to Discord (no bot)
- n8n Telegram node not working? 20 tests, every error decoded
New guides
- GitHub release notifications in Slack (any public repo, stable releases only)
- Forward emails to a Slack channel (Gmail, Outlook, any IMAP), free with an incoming webhook
- n8n Google Sheets Trigger not working: not firing, activation errors and fixes
- n8n Gmail Trigger not working: not firing, silent errors and fixes