Skip to content

Repository files navigation

The Posto Banner

✈️ The Posto — Telegram Channel Post Maker Bot

Create. Format. Publish.
A production-ready Telegram Channel Post Maker Bot with a Dark Red & Black Mini App, live formatting preview, colored inline buttons, direct media URL support, and automatic scheduling.


✨ Features

  • 🎨 Dark Red & Black Web Mini App: Telegram-native web panel with real-time live preview.
  • 🔵🟢🔴 Colored Inline Buttons: Add Default, Primary (Blue), Success (Green), and Danger (Red) inline buttons.
  • 🔗 Direct Media URLs: Upload files or paste remote image/video/audio links directly.
  • 💾 Smart 48-Hour Drafts: Automatically saves drafts and prunes them after 48 hours to save MongoDB storage.
  • 📜 Published Posts History: View and re-load previously published channel posts with 1-click.
  • ⏱️ Auto-Delete & Auto-Pin: Scheduled auto-deletion and auto-pinning for channel announcements.
  • 🩺 Built-in /health Check: Easy UptimeRobot integration so Render free instances never sleep!

🚀 One-Click Deploy to Render

Step 1: Push Code to GitHub

Fork or push this repository to your GitHub account.

Step 2: Deploy on Render

  1. Go to Render Dashboard and click New + → Web Service.
  2. Connect your GitHub repository.
  3. Configure the following:
    • Environment: Python 3
    • Build Command: pip install -r requirements.txt
    • Start Command: python3 bot.py
    • Health Check Path: /health
  4. Add your Environment Variables (see table below).
  5. Click Deploy Web Service!

⏰ How to Keep Render Awake 24/7 (UptimeRobot)

Render free web services enter sleep mode after 15 minutes of inactivity. To keep your bot running 24/7 for free:

  1. Go to UptimeRobot.com (Free).
  2. Click Add New Monitor.
  3. Set:
    • Monitor Type: HTTP(s)
    • Friendly Name: Posto Bot Health
    • URL / IP: https://YOUR-APP-NAME.onrender.com/health
    • Monitoring Interval: Every 5 minutes
  4. Click Create Monitor.

💡 Done! UptimeRobot will ping /health every 5 minutes, preventing Render from ever sleeping.


⚙️ Environment Variables

Add these in your .env or Render Environment tab:

Variable Required Description Example
BOT_TOKEN Yes Telegram Bot Token from @BotFather 123456:ABC-DEF...
API_ID Yes Telegram API ID from my.telegram.org 12345678
API_HASH Yes Telegram API Hash from my.telegram.org 0123456789abcdef...
MONGO_URI Yes MongoDB Atlas Connection URI mongodb+srv://user:pass@cluster.mongodb.net
DATABASE_NAME No Database name (Default: posto) posto
OWNER_ID Yes Your Telegram numerical User ID 86742154
BASE_URL No Public URL of your deployed Web App https://your-bot.onrender.com
PORT No Web port (Default: 8080, Render sets this automatically) 8080

💻 Run Locally

# 1. Clone repo
git clone https://github.com/your-username/posto.git
cd posto

# 2. Install dependencies
pip install -r requirements.txt

# 3. Create .env file & add your keys
cp .env.example .env

# 4. Start Posto
python3 bot.py

Open http://localhost:8080 in your browser to access the Web Editor!


🐳 Run with Docker

docker build -t the-posto .
docker run -d -p 8080:8080 --env-file .env the-posto

🎨 How to Use Colored Inline Buttons

In your Pyrogram bot scripts, you can send colored buttons:

from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton
from pyrogram.enums import ButtonStyle

buttons = InlineKeyboardMarkup([
    [
        InlineKeyboardButton(
            text="🔵 Primary Button",
            url="https://t.me/yourchannel",
            style=ButtonStyle.PRIMARY   # 🔵 Dark Blue / Accent
        )
    ],
    [
        InlineKeyboardButton(
            text="🟢 Success Button",
            url="https://t.me/yourchannel",
            style=ButtonStyle.SUCCESS   # 🟢 Green
        )
    ],
    [
        InlineKeyboardButton(
            text="🔴 Danger Button",
            url="https://t.me/yourchannel",
            style=ButtonStyle.DANGER    # 🔴 Red
        )
    ]
])

await message.reply("Choose an option:", reply_markup=buttons)

📊 Project Status

📱 Bot Commands

  • /start — Welcome message with Web App button & quick guide.
  • /channels — Manage connected channels & verify admin rights.
  • /addchannel — Instructions to add the bot as channel admin.
  • /help — Full guide and formatting cheat sheet.

📜 License

This project is licensed under the MIT License. See the LICENSE file for details.

The Posto • Built for Telegram Creators with ❤️

❤️ Community

If you find The Posto useful, consider ⭐ starring the repository.

Join Telegram

About

Production-ready Telegram Channel Post Maker Bot with a sleek native web editor, custom typography, MongoDB persistence, watermark engine, auto-pin, and scheduled auto-delete.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages