This site is no longer updated.Go to new Conversational Cloud docs

$reactions.answer


The method displays a simple text response.

Syntax

The method can accept a string or an object.

String

Specify a string that defines a text response:

$reactions.answer("Message text");

In the text response, you can use substitutions inside the {{}} brackets, which can contain any valid JavaScript expression.

$reactions.answer("Hello, {{ $client.name }}!");

Object

Apart from a string, the method also accepts an object in which, in addition to a simple response text, you can pass text with HTML or speech synthesis markup.

Argument Description Required
value Response text Yes
tts Response text with speech synthesis markup No
html Response text with HTML markup No

How to use

  • Response text with HTML markup:

    script:
        $reactions.answer({
            "value": "You won this battle!",
            "html": "<b>You won this battle!</b>"
        });

    Only the chat widget, Chat API, and Telegram support HTML markup. In other channels, the client will receive a message without formatting.

  • Response text with speech synthesis markup:

    script:
        $reactions.answer({
            "value": "141155501234",
            "tts": "<say-as interpret-as=\"telephone\">141155501234</say-as>"
        });