Bot for Automatic Product Publishing from Website to Telegram Channel

Our company is engaged in the development, support and maintenance of sites of any complexity. From simple one-page sites to large-scale cluster systems built on micro services. Experience of developers is confirmed by certificates from vendors.
Development and maintenance of all types of websites:
Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Showing 1 of 1 servicesAll 2065 services
Bot for Automatic Product Publishing from Website to Telegram Channel
Medium
~3-5 business days
FAQ
Our competencies:
Development stages
Latest works
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1161
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1041
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    823
  • image_crm_chasseurs_493_0.webp
    CRM development for Chasseurs
    848
  • image_website-sbh_0.png
    Website development for SBH Partners
    999
  • image_website-_0.png
    Website development for Red Pear
    451

Developing a Bot for Automatic Product Publishing from Website to Telegram Channel

Bot takes products from website catalog and publishes them to Telegram channel: with photo, description, price, and button linking to product page. Suitable for stores wanting to use Telegram channel as additional sales channel without manual post formatting.

Architecture

Scheduler (Cron/Celery Beat)
    ↓
ProductPublisher Service
    ↓ — select products for publishing
Database (products)
    ↓ — download image
CDN / S3
    ↓ — send post
Telegram Bot API (sendPhoto / sendMediaGroup)
    ↓ — mark as published
Database (telegram_posts)

Forming Publication

import httpx
from aiogram import Bot
from aiogram.types import InlineKeyboardMarkup, InlineKeyboardButton

bot = Bot(token=BOT_TOKEN)

async def publish_product(product: dict) -> None:
    caption = (
        f"<b>{product['name']}</b>\n\n"
        f"{product['short_description']}\n\n"
        f"💰 <b>{product['price']:,.0f} ₽</b>"
    )

    keyboard = InlineKeyboardMarkup(inline_keyboard=[[
        InlineKeyboardButton(
            text="🛒 Buy",
            url=f"https://example.com/products/{product['slug']}"
        )
    ]])

    if product.get('images'):
        await bot.send_photo(
            chat_id=CHANNEL_ID,
            photo=product['images'][0]['url'],
            caption=caption,
            parse_mode='HTML',
            reply_markup=keyboard
        )
    else:
        await bot.send_message(
            chat_id=CHANNEL_ID,
            text=caption,
            parse_mode='HTML',
            reply_markup=keyboard
        )

    # Mark as published
    await db.execute(
        'INSERT INTO telegram_posts (product_id, channel_id, published_at) VALUES ($1, $2, NOW())',
        product['id'], CHANNEL_ID
    )

Publication Schedule

Publishing multiple posts in a row is bad taste. Optimal: 1–3 products per day, at specific time:

# Celery Beat Schedule
CELERYBEAT_SCHEDULE = {
    'publish-morning': {
        'task': 'bot.tasks.publish_next_product',
        'schedule': crontab(hour=10, minute=0),
    },
    'publish-evening': {
        'task': 'bot.tasks.publish_next_product',
        'schedule': crontab(hour=19, minute=0),
    },
}

Publication Queue

Products aren't selected randomly — queue is formed:

  • Priority by product creation date or manual sorting in admin
  • Products published less than 30 days ago are skipped
  • Inactive products excluded automatically
  • Operator can mark product as "publish next"

Timeline

Bot with publication schedule and queue: 3–5 business days.