From Bright Pattern Documentation
Jump to: navigation, search
(Created page with "<translate> =suggestChatMessage= Places a message inside the agent’s text input field during the chat interaction. ==Request== ''Syntax'' {| class="wikitable" |suggestCha...")
 
(No difference)

Latest revision as of 13:46, 16 September 2022

• 5.19

suggestChatMessage

Places a message inside the agent’s text input field during the chat interaction.

Request

Syntax

suggestChatMessage(text: string, overwrite?: boolean, interactionId?: string): Promise<OperationResult<null>>

Parameters

Parameters Parameter Values Data Type Optional/Required Description
text String Required The message to be sent
overwrite Boolean Optional Determines whether this message will overwrite the existing one, that is, if the agent has already typed something in the field. If set to true, the existing message will be overwritten; if set to false, the existing message will not be overwritten.
interactionId String Optional The chat interaction in which the message will be placed. If the interactionId is omitted, the currently active interaction will be used.

Example Request

suggestMessageButton.onclick = () => {

        const message = chatInput.value;

        const interactionId = interactionsList[0].interactionId;

        adApi.suggestChatMessage(message, true, interactionId);

    };

Return Value

null

< Previous | Next >