Switch to English?
Yes
Переключитись на українську?
Так
Переключиться на русскую?
Да
Przełączyć się na polską?
Tak

Update Telegram bot for selling Telegram stars and Premium

Project: Telegram bot for selling Telegram Stars and Premium subscriptions
Main functionality: Automated sale of virtual currency Telegram Stars and premium subscriptions through a Telegram bot with payment system integration (Ukrainian bank cards, TON cryptocurrency), a review system, and an admin panel.

What was initially: Users could only choose from a fixed set of pre-installed star packages with different prices (50 stars for 48 UAH, 100 for 85 UAH, 200 for 160 UAH, etc.). The list of 15 different packages was split into two pages with pagination buttons. Each package had an individual price without a single price list. The user could not buy an arbitrary number of stars - only ready-made options.

What has been done now: A flexible star purchasing system has been implemented with two operating modes. The first mode - quick packages (13, 21, 26, 50 stars) with automatic cost calculation at a unified rate of 0.84 UAH per star, where the 50-star package is marked as a hot offer with a fire icon. The second mode - free input, where the user specifies the desired number of stars from 1 to 100000, after which the bot automatically calculates the cost and shows detailed order confirmation before payment. A "Enter your amount" button has been added to the star package selection menu.

Technical changes: The pricing system has been centralized through the constant STAR_PRICE_PER_UNIT, allowing the price per star to be changed throughout the system by editing a single number. A new FSM state has been created to handle user input for the number of stars. Validation has been implemented with a minimum check of 1 star and a maximum of 100000 stars. An order confirmation function has been added with a preview of the quantity and cost before proceeding to payment. The structure of the STAR_PRICES dictionary has been simplified by removing many fixed packages and adding dynamic calculation. Code readability has been improved by introducing a named constant for the price instead of hard-coded values. Pagination of the star menu has been removed, as now only 4 quick packages are displayed plus a button for arbitrary input.

Result: Increased flexibility of the system for users, simplified price administration, improved user experience due to the ability to purchase the exact required number of stars without overpaying for rounding to the nearest package.
Work details
Added 16 February
192 views
Freelancer
Heorhii Zhukov
Ukraine Kyiv  23  0

Available for hire Available for hire
23 Safes completed
On the service 9 months 15 days