Ready-made Telegram bots in Python that bring money

Ready-made Telegram bots in Python that bring money

Telegram isn't just about chats and channels; it also offers the opportunity to launch your own mini-business right on your phone. All you need is a little time, a desire to figure it out, and this article. Below are some quick, working bot ideas you can create from scratch and start monetizing.

In the previous article, we discussed ideas for monetization and traffic attraction.

1. Bot-shop of digital goods

Idea: sell things that can be automatically issued: files, access, keys, subscriptions.

What can such a bot sell:

  • Plugins, templates, checklists
  • Stickers and wallpapers
  • Digital Guides
  • Access to private channels

🔧 How to implement in Python (aiogram)

Below is a very simple example of such a bot and a slightly more complex one via JSON. But for a real bot, you need to use real payment APIs (examples under the code) and a database (MySQL, SQLite, PostgreSQL).

@dp.message_handler(commands=['start'])
async def welcome(msg: types.Message):
    kb = InlineKeyboardMarkup().add(InlineKeyboardButton("Купить товар", callback_data='buy'))
    await msg.answer("Добро пожаловать в магазин!", reply_markup=kb)
import json
import os
from aiogram import Bot, Dispatcher, types
from aiogram.types import InlineKeyboardButton, InlineKeyboardMarkup
from aiogram.utils import executor
from aiogram.contrib.middlewares.logging import LoggingMiddleware
from dotenv import load_dotenv

load_dotenv()

TOKEN = os.getenv("BOT_TOKEN")
bot = Bot(token=TOKEN)
dp = Dispatcher(bot)
dp.middleware.setup(LoggingMiddleware())

# Загружаем список товаров
with open("products.json", "r", encoding="utf-8") as f:
    PRODUCTS = json.load(f)["items"]

# Команда /start
@dp.message_handler(commands=['start'])
async def welcome(msg: types.Message):
    kb = InlineKeyboardMarkup().add(InlineKeyboardButton("🛒 Купить товар", callback_data='buy'))
    await msg.answer("Добро пожаловать в магазин цифровых товаров!", reply_markup=kb)

# Выводим список товаров
@dp.callback_query_handler(lambda c: c.data == 'buy')
async def show_products(callback_query: types.CallbackQuery):
    kb = InlineKeyboardMarkup()
    for product in PRODUCTS:
        kb.add(InlineKeyboardButton(f"{product['title']} — {product['price']}₽", callback_data=f"product_{product['id']}"))
    await bot.send_message(callback_query.from_user.id, "Выберите товар:", reply_markup=kb)

# Подтверждение покупки и ссылка на оплату
@dp.callback_query_handler(lambda c: c.data.startswith("product_"))
async def product_selected(callback_query: types.CallbackQuery):
    product_id = callback_query.data.split("_")[1]
    product = next((item for item in PRODUCTS if item["id"] == product_id), None)

    if not product:
        await bot.send_message(callback_query.from_user.id, "Товар не найден.")
        return

    kb = InlineKeyboardMarkup().add(
        InlineKeyboardButton("✅ Я оплатил", callback_data=f"paid_{product_id}")
    )
    await bot.send_message(
        callback_query.from_user.id,
        f"Товар: {product['title']}\nЦена: {product['price']}₽\n\nОплатить можно по ссылке:\n{product['pay_url']}",
        reply_markup=kb
    )

# Подтверждение оплаты и выдача товара
@dp.callback_query_handler(lambda c: c.data.startswith("paid_"))
async def confirm_payment(callback_query: types.CallbackQuery):
    product_id = callback_query.data.split("_")[1]
    product = next((item for item in PRODUCTS if item["id"] == product_id), None)

    if not product:
        await bot.send_message(callback_query.from_user.id, "Ошибка: товар не найден.")
        return

    # Вариант вручную (доверительный) — для MVP
    try:
        with open(product["file"], "rb") as file:
            await bot.send_document(callback_query.from_user.id, file, caption=f"Вот ваш товар: {product['title']}")
    except Exception as e:
        await bot.send_message(callback_query.from_user.id, "Ошибка при отправке файла.")

# Запуск
if __name__ == '__main__':
    executor.start_polling(dp, skip_updates=True)
  • Payment: via Robokassa, YuKassa and others.
  • After payment, the bot sends the product (file/link)

2. AI bot (based on ChatGPT)

The idea: a bot that answers user queries using artificial intelligence.

What it can do:

  • Generate texts, ideas, articles
  • Anwser the questions
  • Help with studies
import openai

openai.api_key = "your_openai_key"

@dp.message_handler()
async def gpt_reply(message: types.Message):
    response = openai.ChatCompletion.create(
        model="gpt-3.5-turbo",
        messages=[{"role": "user", "content": message.text}]
    )
    await message.reply(response['choices'][0]['message']['content'])

Monetization:

  • Subscription
  • Limit on the number of requests
  • Donuts or Boosty

3. Course bot (bot with training lessons)

Idea: a bot that teaches something via Telegram.

Examples of courses:

  • Python from scratch
  • Design from phone
  • How to make money online

🔧 FSM approach (aiogram):

Below are again simple and more complex examples.

class Learning(StatesGroup):
    Lesson1 = State()
    Lesson2 = State()

@dp.message_handler(commands=['start_course'])
async def start_course(msg: types.Message):
    await msg.answer("Урок 1: Что такое Python?")
    await Learning.Lesson1.set()
from aiogram import Bot, Dispatcher, types
from aiogram.types import ReplyKeyboardMarkup, KeyboardButton
from aiogram.contrib.fsm_storage.memory import MemoryStorage
from aiogram.dispatcher import FSMContext
from aiogram.dispatcher.filters.state import State, StatesGroup
from aiogram.utils import executor

TOKEN = 'YOUR_BOT_TOKEN'

bot = Bot(token=TOKEN)
dp = Dispatcher(bot, storage=MemoryStorage())

# Состояния курса
class Learning(StatesGroup):
    Lesson1 = State()
    Lesson2 = State()
    Done = State()

# Кнопки
kb_next = ReplyKeyboardMarkup(resize_keyboard=True).add(KeyboardButton("➡️ Далее"))

# Команда старта курса
@dp.message_handler(commands=['start_course'])
async def start_course(msg: types.Message):
    await msg.answer("👨‍🏫 Урок 1: Что такое Python?\n\nPython — это простой язык программирования, с которого удобно начинать.\n\n❓Вопрос: Как называется язык, о котором идет речь?", reply_markup=kb_next)
    await Learning.Lesson1.set()

# Проверка ответа на 1 урок
@dp.message_handler(state=Learning.Lesson1)
async def lesson1_handler(msg: types.Message, state: FSMContext):
    if "python" in msg.text.lower():
        await msg.answer("✅ Верно! Переходим к Уроку 2...\n\n🧠 Урок 2: Где используют Python?\n- Веб-сайты\n- ИИ\n- Сценарии автоматизации\n\n❓Вопрос: Назови хотя бы одно применение Python.")
        await Learning.Lesson2.set()
    else:
        await msg.answer("❌ Не совсем. Подсказка: язык начинается на 'P'.")

# Проверка второго ответа
@dp.message_handler(state=Learning.Lesson2)
async def lesson2_handler(msg: types.Message, state: FSMContext):
    if any(keyword in msg.text.lower() for keyword in ['веб', 'бот', 'автоматизация', 'ии', 'сайт']):
        await msg.answer("🎉 Отлично! Ты прошёл мини-курс по Python.\n\nХочешь пройти снова? Напиши /start_course")
        await state.finish()
    else:
        await msg.answer("🤔 Попробуй ещё раз. Например: 'веб-разработка', 'боты' или 'автоматизация'.")

# Фоллбэк
@dp.message_handler(state='*')
async def default_handler(msg: types.Message):
    await msg.answer("Напиши /start_course чтобы начать обучение.")

# Запуск бота
if __name__ == '__main__':
    executor.start_polling(dp, skip_updates=True)

How to earn:

  • Sell access
  • Make a free course with affiliates
  • Add ads and links

4. CPA bot (bot with affiliates)

The idea: a bot that offers a “bonus” for clicking on a link, and you get money from the affiliate program.

🔧 Simple example:

@dp.message_handler(commands=['start'])
async def start(msg: types.Message):
    kb = InlineKeyboardMarkup().add(
        InlineKeyboardButton("Получить бонус", url="https://ваша-ссылка.ru/?ref=рефералка")
    )
    await msg.answer("Нажми кнопку и получи подарок 🎁", reply_markup=kb)

CPA networks: Admitad, CityAds

Where to run the bot

Conclusion: Telegram bot is the start of your project

Creating a bot in Python is accessible even to a beginner. Start simple, launch MVP and gradually improve. One working bot can bring passive income and become a start for something bigger.

Links

Comments

There are no comments yet. Be the first!