Resources

Telegram bot for paid access to a channel or group

General Logic This chatbot flow is designed to manage subscriptions for a private Telegram channel. The flow provides users with an option to subscribe, manage their subscription status, and communica...

Use template

General Logic

This chatbot flow is designed to manage subscriptions for a private Telegram channel. The flow provides users with an option to subscribe, manage their subscription status, and communicate with the chatbot regarding their access. It effectively combines user management with payment processing, ensuring users have a seamless experience accessing exclusive content.

Detailed Steps and Groups of Blocks

1. Start Command & Subscription Setup

  • Start: The process initiates with a welcome message, informing users that they can subscribe to the private channel through the bot.
  • Get Access: The bot defines key variables like subscription price, the link to the private channel, and administrator contact for payment issues.
  • Show the Offer: Here, users receive an overview of what they gain by subscribing, along with a reference to payment and policy details.
  • Payment Link Display: After users agree to the offer, they are presented with a payment link enabling them to complete the transaction.

2. Payment Processing

  • Successful First Payment: This section handles successful payment transactions. Users are unblocked if they were previously banned due to unpaid access, and they receive confirmation of their access to the channel.
  • First Payment Error: If an error occurs during the initial payment attempt, users are instructed to contact the administrator.
  • Successful Renewal: Similar to successful first payments, returns confirmation for payments processed for renewals.
  • Renewal Error: In case of renewal failures, users receive messages detailing the payment issue.

3. Subscription Management

  • Subscription Canceled: This command informs users of successful cancellations.
  • Renewal Notifications: Users receive reminders of their expired subscriptions, providing them with options to renew their access.

4. User Management Triggers

  • Channel/Group Join Request: The bot checks if a user attempting to join the group has a valid subscription. Access is granted only if they are existing users with valid subscriptions.
  • User Exists - Payment Check: This segment identifies whether the user is new or if their payment status is active. Users who do not meet the criteria are informed about the need to pay before accessing the channel.

5. User-related Automated Messages

  • Check Subscription and Block: This feature sends automated messages to users whose subscriptions have expired, reminding them to renew.

6. Handling Group Membership Events

  • New Users Trigger: The bot listens for new chat member events, checking against the required payment to determine if access can be granted. If not, users are blocked with a suitable message.
  • Welcome Message for New Members: For approved members, the bot sends a welcome message in the group, guiding them on how to engage positively.

Integrations and API Requests

The bot requires integration with a payment provider (e.g., Stripe) to process subscriptions and manage payments effectively. The setup would include:

  • API Keys for the payment provider to authenticate transactions.
  • Account Verification might be necessary for payment processing, requiring a functional website detailing service policies.
  • Balance must be kept in the account for successful transaction processing.

Create a chatbot in Botconsole

Attract twice as many clients and generate sales on autopilot through messengers with Botconsole.