From Bright Pattern Documentation
(Created page with "<translate> =sendChatMessage= Sends a message on behalf of the agent during a chat interaction. ==Request== ''Syntax'' {| class="wikitable" |sendChatMessage(text: string, i...") |
(Updated via BpDeleteTranslateTags script) |
||
Line 1: | Line 1: | ||
− | + | ||
=sendChatMessage= | =sendChatMessage= | ||
Line 46: | Line 46: | ||
''Null'' | ''Null'' | ||
− | |||
− | |||
− | |||
− |
Latest revision as of 04:01, 29 May 2024
• 5.19
sendChatMessage
Sends a message on behalf of the agent during a chat interaction.
Request
Syntax
sendChatMessage(text: string, interactionId?: string): Promise<OperationResult<null>> |
Parameters
Parameters | Parameter Values | Data Type | Optional/Required | Description |
text | String | Required | The message to be sent | |
interactionId | String | Optional | The chat interaction in which the message will be sent. If the interactionId is omitted, the currently active interaction will be used. |
Example Request
sendMessageButton.onclick = () => {
const message = chatInput.value;
const interactionId = interactionsList[0].interactionId;
adApi.sendChatMessage(message, interactionId);
};
Return Value
Null