Custom Telegram CRM

A custom Telegram connector for Bitrix24 Open Lines: dozens of bots and correspondence under control

We replaced the built-in Telegram connector with our own: about 30 lines and roughly 44 thousand contacts were moved over without interrupting the operators. Conversations are linked to CRM cards, and how long they are kept is now controlled by the company.

Client International company, customer service on cloud Bitrix24
Industry Service platforms · customer support
Duration about 2.5 months (pilot and phased migration of the lines)
Type Telegram connector for Open Lines
30 live lines moved to the connector
~44K contacts migrated without any action on their part
1 portal for the bots of dozens of brands

The problem

The company's customer service runs through cloud Bitrix24 Open Lines: every brand has its own Telegram bot connected, and operators reply right in the portal's messenger. The company needed to manage messages: set a retention period for conversations, keep its own copy of the history and link conversations to CRM cards. The built-in Telegram connector cannot do this: the retention period is not configurable and old messages cannot be removed from a conversation. Bitrix24 support confirmed this in writing.

Before

  • About 30 live lines, each with its own bot, all on one cloud portal.
  • Conversations piled up with no time limit, and there was no way to manage them.
  • Moving contacts to new lines by hand would have meant several months of work per line and a risk of losing some communication channels.
  • There are services around the portal: mailings, reports, surveys. Any solution had to work well with them.

What we built

Instead of the built-in connector we wrote our own: a service layer in Go between Telegram and Bitrix24 Open Lines. Nothing changed for operators, who work in the same lines. Contacts noticed nothing: same bot, same chat.

  • We connected the bots of dozens of brands to one portal, with separate settings for each brand line.
  • Real Telegram identifiers never reach the portal. A conversation lives under a pseudo-identifier that is rotated on a schedule: new messages go to a new chat, and the old one is detached from the contact.
  • We linked conversations to CRM cards: the current chat can be opened from a contact, and where a person has several Telegram accounts the system does not guess and openly flags the card.
  • We set up an archive: our own copy of the correspondence with a separate retention period and a viewer, so history is not lost.
  • The lines were migrated at night, following a rehearsed scenario: a dress rehearsal on live data, timing measurements, a check after every step and a rollback plan. The migration respected the request limits of the cloud portal.
  • We taught the connector to handle Bitrix24 formatting, photos and documents (up to 50 MB); long messages are split on line boundaries. Failure alerts arrive in Telegram.

Results

  • All live lines work through the connector; operators carried on working in the familiar Open Lines.
  • The retention period is managed by a setting: the conversation window is shorter, our own copy lives longer, and the daily cleanup runs on its own.
  • A live conversation opens from the CRM card, and linking conversations to contacts works across the whole database.
  • Working with the connector also revealed subtleties of the cloud portal: for example, it returns no more than 50 history messages per call, and a "success" reply to a deletion does not yet mean the message is deleted. All of this is accounted for in the reconciliation.

The client's name is withheld under NDA. Real names and details are shared at the brief.

A similar task?

Describe it briefly — within 1–2 days we'll come back with an analysis and an hourly estimate. If a packaged solution fits, we'll say so honestly.

✈ Telegram