Conditions
Introduction
Conditions allows you to have predefined conditions which can be used in multiple places
Check for conditions to proceed
bot response typeChat priority
as one of the conditions
For conditions being checked they have special syntax
{condition.<condition_identifier>}
E.g {condition.is_vip}
Value after check can be either valid
or not_valid
While defining conditions it can check other conditions. E.g
Chat attributes extraction
You can extract any attribute using this modal window
Conditions explanations
These explains are valid everywhere you see conditions checking
=
or !=
as a number and string comparison
Equal condition. Has to be exact match. It can be a number comparing or string
E.g chat department identifier field is equal to my_storage
{args.chat.department.identifier} = 'my_storage'
{args.chat.chat_variables_array.pid} = 'my_pid'
{content_1} != 1
- allows checking Rest API call response.
>,>=,<,<=
as a number comparison
E.g Chat duration is more than 5 seconds
{args.chat.chat_duration} > 5
Text like
and Text not like
Internally it's called like
and notlike
These rules are defined here
E.g
{args.chat.department.name}
Text like
edas && em [params max_words=2]
I expect to find only two words where both of them should be edas
and em
If you want to match any value from list of values just do
{args.chat.nick}
Text like
remdex,vip_player
nick should be eitherremdex
orvip_player
{args.chat.dep_id}
Text like
5,8
Matches if department id is 5 or 8
Contains
Is checking if one part of the string is presented in another string.
Bot example
Usage in bot example
Bot example with buttons using conditions
Quick reply button condition looks like. We check for bot_not_answered
condition and only then we show a button.
Condition looks like
Permissions
Required permissions
'lhgenericbot','manage_conditions'