Skip to content

Commit b041d86

Browse files
author
Your Name
committed
Update docs
1 parent eae46aa commit b041d86

File tree

13 files changed

+242
-10
lines changed

13 files changed

+242
-10
lines changed

docs/bot/check-conditions.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,14 @@ One of the few possible scenarios can be
4040
* `{{args.chat.online_user.previous_chat.id}} > 0` and use that condition to check did visitor had chat before with you.
4141
* `{args.msg.msg}` OR `{args.chat.last_message}` check against last visitor message.
4242
* `media_type` you can check this way was uploaded file or not. In right part just enter extensions `jpg,png,jpeg,gif` and as a comparison variable choose `In list, items separated by ||`
43+
* `custom_schedule` E.g `2,12:30-13:00;1,12:30-14:00` it will be valid on Monday and Tuesday within specific time ranges. You can use with `=` and `!=` comparable operators. E.g `custom_schedule = 1` (Schedule matches) or `custom_schedule != 1` (Schedule does not match). More examples:
44+
45+
```
46+
1-5,11:00-20:00 - Monday to Friday, 11:00 to 20:00
47+
6-7,11:00-19:00 - Saturday to Sunday, 11:00 to 19:00
48+
1,10:00-18:00 - Monday only, 10:00 to 18:00
49+
7,09:00-17:00 - Sunday only, 09:00 to 17:00
50+
```
4351

4452
If you do not enter `Value` means it's empty.
4553

docs/bot/conditions.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,16 @@ This is extremely useful in case you have a bot and to migrate some of its flows
8787
* You can use E.g `is_lt_user` to expecting condition to be valid
8888
* You can use E.g `-is_lt_user` (`-`) prefix for expecting condition to be invalid
8989

90+
## Date range use case
91+
92+
You can have conditions which work based on date
93+
94+
![](/img/bot/conditions/conditions.jpg)
95+
96+
After you have a defined condition, you can use it in trigger
97+
98+
![](/img/bot/conditions/conditions-trigger.jpg)
99+
90100
## Bot Example
91101

92102
Example usage in a bot:

docs/bot/image-file-verification-flow.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,21 @@ We will listen to `file.verify_img_file` event as it's dispatched once image nee
6363

6464
![](/img/bot/moondream/webhook.jpg)
6565

66-
## Permissions
66+
## Sample flow using OpenAI
67+
68+
### Rest API
69+
70+
* Import [Rest API](/img/bot/open-ai-image-verification/rest-api.json) and change `YOUR_API_KEY` in `Authorization` section with your own API key.
71+
72+
### Bot setup
73+
74+
* Import [Bot](/img/bot/open-ai-image-verification/bot.json). Choose in bot import window just imported Rest API
75+
76+
### Webhook setup
77+
78+
We will listen to `file.verify_img_file` event as it's dispatched once image needs verification.
79+
80+
# Permissions
6781

6882
Operator MUST have `lhfile,verify_file` permission to check verification of file access.
6983

@@ -121,6 +135,8 @@ They are identical to chat permissions so same flow applies
121135
122136
> `lhmailconv,can_download` - this permission should be removed from operators as it allows to download raw eml content which includes images themself.
123137
138+
> `lhmailconv,download_restricted` - this permission allows to download file if file extension is one of the restricted ones. `Mail conversations options => File download restrictions`
139+
124140
### Debugging
125141

126142
* Request from Rest API for chat calls will be logged under message ID. Use `Object ID` field and enter Message ID. Message ID you can find by expanding message details and you will see `Message ID: <number>` field.

docs/bot/sentiment-analysis-per-message.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,9 @@ We are currently interested in the following events:
141141

142142
* `chat.web_add_msg_admin`: Listens for operator messages and sets the sentiment.
143143
* `chat.chat_started`: Listens for the first visitor message.
144-
* `chat.addmsguser`: Listens for visitor messages.
144+
* `chat.addmsguser`: Listens for visitor messages (web widget).
145145
* `chat.close`: Summarizes the sentiment based on chat messages.
146+
* `chat.addmsguser_webhook`: Listens for visitor messages (incoming webhook).
146147

147148
![](/img/bot/sentiment-per-message/webhooks.png)
148149

docs/bot/text.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ Text message can have few sending options
2727
* `{good_morning_monday__Good morning monday__t[7:9]||1}` show this message only on Monday
2828
* `{good_morning_tue_wed__Good morning monday__t[7:9]||2,3}` show this message only on Tuesday and Wednesday
2929
* You can give random answer by separating messages by `|||` or just clicking ![](/img/bot/new-variation.png)
30+
* It has to be as a separate character from the new line
31+
* Or wrap it with spaces so it won't be included in any other parsing tags.
3032

3133
First message part before text message is text identifier and can be used to translating messages to multiple languages.
3234

docs/chat/offline.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,8 @@ The email and offline request will be assigned to the very first defined departm
183183

184184
* `{args.input_data.*}` - hold direct visitor entered data.
185185
* `{args.chat.phone}, {args.input_data.email}, {args.input_data.username}` - if you are prefilling variables via JS it will be overridden by it. So it won't hold visitor entered data. If you are not prefilling vars via JS it's safe just to use `{args.chat.*`
186+
* `{args.chatprefil.*}` - holds original chat data
187+
* `{args.chat.*}` - holds chat data where it's data is set from visitor entered data.
186188

187189
Sample of offline chat message content
188190

docs/hooks.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -843,6 +843,21 @@ erLhcoreClassChatEventDispatcher::getInstance()->dispatch('chat.unread_chat',arr
843843
erLhcoreClassChatEventDispatcher::getInstance()->dispatch('chat.addmsguser',array('files' => $files, 'chat' => & $chat, 'msg' => & $msg));
844844
```
845845

846+
### chat.addmsguser_webhook
847+
**File:** https://github.com/LiveHelperChat/livehelperchat/commit/0dbda405f4e9fb6adc379c345788a23fcdd80848
848+
**Purpose:** Triggered when a user adds a message via incoming webhook.
849+
850+
```php
851+
erLhcoreClassChatEventDispatcher::getInstance()->dispatch('chat.addmsguser_webhook', array(
852+
'chat' => & $chat,
853+
'msg' => $msg,
854+
'source' => 'webhook',
855+
'webhook' => & $incomingWebhook,
856+
'webhook_data' => $payloadAll,
857+
'webhook_msg' => $payloadMessage
858+
));
859+
```
860+
846861
### chat.auto_responder_triggered
847862
**File:** https://github.com/LiveHelperChat/livehelperchat/tree/cf4ff02ac116cc7b99f8192bb6d7a378c3a31aec/lhc_web/modules/lhchat/addmsguser.php
848863
**Line:** 126

docs/integrating/slack-notification.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ This guide explains how to send a Slack notification when a visitor sends a mess
99

1010
## How does it work?
1111

12-
* Set up a webhook in `Home > System configuration > Webhooks` for the `chat.addmsguser` event.
12+
* Set up a webhook in `Home > System configuration > Webhooks` for the `chat.addmsguser` (web widget) and `chat.addmsguser_webhook` (incoming webhook) event.
1313
* Create a bot and define the keyword to listen for.
1414
* Configure the bot to execute a REST API call to send the Slack notification.
1515

116 KB
Loading
47.3 KB
Loading

0 commit comments

Comments
 (0)