The WhosOnBotService handles bot clients. The WhosOn Server will auto start this service if the service is installed.
Every 10 minutes the service retrieves a list of bot users via the WhosOn HTTP interface. Any bot users will then be logged in to the WhosOn Server via the normal client interface. The WhosOn Server accepts bot logins without a password when they are connecting via IP's in the whitelist.
If a bot user is assigned to a work period the user will be logged in when their work period starts and logged out when it ends (unless it has active chats -- then it will be logged out when they end).
The Bot Service itself can be configured via the BOTSETTINGS.XML file. This is created in the WhosOn Data folder when the service first starts.
This file contains the default text strings used by some of the bot responses. It also contains the following settings:
The Bot Service is designed to integrate with 3rd party bot frameworks like Microsoft, Google etc. These will also be configured in the BOTSETTINGS.XML file or individually against each Bot User.
If no Bot framework is used then the Bot Service resonds to canned response matches in the same way that the Client 'AutoText' feature works. For each visitor message, the server scans all canned reponses for the best match -- where the canned reponse subject text matches the visitor text. Wildcard/regex can be used and the text is normalised and stemmed before comparison. If the canned response match contains an attachment then the file will be sent too.
The service also handles transfers out of the box. If the user requests a transfer or a visitor message has no match. If a Bot Framework is used then canned responses will still be checked if the bot framework did not return a response.
The WhosOn 2019 server automatically matches new visitor chat lines to canned responses. If a match is found a tag is added to the line that is sent to the operator. The Modern Client displays the suggestion to the operator -- which the operator can send by just pressing enter, or ignore by just starting typing as normal. This tag is also used by the bot service, to automatically send the response to the visitor.
Matching is done on the canned response subject -- if a subject matches the visitor line then the response will be used as the suggestion. Canned response matching by the server is done on the translated text if the visitor is chatting in a different language.
Before the server starts the matching process for a new visitor line, the line is 'normalised'. This means common
english contractions (eg whats, whos, dont, don't etc) are converted to the full words (eg what is, who is, do not
etc). Common normalisations are also performed eg, 'yeaa, yeh, gr8, thanx, plz' are converted to 'yes, yes, great,
thank you, please'. Whitespace, repeating characters, question marks, exclamations etc are removed. This means that
you should always word the
canned response subject in the normalised manner (eg use 'what is' instead of 'whats'). You do not need to include
question marks in canned response subjects.
The server will then scan all canned responses for the specific site. Any exact matches will have the highest priority, followed by:
Canned response subjects can include wildcards. For example:
Subject: Does * translation
Will match if the visitor days 'does it support translation?' or 'does WhosOn do translation?'
Canned response subjects can also be regular expressions. If a regular expression is to be used enclose the subject
in [ and ] characters. For example:
Subject: [^What is the (price|cost)]
Will match for 'what is the price?' and 'what is the cost'
The full .NET regular expression funtionality can be used. See: https://docs.microsoft.com/en-us/dotnet/standard/base-types/regular-expression-language-quick-reference.
If no exact, wildcard or regex match is found then keyword matching is performed.
All keywords will be extracted from the visitor text and all common words will be removed. The keywords will then be stemmed. Each canned response will also have a stemmed keyword list with common words removed. The canned response with the highest number of matches (in the same order) will be used.
You do not need to setup canned responses for transfer requests -- as the bot service already has the wildcard, regex matches for most transfer requests text built in. eg: .'* (can|could) i (chat|speak|talk) (with|to).*(someone|person|somebody|human|operator).*' -- matches for 'Could I chat to an operator' and 'Can I speak with someone else?'. It has a list of these for most phrase types. These are currently only in English however.
If you do want to create additional canned responses for transfers -- you should set the response to '[Transfer]' and the subject to whatever text you want to trigger it.
You can chat to the Bot via operator-to-operator chat to test responses.
During operator chats you can send the following commands to the Bot:
Bot chats can be monitored like any other. If a whisper message is sent to the bot then this text will be forwarded to the visitor.
You can also send the following commands when monitoring a Bot chat:
The bot will now login to your site and show up in the WhosOn client as a team member. You can chat to it through the client to test it out, and start some chats through the web.