Telegram bot with paid access (Stripe + automatic subscription)
Project: Telegram bot with paid access (Stripe + automatic access issuance)
Project Brief
A developer is required to complete and stabilize the Telegram bot project with paid access to a closed channel/group.
The main task of the system is to automate the sale of access to the Telegram community:
the user selects a tariff in the bot
pays through Stripe
receives access to the closed channel
is automatically removed after the subscription ends
The project is already partially implemented.
Some functionality was developed using ChatGPT and Cursor, so the codebase already exists. However, the architecture turned out to be heterogeneous, and in several places, the system works unstably.
At the moment:
some functions work
some parts require fixing
the architecture needs to be brought to a stable production state
The main task of the developer is to bring the project to a working state and complete the system.
Project Goal
Create a stable system for paid Telegram subscriptions that:
accepts payments through Stripe
automatically issues access to the Telegram channel
automatically removes users after the subscription ends
correctly handles refunds and chargebacks
works reliably during server restarts
Main User Scenario
The user opens the Telegram bot
Clicks Start
Sees the tariffs
Clicks Buy
The bot opens Stripe Checkout
The user makes a payment
Stripe sends a webhook
The system activates the subscription
The user receives an invite link to the closed channel
After the access period ends, the user is automatically removed from the channel.
Current State of the Project
The project already contains:
a basic Telegram bot
integration with Stripe Checkout
server infrastructure
partially implemented subscription logic
However:
the architecture is not structured in places
the processing of Stripe webhooks is not fully implemented
the automatic issuance/removal of access works unstably
code reorganization and logic stabilization are required
The developer's task is to analyze the current code and bring the system to a stable state.
Required Architecture
The system should consist of the following components.
1. Telegram Bot
Functions:
displaying the menu
selecting tariffs
creating Stripe Checkout
checking subscription status
sending invite link
The bot performs only interface functions and should not contain complex payment logic.
2. Stripe Checkout
Used for accepting payments.
Planned tariffs:
7 days
1 month
3 months
Support:
one-time payments
if necessary — subscriptions (subscription)
3. Webhook Service
A separate endpoint for processing Stripe events.
Functions:
receiving Stripe webhook events
verifying Stripe signature
recording payment information in the database
Main events:
checkout.session.completed
invoice.paid
charge.refunded
charge.dispute.created
The webhook should not directly perform actions in Telegram.
4. Database
It is recommended to use:
Supabase or PostgreSQL.
Minimum structure:
users
tg_user_id
created_at
subscriptions
tg_user_id
plan
status
access_until
stripe_customer_id
stripe_subscription_id
created_at
Statuses:
pending
active
expired
canceled
refunded
chargeback
payments
stripe_event_id (unique)
amount
currency
type
created_at
5. Access Worker
A separate service or script that runs periodically.
Functions:
Find users with an active subscription
If access is not granted — send invite link
Find users with expired access — remove from the Telegram channel
Process refunds or chargebacks — remove access
The worker must be safe during repeated runs.
Resilience Requirements
The system must work correctly during:
server restarts
repeated Stripe webhook events
temporary Telegram API errors
temporary unavailability of Stripe
All operations must be repeatable and not lead to data loss.
Deployment
It is assumed to run on a Linux VPS.
Main services:
bot.service
worker.service
Scheduler:
cron or systemd timer.
Technologies Used
Preferably:
Python
or
Node.js
Additionally:
Telegram Bot API
Stripe API
PostgreSQL / Supabase
Webhook endpoint
systemd / Docker (optional)
Telegram Bot Functions
Main commands:
/start — start the bot
/status — check subscription status
/buy — select tariffs
Button menu:
7 days
1 month
3 months
Check status
Security Requirements
Mandatory:
verification of Stripe webhook signature
protection against replaying events
use of environment variables for keys
handling Telegram API errors
Expected Outcome
The developer must provide:
a fully functional Telegram bot
webhook service for Stripe
worker for access management
configured database
instructions for launching and deploying
Expected Result
After the work is completed, the system should fully automate the process:
the user pays for access
automatically receives access to the Telegram channel
is automatically removed after the subscription ends
the administrator does not perform any manual actions.
-
Hello.
I have been developing Telegram bots for over 3 years. The main stack is Python (aiogram v3.x), PostgreSQL, and integrations with payment systems, including Stripe.
I have already implemented bots with a similar architecture:
— Telegram bot with subscriptions
— Stripe Checkout + Webhooks
— automatic access activation
— issuing invites to private channels
… — storing subscriptions and payments in PostgreSQL
For the architecture, I propose to implement the system as follows:
• Telegram bot (aiogram v3) — user interface
• Stripe Checkout — creating a payment page
• Webhook service — processing Stripe events
• PostgreSQL — storing users, subscriptions, and payments
• Nginx + HTTPS — secure processing of webhooks
After payment, Stripe sends a webhook that:
1. verifies the Stripe signature
2. checks that the event has not been processed yet (protection against reprocessing)
3. activates or extends the user's subscription
4. saves payment information in the database
After this, the user can receive an invitation to a closed Telegram channel through the bot.
To protect against access being shared with others, a mechanism of one-time or limited invite links can be used, which:
— are generated by the bot through the Telegram API
— have a limit on the number of uses
— can have a lifespan
— are issued only to users with an active subscription
Before issuing the link, the bot checks:
• the presence of an active subscription
• the expiration date of access
• the user's status
It is also possible to implement:
— a "My Access" section to check subscription status
— logging of payments and user actions
— admin commands to check the user and manually grant access
The architecture will be designed so that:
• the system can be easily transferred to another server
• new channels and rates can be added
• the bot operates stably with a large number of users
I am ready to discuss the project details and propose an optimal architecture.
Thank you.
-
1328 35 1 Hello. There is a similar solution but in PHP. It is easier to install and configure what already works. Feel free to reach out.
-
4975 41 4 1 Good day!
I professionally develop Telegram bots and web applications in Python. I have significant experience working with the Telegram Bot API, integrating Stripe (Checkout, Webhooks), and PostgreSQL/Supabase. I am ready to refine, stabilize the architecture, and deploy your subscription project.
Write to me in private messages, and we will clarify the details.
-
564 1 0 Good day, we can complete your task, we have created similar bots with payment and access to the database.
-
196 I have reviewed the technical specifications. I have experience in developing Telegram bots and integrating Stripe. I can analyze the current code, bring the architecture to a stable state, and complete the system for automatic granting and revoking access to the channel. I am ready to discuss the details and start working.
-
4611 52 1 Good day.
I am a Python developer and can help complete and stabilize your Telegram bot project with paid access through Stripe.
According to the description, the main task is to bring the current codebase to a stable production architecture, fix the Stripe webhook handling, and ensure reliable automatic granting and revocation of access to the Telegram channel.
Here is how I propose to organize the solution:
Stack:
… • Python
• aiogram for the Telegram bot
• FastAPI for the Stripe webhook service
• PostgreSQL / Supabase for storing users, subscriptions, and payments
• Stripe API + webhook signature verification
• a separate worker for managing access
• systemd or Docker for stable service deployment
The architecture will be divided into independent components:
1. Telegram Bot
Responsible only for the user interface:
• menu
• tariff selection
• creating Stripe Checkout Session
• checking subscription status
2. Stripe Webhook Service
A separate endpoint that:
• receives Stripe events
• verifies the webhook signature
• records payments in the database
• updates subscription status
3. Access Worker
A background service that:
• issues invite links to users with an active subscription
• removes users after access expires
• handles refunds and chargebacks
• operates safely during restarts
It will also implement:
• protection against duplicate processing of webhook events
• resilience to server restarts
• proper error handling of the Telegram API
• system logging
I will also be able to analyze the existing code, refactor the architecture, and bring the system to a stable state for 24/7 operation.
Upon completion, you will receive:
• a fully functional Telegram bot
• a reliably working Stripe webhook service
• a worker for managing access
• a configured database
• instructions for deployment and running on a VPS
I would be happy to review the current codebase and discuss the project details.
-
1545 9 0 Hello! I am interested in your project. I have extensive experience in developing Telegram bots using Python (aiogram), working with PostgreSQL, and setting up servers, so your technical specifications are completely clear to me and align with my stack.
How I will implement the key requirements:
Stripe and Webhooks: I will set up integration with Stripe Checkout. I will definitely implement signature verification for webhooks and idempotency (through the processed_events table) to completely eliminate double processing of payments.
Access Management: To protect against the transfer of invitations to third parties, the bot will generate unique one-time invite links. I will also implement a background process that will check expires_at daily and automatically remove users whose subscriptions have expired.
Database: I will design a relational database on PostgreSQL exactly according to your structure (users, subscriptions, payments, events).
Deployment (VPS) and Reliability: I will set up your server "turnkey" — I will launch Nginx as a reverse proxy, bind an SSL certificate for secure webhook operation, and create a systemd service for uninterrupted bot operation 24/7 (with automatic restart in case of failures).
Admin Panel: I will add the necessary commands to check user statuses and manually grant/revoke access.
The code architecture will be modular, allowing you to easily scale the project (add new channels or rates) in the future.
… I am ready to discuss the project in more detail and start working. Please write in private messages!