The service, named Echo Dialogov, uses the Telegram Business API to archive messages, edits, and deletions in private chats. It operates on Python 3.12, aiogram 3, FastAPI, PostgreSQL, and Redis with ARQ, hosted on a VPS with 2 GB of RAM.
The architecture relies on two principles: saving data before responding to webhooks to prevent loss, and ensuring idempotency using update IDs to avoid duplicates. Data is encrypted at the application level using Fernet, with user-defined retention periods of 1, 7, 30, or 90 days.
Technical challenges included handling UTF-16 offsets for message formatting, which caused issues with emojis, and managing message queues when the service failed to process specific content types. The developer now monitors pending_update_count via the Telegram API to ensure delivery.
The bot handles payments via bank cards and SBP, storing RebillId for recurring transactions. It requires specific terminal configurations to function correctly. The developer notes that the service acts as a data processor, necessitating strict compliance with personal data laws.





