Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rich Post Bot

Stars Forks License

Python Telegram Markdown Rich Posts Free Proxy

Free Telegram bot that turns Markdown (or a .md file) into Telegram Rich Markdown posts — no subscriptions, no ads, private chats only.


Bot: @amthpostbot · Features · Quick Start · Post Format


Important

Non-commercial project under CC BY-NC-SA 4.0. Free to use for personal / non-commercial purposes — see LICENSE.

Tip

Open @amthpostbot, send /start, then try /example or the Show example button to see a finished rich post.

Features

  • Free to use — no subscriptions, payments, accounts, or promo steps
  • Accepts Markdown as a Telegram message or a UTF-8 .md file
  • Converts details, collage, and slideshow into Telegram Rich Markdown blocks
  • Validates Markdown and HTML media URLs before sending
  • Optional SOCKS5 / SOCKS5H proxy
  • Built-in example via /example and the Show example button

Examples

Example rich post

Requirements

  • Python 3.10 or newer
  • A Telegram bot token from @BotFather
  • A Bot API endpoint that supports sendRichMessage

Note

The bot does not need to be an administrator or member of any channel or group. It works in private chats only.

Support the project

If the project was useful, consider starring the repository. It helps other developers discover it and makes the project easier to find again later.

Quick Start

  1. Install dependencies:

    pip install -r requirements.txt
  2. Copy the environment template:

    cp .env.example .env
  3. Set your bot token in .env:

    TELEGRAM_BOT_TOKEN=123456789:your_real_bot_token
    TELEGRAM_PROXY_URL=
  4. Start the bot:

    python main.py
  5. Open the bot in Telegram and send /start.

Warning

Never commit a real bot token. Keep secrets in .env (Git-ignored). If a token was ever leaked — revoke it in BotFather and create a new one.

Configuration

The bot reads .env from the project directory by default. Environment variables override values from the file.

Variable Required Description
TELEGRAM_BOT_TOKEN Yes Bot token from BotFather
BOT_API_BASE No Bot API base URL (default https://api.telegram.org)
TELEGRAM_PROXY_URL No Optional SOCKS5 / SOCKS5H proxy URL
BOT_ENV_FILE No Optional path to another env file

Commands

Command Description
/start Format guide + example button
/help Same as /start
/example Sends sample_post.md source, then the formatted rich post

Note

Messages from groups, channels, and other non-private chats are ignored, so nothing is posted outside your private conversation by accident.

Post Format

Send standard Markdown as text, or upload a UTF-8 .md file. Invalid content gets line-based validation errors.

Details (collapsed)

:::details FAQ
Hidden content goes here.
:::

Details block

Details (open by default)

:::details open FAQ
This content starts open.
:::

Collage

:::collage
![](https://example.com/photo-1.jpg "First caption")
![](https://example.com/photo-2.jpg "Second caption")
:::

Collage block

Slideshow

:::slideshow
![](https://example.com/slide-1.jpg)
![](https://example.com/slide-2.jpg)
:::

Slideshow block

Caution

Media URLs in Markdown images and HTML src must start with http:// or https://. Telegram cannot fetch local file paths.

Full sample: sample_post.md.

License

Non-commercial use under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International. See LICENSE.

Release Checklist

  • Keep .env out of Git; use .env.example for public examples
  • Rotate any bot token that was committed or shared
  • python -m py_compile main.py
  • Smoke-test /start, /help, /example, a text post, a .md upload, and an invalid media URL

About

A small Telegram bot that allows you to publish and write new rich messages thanks to a slightly modified .md file!

Topics

Resources

Stars

Watchers

Forks

Releases

Sponsor this project

Packages

Contributors

Languages