The developer adapted an existing Telegram bot to the MAX platform without rewriting the core logic. The bot, built on aiogram 3, FastAPI, PostgreSQL, and Redis, now treats the messenger as a transport layer, using an adapter to handle differences between the two APIs.

Key technical differences include the API host (platform-api2.max.ru), token authentication via the Authorization header, and specific rate limits of 30 requests per second with a 4,000-character text limit. The developer implemented a custom SSL context to handle the Russian Trusted Sub CA certificate.

The integration supports both long polling and webhooks. The developer noted that active webhooks disable long polling, a conflict that requires monitoring. To prevent duplicate processing of concurrent messages, the system uses an asyncio.Lock for each user.

Testing was conducted using a mock MAX client to simulate the full agent cycle, including deep links and callback buttons, without requiring a production token. The developer suggests packaging the MAX client separately for future reuse in other projects.