
How I Sell 26 Digital Products With a 200-Line Python Bot
The Setup I wanted to sell digital products without: Building a website Setting up payment processing Paying monthly SaaS fees So I built a Telegram bot. Here's the entire architecture. Architecture Overview User opens bot → /start command → Main menu (inline keyboard) → Browse categories → Select product → View details + price → Click "Buy" → Telegram Stars payment → pre_checkout_query → approve → successful_payment → deliver PDF → Save to SQLite The Product Catalog I store everything in a Python dictionary: PRODUCTS = { ' swiftui_starter ' : { ' name ' : ' SwiftUI Starter Kit Pro ' , ' description ' : ' MVVM templates, networking, Core Data... ' , ' stars ' : 75 , ' category ' : ' swiftui ' , ' file ' : ' products/swiftui_starter.pdf ' }, # ... 25 more products } No database needed for the catalog. Products rarely change, so a dict works fine. Navigation System Telegram inline keyboards make great UIs: def category_keyboard ( category ): keyboard = InlineKeyboardMarkup ( row_width =
Continue reading on Dev.to Python
Opens in a new tab

