006
Archive 006Telegram bot

TGChatBot · Лагерь

Multiplayer RPG in Telegram group chats: farm, expeditions, mining, clans, and the Camp Mini App with shared economy and Stars

telegram

TGChatBot · Лагерь
01 /About

Multiplayer RPG in Telegram group chats: farm, expeditions, mining, clans, and the Camp Mini App with shared economy and Stars.

02 /🎯 Overview
  1. 01Group/supergroup RPG bot — each chat is an isolated game world with its own DB
  2. 02Dot/bang commands (.farm, .expedition, .clan) — play inside the conversation
  3. 03Camp Mini App for complex flows without chat spam
  4. 04Gradkia world: farm, mine, expeditions, boss raids, bank, clans, craft, story chronicle
  5. 05Telegram Stars monetization: premium, donate shop, boosts, islands, clan slots
03 /🏗️ Architecture
  1. 01app/ — core bot, game logic, catalogs, schedulers, Stars payments
  2. 02web/backend/ — FastAPI REST reusing app services and ChatDatabaseManager
  3. 03web/frontend/ — Vue 3 SPA with initData auth and TWA integration
  4. 04SQLite registry + per-chat database files
  5. 05Central pydantic-settings configuration
04 /🌾 Farm
  1. 01.farm planting/harvest, cooldowns, failure chance
  2. 02Building chain and farm levels with rare crops
  3. 03Culture week and Premium story quest line
05 /🗺 Expeditions
  1. 01Timed expeditions, locations, journal, random events
  2. 02PvP encounters and duo expeditions with friends
  3. 03Premium locations and Stars-priced worlds
06 /⛏ Mining
  1. 01Passive mining shop, GPU wear, repair, collect cooldown
  2. 02Levels, electricity discount, chat alerts
07 /🏰 Clans
  1. 01Creation, treasury, levels, dungeons, stash, territories and wars
08 /💰 Economy & PvP
  1. 01Bank, robbery, duels, shops, craft, inventory, daily, treasure, boss, top
09 /📱 Mini App
  1. 01Hub and dedicated views for all major game loops
  2. 02Vue 3, TWA SDK, cozy UI components and game session composable
10 /🔌 Web API
  1. 01Full /api/v1 surface for profile, activities, payments, social, help
  2. 02Telegram initData validation and dev bypass
11 /🧩 Stack
  1. 01aiogram 3, FastAPI, SQLAlchemy async, Vue 3, TypeScript, Vite
12 /🔌 Web API (web/backend)
  1. 01FastAPI: /api/v1/me, profile, daily, boss, farm, mining, expedition, inventory, shop, craft, bank, clan, friends, story_quest, top, help, notifications
  2. 02Аутентификация: X-Telegram-Init-Data / Authorization: tma … (валидация подписи бота)
  3. 03Dev bypass для локальной разработки без Telegram-клиента
  4. 04CORS, lifespan с инициализацией ChatDatabaseManager и reload_star_prices
  5. 05Инвойсы Stars: буст босса, семена, экспедиции, клан, подарки — через общий ledger
13 /🛠️ Админ и Dev
  1. 01.настройки — inline-панель админа чата: экономика, банк, ивенты, фичефлаги
  2. 02Отключение шопа / походов / дуэлей / кланов per-chat
  3. 03Dev-панель, команды разработчика, /web и /start в личке для входа в Mini App
  4. 04Rate limit команд, antispam на callback, ExpeditionLock при активном походе
  5. 05Логирование апдейтов, безопасная отправка в чаты (FloodWait, недоступный чат)
14 /🧩 Технические особенности
  1. 01Python 3 + aiogram 3 (async), SQLAlchemy 2 async + aiosqlite
  2. 02Реестр команд (@game_command) с категориями и алиасами на кириллице/латинице
  3. 03Каталоги предметов в app/game/items/, миграции схем per-chat on-the-fly
  4. 04Платежи: pre_checkout, successful_payment, StarTransaction в registry
  5. 05Фронт: Vite 6, vue-tsc, без SSR — статика для Telegram WebApp