## Overview BlockBee Bot adds crypto subscription payments to your Telegram channels and groups. Set pricing for different time periods; the bot handles everything else. When a user subscribes, the bot generates a single-use invite link and adds them to your channel. When the subscription expires, the bot removes them automatically. No manual management required. > **INFO** >**Estimated time:** 15-20 minutes for a basic setup ## Setup Before you can start using the BlockBee Telegram Bot, you need to configure your BlockBee account and create a Telegram bot. ### 1. Create a BlockBee Account If you haven't already, [sign up for a BlockBee account](https://dash.blockbee.io/register) to get access to the dashboard. ### 2. Configure Addresses Set up the cryptocurrency addresses where you want to receive payments at [Addresses](https://dash.blockbee.io/profile/addresses). > **INFO** >Check this handy [tutorial](/kb/tutorials/dashboard/how-to-set-up-the-addresses) on how to setup your addresses. ### 3. Configure Payment Settings 1. **Set Default Currency:** Go to [Payment Settings](https://dash.blockbee.io/profile/checkout) and configure your default FIAT currency (USD, EUR, GBP, etc.) 2. **Customize Payment Page:** Optionally customize the appearance and branding of your payment pages > **INFO** >Check this handy [tutorial](/kb/tutorials/dashboard/how-to-generate-a-new-api-key) on how to setup the payment settings. ### 4. Generate API Key 1. Navigate to the [API Keys section](https://dash.blockbee.io/profile/api-keys) in your dashboard 2. Click "Generate New API Key" 3. Copy the generated API key - you'll need this for the BlockBee Bot > **INFO** >Check this handy [tutorial](/kb/tutorials/dashboard/how-to-generate-a-new-api-key) on how to generate an API Key. > **WARNING** >**Keep your API key secure:** Never expose your API key in public channels or share it with unauthorized users. Store it securely and only use it for the BlockBee Bot configuration. ## How It Works The BlockBee Telegram Bot integrates with your Telegram channels and groups to provide automated subscription management: ### Payment Processing - **In-Telegram Payments** - Users can pay directly within Telegram using the bot interface - **Payment Links** - Users can also click payment links to complete payments on the BlockBee hosted checkout page - **Multiple Cryptocurrencies** - Supports all cryptocurrencies configured in your BlockBee account ### User Management - **Exclusive Invitation Links** - Each subscriber gets a unique, one-time-use invitation link - **Automatic Access Control** - Only subscribed users can join your channel/group - **Subscription Expiration** - Users are automatically removed when their subscription expires - **Renewal Notifications** - The bot sends notifications when subscriptions are nearing expiration, allowing users to renew - **Renewal Handling** - Seamless renewal process for existing subscribers ### Subscription Options - **Flexible Pricing** - Set different prices for various time periods (daily, weekly, monthly, etc.) - **Multiple Tiers** - Create different subscription levels with different access rights - **Automatic Billing** - Handle recurring payments and subscription renewals - **Coupon System** - Offer free subscriptions or discounts using coupon codes for promotional campaigns > **TIP** >**Technical Integration:** The bot uses BlockBee's checkout payments API to process payments, ensuring secure and reliable payment processing for your subscribers. ## Create Your Telegram Bot To create your own bot, you will need to use the BotFather. ### Step-by-Step Instructions 1. **Access BotFather** - Click [here](https://t.me/botfather) to access the BotFather 2. **Start Conversation** - Type `/start` to initiate the conversation 3. **Create New Bot** - Type `/newbot` to start the process of creating a new bot 4. **Choose Bot Name** - The BotFather will prompt you to choose a name for your bot. Remember that the bot's name must end with the word "bot" (e.g., TestBot or MyAwesomeBot) 5. **Get Bot Token** - After providing a suitable name, the BotFather will generate a bot token for you. This token is essential for accessing and controlling your bot's functionalities > **WARNING** >**Important:** Do not share the bot token with anyone. This token will be inserted into BlockBee Bot and should be kept secure. ![Telegram Bot Creation Process](/assets/images/tutorials/telegram/telegram_screen_1.png) *Figure 1: Creating a new bot with BotFather* ## Create Project in BlockBee Bot ### Step 1: Access BlockBee Bot To start using BlockBee Bot you must access it and then use the `/start` command (in some platforms, Telegram makes the Start as a button on the bottom). ### Step 2: Create New Project Then you must click the button "Create new project". ![Telegram Bot Creation Process](/assets/images/tutorials/telegram/telegram_screen_2.png) *Figure 2: Starting BlockBee Bot with /start command* ### Step 3: Insert Bot Token BlockBee Bot will then prompt you to insert your Telegram Bot token and then hit "send". ![Create New Project Button](/assets/images/tutorials/telegram/telegram_screen_3.png) *Figure 3: Creating a new project in BlockBee Bot* > **INFO** >**Required setup:** After the token is accepted, run `/start` again and click **Update API Key** to add your BlockBee API key. The flow is the same as inserting the bot token. Your API key must be valid — an invalid key causes errors when generating payments. If the token inserted is valid, the bot will reply with a success message. ![Insert Bot Token](/assets/images/tutorials/telegram/telegram_screen_4.png) *Figure 4: Inserting your Telegram bot token* ## Configure Your Project ### Step 1: Add Bot as Administrator Add your bot as an administrator to your Telegram Channel before continuing. The steps below will not work until the bot has admin permissions. ### Step 2: Manage Projects Send the `/start` command again and click **Manage projects**. Select your bot's name from the list. If it doesn't appear, reconfigure your Telegram Bot from step 1. ![Add Bot as Administrator](/assets/images/tutorials/telegram/telegram_screen_6.png) *Figure 6: Adding your bot as an administrator to your channel* ### Step 3: Select Channel Select the Telegram Channel you want to manage. The bot must already be an administrator in that channel. ![Manage Projects](/assets/images/tutorials/telegram/telegram_screen_7.png) *Figure 7: Managing your projects in BlockBee Bot* ### Step 4: Configure Subscriptions After selecting your Telegram Channel, the management options will be displayed. To begin, you will need to set up the subscription price for the desired time periods. You can do this by clicking on the "Subscriptions" button. ![Select Channel](/assets/images/tutorials/telegram/telegram_screen_8.png) *Figure 8: Selecting your Telegram channel to manage* ### Step 5: Set Pricing Once you click the "Subscriptions" button, a list of options for different time periods will be displayed. Here, you can set up the subscription price for the desired time period that you wish to accept. ![Subscriptions Button](/assets/images/tutorials/telegram/telegram_screen_9.png) *Figure 9: Accessing subscription configuration* ### Step 6: Enter Amount Upon clicking one of the available options, the BlockBee Bot will prompt you to enter the amount you want to charge in FIAT currency to your customers. BlockBee uses this amount to generate a payment address in the cryptocurrency your customer selects. > **INFO** >**Currency:** The amount is in the FIAT currency configured in your BlockBee Dashboard. ### Step 7: Activate Bot Finally, you will need to select the "Activate BlockBee_bot in this group" option to activate the bot in the channel you have chosen. ## Testing Your Telegram Bot Test your Telegram Bot setup using real cryptocurrency with minimal cost. ### 1. Use Litecoin for Testing We recommend using **Litecoin (LTC)** for testing because: - Low transaction fees (typically under $0.01) - Fast confirmation times (2.5 minutes average) - Real blockchain testing without high costs ### 2. Test with a Small Amount - Create a subscription for a small value (e.g., $2.00) - Complete the payment using Litecoin - This covers all fees with minimal cost (typically under $0.10) - Test both pending and confirmed payment states ### 3. Testing Checklist - ✅ Telegram bot creation works - ✅ BlockBee Bot project creation works - ✅ Bot token and API key configuration works - ✅ Channel/group selection works - ✅ Subscription pricing setup works - ✅ Bot activation in channel works - ✅ Payment processing works (in-Telegram and payment links) - ✅ User invitation link generation works - ✅ Automatic user removal on expiration works - ✅ Renewal notifications work correctly - ✅ Coupon system functions properly ### 4. Test User Flow - Test the complete user journey from subscription to channel access - Verify that invitation links work correctly - Test subscription expiration and automatic removal - Test renewal process for existing subscribers > **SUCCESS** >**Ready for production?** Once testing is complete, ensure your bot is properly configured and your channel/group is ready to accept subscribers.