All projectsTelegram automation

MMORPG Inside a Telegram Chat

A full multiplayer game built into Telegram: separate chat worlds, classes, PvP, quests, an economy, and a web-based admin panel.

Role
Backend Engineer
Evidence
5 classes · 15,000 lines of Python · 400+ tests · production launch
Status
Private by design
PythonAiogramPostgreSQLRedisFastAPIDocker

The brief outgrew the idea of a bot

The assignment began with a request for a full MMORPG inside a Telegram chat — not a Mini App, and not a website.

Players needed characters, classes, abilities, resources, inventories, quests, and ways to affect one another. Telegram had to remain the only interface.

The key decision was that user_id + chat_id defines a game character. One person can belong to several chats and hold a different class, balance, inventory, and progress in each. Every chat became a self-contained game world.

A game server behind the Telegram interface

One inline-button tap can mean using an ability on another player. In a fraction of a second, the system validates the class, resource, cooldown, target state, defensive effects, and other constraints; it then updates both players, persists durable data, refreshes cache, and schedules a timer or notification when needed.

  • Telegram as the client. Messages became game events, inline buttons the interface, and the finite-state machine a sequence of game actions.
  • Durable and fast state. PostgreSQL holds the world's long-lived memory. Redis manages cooldowns, temporary effects, cache, and fast-changing state.
  • Rules outside the handlers. Game logic lives in dedicated services, keeping Telegram handlers from turning into thousands of lines of branching code.
  • Safe player interaction. The system accounts for simultaneous actions, stale buttons, resources expiring mid-action, and inconsistent cached state.

The result

The economy was the hardest part: classes, items, resources, rewards, and quests all affect one another. A mechanic that works perfectly alone can fail where it intersects with another.

The project grew to roughly 15,000 lines of Python and more than 400 tests. The production release included:

  • five character classes;
  • PvP and abilities;
  • inventory, items, and quests;
  • resources, cooldowns, and temporary effects;
  • an in-game economy;
  • notifications;
  • a separate world for every chat;
  • a web-based admin panel.

The first substantial beta test brought mostly text and gameplay adjustments rather than architectural rewrites. That was the moment the conversation stopped being about a system and became about a game.

PRIVATE BY DESIGN

A custom build for a private client. The source code and the game worlds are not public, but I can walk through the architecture and engineering decisions in a call.

Ready when the problem is real

Where does manual work become expensive for you?

Describe the process, the failure you cannot afford and the result you need. We will propose the smallest system that solves it reliably.

Discuss a similar system