Telegram integration via your own bot

Contents


Telegram is a popular instant messaging service that can be integrated with Usedesk to receive your customers' messages.

The integration allows you to receive and respond to messages in the Usedesk chat room. This integration is free.

Configuring integration

For configuration:

1. Go to «Extensions» section and make sure that the Telegram extension is enabled.


2. Get in Telegram token for integration:
  • Go to Telegram and find the bot named @BotFather;


  • Press /start;


  • select /newbot;


  • think up, and send the name of the bot;


  • If the bot accepts the name, enter the username. The main thing is to have a bot or _bot at the end of the name;


  • @BotFather will send a message with a token of your bot. Copy it.


3. Go to the «Channels» section and click «Add Channel».



4. Click on Telegram.


5. Add the previously copied token and press «Save».


6. If your bot is going to be added to groups, it must have rights to messages in the Telegram chat. To do this, in the bot settings in BotFather, in the «Allow groups?» section, allow adding your bot to groups, and in the «Group Privacy» section, turn off privacy mode so that the bot can receive all messages from the group:



Done, the bot is connected! Now you can write to him to test the channel.


Integration possibilities

You can process requests from Telegram using a bot both in the «Tickets» section and in the «Chat» section. It is more convenient to communicate with clients in a chat — the interface of this section is close to the interface of the messenger, and the «Reply» and «Copy» functions are also available in it.


Processing of personal messages

To reply to any incoming or outgoing chat message, right-click on it and click «Reply»:



To copy a text message, right-click on it and click «Copy»:


Processing group chats

When adding a bot to a group, all messages from users will fall into one group chat.
In the Usedesk group chat, you will see from which participant the message came. And the response from Usedesk will fall into the general group.
  • If you don't have a client in your system, it will be created separately,
  • The nickname of the group will be pulled into the card of the group chat client.

The «Reply» and «Copy» functions are also available in group chats.


Processing comments to channel posts

The «Reply» function has one interesting and very convenient feature — you can use it to process comments to posts in your channel directly from the Usedesk.

Setting up discussions in the telegram channel

If you have already included comments to posts in the channel or you know how to do it, you can proceed to the next section.
If you have a telegram channel and you want subscribers to be able to comment on your posts and communicate with each other, you need to connect to the discussion channel — group chat.
For this:

1. Go to the channel management section in Telegram.


2. Add a group in the «Discussion» section.


3. Create a new group chat. It will be linked to your channel.


4. By default, Telegram will name the group with the name of your channel + add the word «Chat». If necessary, you can change the name and add a description of the chat. Click «Create».


5. After creating a group chat, the posts in the channel will have a «Leave a comment» function.



6. If someone leaves a comment on a post, the number of comments will be displayed under the post.



7. By clicking on the comment bar, you will see the discussion thread of the post.


Connecting the bot to the channel group chat

To process comments on your channel's posts, you need to add your bot to the channel's group chat. For this:

1. Go to the Telegram group chat management and click on «Add members».


2. In the search bar, enter the name of your bot, click on it and click «Add».


Thanks to the connected bot, comments on posts will be sent to Usedesk — in one chat from all subscribers, as when integrated with a regular group chat.

To process comments to posts, be sure to use the «Reply» function. Otherwise, your message from Usedesk will not get into the discussion under the post, but will appear only in the group chat itself.



Usedesk will show which agent responded to the client's comment via the bot. And in Telegram, the bot's name will be displayed above the response. This is what the response to the subscriber's comment looks like in the Telegram interface:


Errors

If a message fails to send, it will become an internal comment with a red background. An error message will appear in the upper right corner — it will either explain the cause of the error or offer to write to us in support to resolve the issue. Possible types of errors:

  • The message could not be sent. Please write to us at support@usedesk.com;
  • The message could not be sent: the bot is blocked.