LiveChat x Telegram

Connect Telegram Bot to LiveChat

To connect a Telegram Bot to LiveChat you need a Bot API Token (e.g. 12345:abcd...xyz).

  1. Install the app on LiveChat Marketplace.
  2. To get a Bot API Token, open the Telegram app and find @BotFather.
    1. If you have already created the Bot, use /mybots command to get the Bot's API Token.
    2. To create a new Telegram Bot, click on /start and then /newbot commands. Follow the instructions and create your Telegram Bot; at the end, you will receive a Bot API Token.
  3. Copy-paste your Bot API Token on Settings.
  4. To test the connection, find your Bot on Telegram and write any message.

How to change the LiveChat Group?

You can change the LiveChat Group for the connected Telegram account on Telegram Settings.

Then click on the account you want to update, and choose the new LiveChat Group. Click "Save" to apply changes.

How to block a Telegram user?

Similarly to LiveChat Ban visitors, select the three dots icon "…" in the top right corner, and click on Ban Telegram User. In the modal, click on Block User.

How to get Telegram ID from ChatBot attributes

Once a user has started a chat with Telegram Bot, basic user information is placed in attributes. The following custom attributes are available: default_telegram_id, default_telegram_username, default_telegram_profile, default_telegram_language_code.

Deep Linking

Telegram bots have a deep linking mechanism that allows additional parameters to be passed to the bot on startup. It could be a user's token or ID from another platform.

Each bot has a link that opens a conversation with it in Telegram – https://t.me/<bot_username>. Parameters can be added directly to this link to let your bot work with additional information on the fly, without any user input. For example, you could use:

https://t.me/your_bot?start=test_parameter

Please note, that only A-Z, a-z, 0-9, _, and - are allowed.

This parameter will be visible on LiveChat customer details as telegram_start_parameter:

LiveChat Customer Details Example