This extension allow have support for telegram bot support directly in Live Helper Chat. It support sound messages, images, files.
Min 4.27v Live Helper Chat version.
- Run the command
php cron.php -s site_admin -e lhctelegram -c cron/update_structure
- Navigate to the Telegram options and activate the configuration.
- By default, HTML markdown is used for messages.
- You can enable debug mode by unchecking the
Skip
option for theTelegramIntegration
bot. - If you don't want HTML or Markdown support, you can edit the Rest API call by removing
"parse_mode":"HTML",
and change{{msg_html_nobr}}
to{{msg_url}}
.
- Clone the GitHub repository.
- Rename the cloned folder to "lhctelegram" and place it in the "extension/" directory.
- Activate the extension by adding
'lhctelegram'
to the'extensions'
array in thelhc_web/settings/settings.ini.php
file.
'extensions' =>
array (
'lhctelegram'
),
- Install the composer requirements by running:
cd extension/lhctelegram && composer.phar update
- Clean the cache in the Live Helper Chat back office.
- Execute the
doc/install.sql
on the database manager or run the command:php cron.php -s site_admin -e lhctelegram -c cron/update_structure
- Register your bot with BotFather: https://core.telegram.org/bots#6-botfather
- In the Telegram options, activate webhook configurations.
- Create a bot in the LHC back office under Modules => Telegram Settings.
- After creating the bot, click "Set webhook".
- That's it! The integration should be set up.
This feature allows you to use the Telegram bot as a gateway between chats on your website and your operators. Here's an example setup:
Example of final setup. Each customer get's it's own topic. and you can use telegram to chat with your customers directly. Files are also supported!
- After you have completed the above steps, you have to do the following changes: In LHC back office, go back to the bot editing page and choose the departments tab. Check the departments you want to receive new chats notifications for. Don't save yet.
- Create a group chat in telegram and add your bot as an admin in the group chat.
- Modify group chat settings and enable topics. Each customer will get it's own topic.
- Create a dummy topic and send a dummy message and copy url.
- Your link will look like
https://t.me/c/1634340846/3/4
and your group id will be middle number1634340846
with appended-100
so it will be like-1001634340846
as concat string-100
+1634340846
- In same tab, check the "This bot acts as a client" box. Now save.
- You can try now to run from command like
php cron.php -s site_admin -e lhctelegram -c cron/test
it will try to create a dummy topic as a bot. Please modifyextension/lhctelegram/modules/lhcron/test.php
and put your API key and bot username before running a script. - Go to LHC back office main telegram page and choose "Telegram operators". Choose Operator and Bot, or create one.
- Now start a conversation in Telegram and register yourself within bot by typing
/register <id>
. The<id>
should be registered operator id from the very first column in the operators list in LHC Modules => Telegram Settings => Telegram operators. - If you get an error message saying it can't find an operator with that ID, and the operator was just created, clean the cache and start a chat as that operator using just the website (not Telegram). Then try registering the again. It should work now.
- That's all. Just type /help to see what available commands are supported.
If you are planning only using telegram to support your site visitors. It makes sense to setup department online hours, so widget will remain always online even if you are not using default web back office.
Since 3.36v you can just set your online condition to "Always online" and you won't have to do anything else.
https://livehelperchat.com/how-to-use-telegram-if-you-are-automated-hosting-client-489a.html