Hi there! 👋 I’ve built a powerful Telegram bot for online stores that works around the clock and turns your Telegram into a full-fledged shopping mall!
🎯 Smart product catalog — all items are stored in Google Sheets! No more fiddling with Excel files — update your inventory right from the browser!
🛒 Interactive cart — add items with one click, change quantities, clear the cart — all without reloading!
📱 Sleek interface — beautiful buttons, emojis, smooth transitions between sections. Shopping becomes pure joy!
👨💼 Seller dashboard — get notified of new orders, confirm deliveries, manage order statuses right inside Telegram!
📊 Auto-update — the bot monitors catalog changes and refreshes data every 5 minutes!
🔍 Product search — instantly find items by name!
You add products to a Google Sheet (just like Excel, but in the cloud!) Customers enter the bot and browse products via a user-friendly menu The bot automatically processes orders and sends you notifications You confirm the order and update stock with a single click!
— fast and reliable Google Sheets API — all data in the cloud Telegram Bot API — maximum integration Multithreading — runs without lag!
✅ Small businesses — launch your store in 5 minutes! ✅ Info-business — sell digital products ✅ Artisans — showcase handmade goods ✅ Dropshippers — manage inventory with ease
✨ No hosting required — runs on any computer ✨ Works 24/7 — takes orders even while you sleep ✨ Automatic backups — Google saves your data for you ✨ Multi-account — multiple sellers can operate simultaneously
The best part — it's free! 🎁
You only pay for a server (if you want), but you can run it on your own PC!
- Open @BotFather in Telegram
- Send the
/newbotcommand and follow the instructions - Copy the received token to the
BOT_TOKENvariable - Copy the bot username to the
BOT_USERNAMEvariable
- Open @userinfobot in Telegram
- The bot will automatically send you your Chat ID
- Copy the ID to the
SELLER_CHAT_IDandSUPPORT_MANAGER_IDvariables
Step 1: Creating a project in Google Cloud Console
- Go to Google Cloud Console
- Create a new project or select an existing one
- In the menu, go to "APIs & Services" → "Library"
- Find and enable "Google Sheets API" and "Google Drive API"
Step 2: Creating a Service Account
- Go to "APIs & Services" → "Credentials"
- Click "Create Credentials" → "Service Account"
- Fill in the name and description, click "Create and Continue"
- Skip granting roles (optional)
- Click "Done"
Step 3: Getting the JSON key
- In the Service Accounts list, find the created account
- Click on the account email
- Go to the "Keys" tab
- Click "Add Key" → "Create new key"
- Select "JSON" type and click "Create"
- The file will automatically download — save it as
credentials.jsonin the project root
Step 4: Setting up Google Sheets
- Create a new Google spreadsheet or open an existing one
- Copy the spreadsheet ID from the URL (between
/d/and/edit):https://docs.google.com/spreadsheets/d/YOUR_SHEET_ID/edit - Open
credentials.jsonand copy the Service Account email (theclient_emailfield) - In Google Sheets, click "Share" and grant "Editor" access to this email
- Paste the spreadsheet ID into the
GOOGLE_DISK_IDvariable
- Sign up at Stripe
- Go to the Dashboard
- In the "Developers" → "API keys" section, find:
- Publishable key → copy to
STRIPE_PUBLISHABLE_KEY - Secret key → copy to
STRIPE_SECRET_KEY
- Publishable key → copy to
- For testing, use test keys (starting with
pk_test_andsk_test_)
Your Google spreadsheet should contain the following columns (order matters):
| Column | Type | Required | Description | Example |
|---|---|---|---|---|
| id | number | ✅ Yes | Unique product identifier | 1, 2, 3 |
| brand | text | ❌ No | Product brand/manufacturer | Nike, Apple |
| name | text | ✅ Yes | Product name | iPhone 15, Milk |
| category | text | ✅ Yes | Product category | Electronics, Food |
| size_or_weight | number | ❌ No | Product unit size/weight* | 2.5, 250, 0.5 |
| price | number | ✅ Yes | Product price** | 100, 250.50 |
| unit_of_measurement | text | ✅ Yes | Unit of measurement: "кг" (kg) or "шт" (pcs) | кг, шт |
| stock | number | ✅ Yes | Quantity in stock | 10, 0, 100 |
| image_url | text | ❌ No | Image URL (Google Drive supported) | https://drive.google.com/... |
Important rules:
* size_or_weight column:
- For "кг" (kg) products: package weight in kilograms (e.g., 2.5 for a 2.5kg package)
- For "шт" (pcs) products:
- If < 30: volume in liters (e.g., 0.5 for a 0.5L bottle)
- If ≥ 30: weight in grams (e.g., 250 for a 250g package)
** price column:
- For "кг" (kg) products: price per 1 kilogram
- For "шт" (pcs) products: price per 1 piece/package
Filling examples:
id | brand | name | category | size_or_weight | price | unit_of_measurement | stock
1 | Farm | Milk 2.5% | Food | 1.0 | 35 | л | 50
2 | Nike | Sneakers | Shoes | | 2500 | шт | 10
3 | | Gouda Cheese | Food | 0.3 | 450 | кг | 5
4 | Lay's | Chips | Snacks | 150 | 45 | шт | 30
Images from Google Drive:
- Upload the image to Google Drive
- Open the image and click "Share" → "Get link" → "Anyone with the link"
- Copy the link to the
image_urlcolumn - The bot will automatically convert the link to the correct format
- Copy
.env.exampleto.env:cp .env.example .env
- Fill in all values in the
.envfile with the obtained credentials - IMPORTANT: The
.envandcredentials.jsonfiles are in.gitignoreand should not be committed to the repository!
- Python 3.8 or higher
- pip (Python package manager)
- Git (for cloning the repository)
1. Clone the repository:
git clone https://github.com/Vasyl-Ch/telegram_shop_bot.git
cd telegram_shop_bot2. Create a virtual environment (recommended):
# Windows
python -m venv venv
venv\Scripts\activate
# Linux/MacOS
python3 -m venv venv
source venv/bin/activate3. Install dependencies:
pip install -r requirements.txt4. Configure environment variables:
- Copy
.env.exampleto.env - Fill in all required variables (see "Setup and Obtaining Credentials" section)
- Place the
credentials.jsonfile in the project root
5. Run the bot:
python main.pyYou should see the message:
✅ Bot started successfully
✅ GoogleSheetsClient initialized
1. Make sure you have Docker and docker-compose installed:
docker --version
docker-compose --version2. Configure environment variables:
- Create
.envfile (see above) - Make sure
credentials.jsonis in the project root - In
.envchangeJSON_KEY_FILEto/app/credentials.json
3. Build and run the container:
docker-compose up -d4. Check logs:
docker-compose logs -f telegram-bot5. Stop the bot:
docker-compose downUseful Docker commands:
# Rebuild container after changes
docker-compose build --no-cache
# Restart container
docker-compose restart
# View status
docker-compose ps
# Remove container and data
docker-compose down -vWant a bot like this for your business? 🚀
📩 Message me on Telegram — I'll help you set it up and launch!
⭐ Star the repository if you like the project!
This project is licensed under the CC BY-NC 4.0 License — see the LICENSE file for details.
P.S. This bot is already generating real profits for stores! Don't miss your chance to automate your sales! 💸
Привет! 👋 Я создал мощного Telegram бота для интернет-магазина, который работает круглосуточно и превращает твой телеграм в полноценный торговый центр!
🎯 Умный каталог товаров — все товары хранятся в Google Таблицах! Больше не нужно возиться с Excel файлами — обновляй ассортимент прямо из браузера!
🛒 Интерактивная корзина — добавляй товары одним кликом, меняй количество, очищай — всё без перезагрузки!
📱 Стильный интерфейс — красивые кнопки, emoji, плавные переходы между разделами. Покупать — одно удовольствие!
👨💼 Панель продавца — получай уведомления о новых заказах, подтверждай доставку, управляй статусами заказов прямо в телеграме!
📊 Автообновление — бот сам следит за изменениями в каталоге и подгружает актуальные данные каждые 5 минут!
🔍 Поиск товаров — находи нужные товары по названию моментально!
- Ты добавляешь товары в Google Таблицу (как в обычном Excel, но в облаке!)
- Клиенты заходят в бота и выбирают товары через удобное меню
- Бот автоматически оформляет заказы и присылает тебе уведомления
- Ты подтверждаешь заказ и списываешь остатки одним кликом!
- Python 3.8+ — быстрый и надежный
- Google Sheets API — все данные в облаке
- Telegram Bot API — максимальная интеграция
- Многопоточность — работает без тормозов!
✅ Малый бизнес — запусти магазин за 5 минут!
✅ Инфобизнес — продавай цифровые товары
✅ Ремесленники — демонстрируй handmade товары
✅ Дропшипперы — управляй ассортиментом легко
✨ Не требует хостинга — запускается на любом компьютере
✨ Работает 24/7 — принимает заказы даже когда ты спишь
✨ Автоматическое резервное копирование — Google сам сохраняет данные
✨ Мультиаккаунт — несколько продавцов могут работать одновременно
Самое приятное — бесплатно! 🎁 Ты платишь только за сервер (если хочешь), но можешь запустить и на своем ПК!
- Откройте @BotFather в Telegram
- Отправьте команду
/newbotи следуйте инструкциям - Скопируйте полученный токен в переменную
BOT_TOKEN - Скопируйте username бота в переменную
BOT_USERNAME
- Откройте @userinfobot в Telegram
- Бот автоматически отправит ваш Chat ID
- Скопируйте ID в переменные
SELLER_CHAT_IDиSUPPORT_MANAGER_ID
Шаг 1: Создание проекта в Google Cloud Console
- Перейдите в Google Cloud Console
- Создайте новый проект или выберите существующий
- В меню перейдите в "APIs & Services" → "Library"
- Найдите и включите "Google Sheets API" и "Google Drive API"
Шаг 2: Создание Service Account
- Перейдите в "APIs & Services" → "Credentials"
- Нажмите "Create Credentials" → "Service Account"
- Заполните имя и описание, нажмите "Create and Continue"
- Пропустите предоставление ролей (опционально)
- Нажмите "Done"
Шаг 3: Получение JSON ключа
- В списке Service Accounts найдите созданный аккаунт
- Нажмите на email аккаунта
- Перейдите на вкладку "Keys"
- Нажмите "Add Key" → "Create new key"
- Выберите тип "JSON" и нажмите "Create"
- Файл автоматически скачается — сохраните его как
credentials.jsonв корень проекта
Шаг 4: Настройка Google Sheets
- Создайте новую Google таблицу или откройте существующую
- Скопируйте ID таблицы из URL (между
/d/и/edit):https://docs.google.com/spreadsheets/d/ВАШ_ID_ТАБЛИЦЫ/edit - Откройте
credentials.jsonи скопируйте email Service Account (полеclient_email) - В Google таблице нажмите "Share" и предоставьте доступ "Editor" этому email
- Вставьте ID таблицы в переменную
GOOGLE_DISK_ID
- Зарегистрируйтесь на Stripe
- Перейдите в Dashboard
- В разделе "Developers" → "API keys" найдите:
- Publishable key → скопируйте в
STRIPE_PUBLISHABLE_KEY - Secret key → скопируйте в
STRIPE_SECRET_KEY
- Publishable key → скопируйте в
- Для тестирования используйте тестовые ключи (начинаются с
pk_test_иsk_test_)
Ваша Google таблица должна содержать следующие колонки (порядок важен):
| Колонка | Тип | Обязательная | Описание | Пример |
|---|---|---|---|---|
| id | число | ✅ Да | Уникальный идентификатор товара | 1, 2, 3 |
| brand | текст | ❌ Нет | Бренд/производитель товара | Nike, Apple |
| name | текст | ✅ Да | Название товара | iPhone 15, Молоко |
| category | текст | ✅ Да | Категория товара | Электроника, Продукты |
| size_or_weight | число | ❌ Нет | Размер/вес единицы товара* | 2.5, 250, 0.5 |
| price | число | ✅ Да | Цена товара** | 100, 250.50 |
| unit_of_measurement | текст | ✅ Да | Единица измерения: "кг" или "шт" | кг, шт |
| stock | число | ✅ Да | Количество на складе | 10, 0, 100 |
| image_url | текст | ❌ Нет | URL изображения (поддерживается Google Drive) | https://drive.google.com/... |
Важные правила:
* Колонка size_or_weight:
- Для товаров в "кг": вес упаковки в килограммах (например, 2.5 для упаковки 2.5кг)
- Для товаров в "шт":
- Если < 30: объем в литрах (например, 0.5 для бутылки 0.5л)
- Если ≥ 30: вес в граммах (например, 250 для упаковки 250г)
** Колонка price:
- Для товаров в "кг": цена за 1 килограмм
- Для товаров в "шт": цена за 1 штуку/упаковку
Примеры заполнения:
id | brand | name | category | size_or_weight | price | unit_of_measurement | stock
1 | Фермер | Молоко 2.5% | Продукты | 1.0 | 35 | л | 50
2 | Nike | Кроссовки | Обувь | | 2500 | шт | 10
3 | | Сыр Гауда | Продукты | 0.3 | 450 | кг | 5
4 | Lay's | Чипсы | Снеки | 150 | 45 | шт | 30
Изображения из Google Drive:
- Загрузите изображение на Google Drive
- Откройте изображение и нажмите "Поделиться" → "Получить ссылку" → "Доступ для всех, у кого есть ссылка"
- Скопируйте ссылку в колонку
image_url - Бот автоматически преобразует ссылку в правильный формат
- Скопируйте
.env.exampleв.env:cp .env.example .env
- Заполните все значения в
.envфайле полученными учетными данными - ВАЖНО: Файл
.envиcredentials.jsonнаходятся в.gitignoreи не должны попадать в репозиторий!
- Python 3.8 или выше
- pip (менеджер пакетов Python)
- Git (для клонирования репозитория)
1. Клонируйте репозиторий:
git clone https://github.com/Vasyl-Ch/telegram_shop_bot.git
cd telegram_shop_bot2. Создайте виртуальное окружение (рекомендуется):
# Windows
python -m venv venv
venv\Scripts\activate
# Linux/MacOS
python3 -m venv venv
source venv/bin/activate3. Установите зависимости:
pip install -r requirements.txt4. Настройте переменные окружения:
- Скопируйте
.env.exampleв.env - Заполните все необходимые переменные (см. раздел "Настройка и получение учетных данных")
- Поместите файл
credentials.jsonв корень проекта
5. Запустите бота:
python main.pyВы должны увидеть сообщение:
✅ Bot started successfully
✅ GoogleSheetsClient initialized
1. Убедитесь, что у вас установлен Docker и docker-compose:
docker --version
docker-compose --version2. Настройте переменные окружения:
- Создайте файл
.env(см. выше) - Убедитесь, что файл
credentials.jsonнаходится в корне проекта - В
.envизменитеJSON_KEY_FILEна/app/credentials.json
3. Соберите и запустите контейнер:
docker-compose up -d4. Проверьте логи:
docker-compose logs -f telegram-bot5. Остановить бота:
docker-compose downПолезные команды Docker:
# Пересборка контейнера после изменений
docker-compose build --no-cache
# Перезапуск контейнера
docker-compose restart
# Просмотр статуса
docker-compose ps
# Удаление контейнера и данных
docker-compose down -vХочешь такой же крутой бот для своего бизнеса? 🚀
📩 Пиши мне в Telegram — помогу настроить и запустить!
⭐ Поставь звездочку репозиторию, если нравится проект!
This project is licensed under the CC BY-NC 4.0 License — see the LICENSE file for details.
P.S. Этот бот уже приносит реальную прибыть магазинам! Не упусти возможность автоматизировать свои продажи! 💸
#TelegramBot #ИнтернетМагазин #Автоматизация #Ecommerce #Python #GoogleSheets #ОнлайнМагазин #Dropshipping #ShopBot #Startup #ПассивныйДоход #Innovation #TechTrends #MakeMoneyOnline