How to Monetize a Telegram Bot: Complete Revenue Guide
Telegram bots reach millions of users daily, yet most bot creators leave money on the table. This guide covers every proven monetization strategy with working code examples you can implement today.
What You'll Build
A complete monetization system for Telegram bots including subscription tiers, in-bot purchases, cryptocurrency payments, ad integration, and premium feature gating. You'll have revenue streams running within days.
Why Telegram Bots for Monetization?
Telegram offers unique advantages for bot monetization:
- 2 billion+ users — massive built-in audience
- No app store fees — keep 100% of revenue
- Crypto-native — users expect and prefer crypto payments
- Frictionless UX — no downloads, no installs
Full Tutorial
Step 1: Bot Foundation with User Management
# bot/core.py
from telethon import TelegramClient, events
from telethon.tl.types import User
import asyncio
from dataclasses import dataclass
from typing import Optional
import json
@dataclass
class UserTier:
FREE = "free"
BASIC = "basic"
PRO = "pro"
ENTERPRISE = "enterprise"
class BotCore:
def __init__(self, api_id: int, api_hash: str, bot_token: str):
self.client = TelegramClient("bot", api_id, api_hash)
self.bot_token = bot_token
self.user_db = {} # Replace with real database
async def start(self):
await self.client.start(bot_token=self.bot_token)
print("Bot started!")
def get_user(self, user_id: int) -> dict:
return self.user_db.get(user_id, {
"id": user_id,
"tier": UserTier.FREE,
"expiry": None,
"usage_today": 0
})
def set_user_tier(self, user_id: int, tier: str, days: int = 30):
from datetime import datetime, timedelta
self.user_db[user_id] = {
"id": user_id,
"tier": tier,
"expiry": (datetime.now() + timedelta(days=days)).isoformat()
}
def is_premium(self, user_id: int) -> bool:
user = self.get_user(user_id)
return user["tier"] in [UserTier.BASIC, UserTier.PRO, UserTier.ENTERPRISE]
Step 2: Subscription Tiers
# bot/subscriptions.py
from telethon import events
from bot.core import BotCore, UserTier
class SubscriptionManager:
PLANS = {
"basic": {
"name": "Basic",
"price_usd": 9.99,
"price_crypto": 0.0002,
"features": ["50 requests/day", "Standard response time", "Email support"],
"daily_limit": 50
},
"pro": {
"name": "Pro",
"price_usd": 29.99,
"price_crypto": 0.0006,
"features": ["500 requests/day", "Priority response", "API access", "Custom commands"],
"daily_limit": 500
},
"enterprise": {
"name": "Enterprise",
"price_usd": 99.99,
"price_crypto": 0.002,
"features": ["Unlimited requests", "Instant response", "Dedicated support", "White-label"],
"daily_limit": -1 # Unlimited
}
}
def __init__(self, bot: BotCore):
self.bot = bot
def register_handlers(self):
@self.bot.client.on(events.NewMessage(pattern="/plans"))
async def show_plans(event):
text = "**Choose Your Plan**\n\n"
for tier, plan in self.PLANS.items():
text += f"**{plan['name']}** - ${plan['price_usd']}/month\n"
for feature in plan["features"]:
text += f" ✓ {feature}\n"
text += f"\n`/subscribe {tier}` to upgrade\n\n"
text += "Payment methods: Crypto (USDT/ETH) | Card\n"
text += "Use `/status` to check your current plan"
await event.respond(text, parse_mode="markdown")
@self.bot.client.on(events.NewMessage(pattern=r"/subscribe (\w+)"))
async def subscribe(event):
tier = event.pattern_match.group(1)
if tier not in self.PLANS:
await event.respond("Invalid plan. Use /plans to see options.")
return
plan = self.PLANS[tier]
user_id = event.sender_id
# Generate payment address
payment_info = f"**Complete Your Subscription**\n\n"
payment_info += f"Plan: {plan['name']}\n"
payment_info += f"Price: ${plan['price_usd']}/month\n\n"
payment_info += f"**Crypto Payment:**\n"
payment_info += f"Send {plan['price_crypto']} ETH to:\n"
payment_info += f"`0x1234...your_wallet`\n\n"
payment_info += f"**Card Payment:**\n"
payment_info += f"[Click here to pay](https://your-payment-link.com)\n\n"
payment_info += f"After payment, send `/confirm {tier}` to activate."
await event.respond(payment_info, parse_mode="markdown")
Step 3: Cryptocurrency Payment Integration
# bot/crypto_payments.py
import hashlib
import time
from web3 import Web3
from telethon import events
class CryptoPaymentProcessor:
def __init__(self, rpc_url: str, wallet_address: str):
self.w3 = Web3(Web3.HTTPProvider(rpc_url))
self.wallet = wallet_address
self.pending_payments = {}
def generate_payment_address(self, user_id: int, amount: float) -> dict:
"""Generate unique payment details."""
payment_id = hashlib.sha256(
f"{user_id}-{time.time()}".encode()
).hexdigest()[:16]
self.pending_payments[payment_id] = {
"user_id": user_id,
"amount": amount,
"status": "pending",
"created_at": time.time()
}
return {
"payment_id": payment_id,
"address": self.wallet,
"amount_eth": amount / self.get_eth_price(),
"amount_usd": amount,
"expires_in": 3600
}
def get_eth_price(self) -> float:
# In production, use CoinGecko or Chainlink oracle
return 3500.0
def check_payment(self, payment_id: str) -> dict:
"""Check if payment was received."""
if payment_id not in self.pending_payments:
return {"status": "not_found"}
payment = self.pending_payments[payment_id]
expected_amount = payment["amount_eth"]
# Check blockchain for incoming transaction
balance = self.w3.eth.get_balance(self.wallet)
# Simplified - in production, track specific transactions
return {"status": payment["status"], "confirmations": 0}
async def setup_payment_handlers(self, client):
@client.on(events.NewMessage(pattern=r"/pay (\w+)"))
async def initiate_payment(event):
plan = event.pattern_match.group(1)
from bot.subscriptions import SubscriptionManager
if plan not in SubscriptionManager.PLANS:
await event.respond("Invalid plan")
return
amount = SubscriptionManager.PLANS[plan]["price_usd"]
payment = self.generate_payment_address(event.sender_id, amount)
text = f"**Crypto Payment**\n\n"
text += f"Send exactly **{payment['amount_eth']:.6f} ETH** to:\n"
text += f"`{payment['address']}`\n\n"
text += f"Payment ID: `{payment['payment_id']}`\n"
text += f"Amount: ${amount} USD\n\n"
text += "After sending, use `/check {payment_id}` to verify"
await event.respond(text, parse_mode="markdown")
Step 4: Premium Feature Gating
# bot/premium_features.py
from functools import wraps
from telethon import events
from bot.core import BotCore, UserTier
def require_tier(minimum_tier: str):
"""Decorator to gate features by subscription tier."""
tier_order = {
UserTier.FREE: 0,
UserTier.BASIC: 1,
UserTier.PRO: 2,
UserTier.ENTERPRISE: 3
}
def decorator(func):
@wraps(func)
async def wrapper(event, *args, **kwargs):
user_id = event.sender_id
user = event.client.core.get_user(user_id)
user_level = tier_order.get(user["tier"], 0)
required_level = tier_order.get(minimum_tier, 0)
if user_level < required_level:
await event.respond(
f"This feature requires **{minimum_tier.title()}** plan.\n"
f"Use /plans to upgrade.",
parse_mode="markdown"
)
return None
return await func(event, *args, **kwargs)
return wrapper
return decorator
class PremiumFeatures:
def __init__(self, bot: BotCore):
self.bot = bot
@require_tier(UserTier.BASIC)
async def handle_advanced_analysis(self, event):
"""Only for Basic tier and above."""
await event.respond("Running advanced analysis...")
@require_tier(UserTier.PRO)
async def handle_api_access(self, event):
"""Only for Pro tier and above."""
api_key = "your-api-key-here"
await event.respond(f"Your API key: `{api_key}`")
@require_tier(UserTier.ENTERPRISE)
async def handle_custom_integration(self, event):
"""Only for Enterprise tier."""
await event.respond("Custom integration initiated. Contact support.")
Step 5: In-Bot Purchases (One-Time)
# bot/purchases.py
from telethon import events
import uuid
class InBotPurchases:
PRODUCTS = {
"report": {"name": "Custom Report", "price": 4.99, "type": "digital"},
"analysis": {"name": "Deep Analysis", "price": 9.99, "type": "digital"},
"consultation": {"name": "15min Consultation", "price": 49.99, "type": "service"},
"template": {"name": "Premium Templates Pack", "price": 19.99, "type": "digital"},
}
def __init__(self, bot, payment_processor):
self.bot = bot
self.payments = payment_processor
def register_handlers(self):
@self.bot.client.on(events.NewMessage(pattern="/shop"))
async def show_shop(event):
text = "**In-Bot Shop**\n\n"
for product_id, product in self.PRODUCTS.items():
text += f"**{product['name']}** - ${product['price']}\n"
text += f"Type: {product['type']}\n"
text += f"`/buy {product_id}`\n\n"
await event.respond(text, parse_mode="markdown")
@self.bot.client.on(events.NewMessage(pattern=r"/buy (\w+)"))
async def buy_product(event):
product_id = event.pattern_match.group(1)
if product_id not in self.PRODUCTS:
await event.respond("Product not found. Use /shop")
return
product = self.PRODUCTS[product_id]
payment = self.payments.generate_payment_address(
event.sender_id, product["price"]
)
text = f"**Purchase: {product['name']}**\n\n"
text += f"Price: ${product['price']}\n"
text += f"Send {payment['amount_eth']:.6f} ETH to:\n"
text += f"`{payment['address']}`\n\n"
text += f"Payment ID: `{payment['payment_id']}`\n"
text += "After payment, your product will be delivered automatically."
await event.respond(text, parse_mode="markdown")
Step 6: Ad Revenue Integration
# bot/ads.py
import random
from datetime import datetime, timedelta
class AdManager:
def __init__(self):
self.ads = []
self.last_ad = {}
self.frequency_minutes = 30
def add_ad(self, text: str, link: str, probability: float = 0.3):
self.ads.append({
"text": text,
"link": link,
"probability": probability
})
def should_show_ad(self, user_id: int) -> bool:
if user_id in self.last_ad:
elapsed = datetime.now() - self.last_ad[user_id]
if elapsed < timedelta(minutes=self.frequency_minutes):
return False
if not self.ads:
return False
return random.random() < 0.3
def get_random_ad(self) -> str:
if not self.ads:
return ""
ad = random.choice(self.ads)
self.last_ad[ad.get("user_id")] = datetime.now()
return f"\n\n---\n{ad['text']}\n[Learn more]({ad['link']})"
# Setup ads in your bot
ad_manager = AdManager()
ad_manager.add_ad(
"Need hosting? Try CloudVPS - 50% off first month!",
"https://cloudvps.example.com"
)
ad_manager.add_ad(
"Learn Python automation - 100+ video tutorials",
"https://pythoncourse.example.com"
)
Revenue Optimization Tips
- Start with one monetization method and expand
- Offer a free tier that showcases premium value
- Use Stripe for card payments alongside crypto
- Track conversion rates at each funnel stage
- Send re-engagement messages before subscription expiry
Get the Code
Ready to use these tools? Browse our collection of tested, production-ready Python scripts:
🔗 Browse Products: Anna's Digital Products
All products include:
- ✅ Tested and verified code
- ✅ Instant delivery via crypto or card
- ✅ Free updates forever
- ✅ Telegram bot support (@AnnaLilithBot)
Get the Production-Ready Version
Don't want to build it yourself? We have production-ready versions at https://reply-continues-exams-confidential.trycloudflare.com.
What you get:
- Complete, tested Python code
- Documentation and setup guides
- Instant delivery after crypto payment
- Free updates
Top comments (0)