sendMessage()
This function allows you to programatically send messages on behalf of the user. You can either prefill the message box and allow the user to click send, or you can prefill and automatically send the message. Here is the function API and some example usage:
/**
* Sends a message regardless of whether the chat is expanded or collapsed
* @param message- message to be sent
* @param autoSend(optional) - whether the message should be sent automatically or not
*/
export const sendMessage = async (message: string, autoSend?: boolean): Promise<void>;
const someFunction = () => {
// Prefill a message
sendMessage('Hey I need help!');
// Prefill and automatically send a message
sendMessage('Hey I need help!', true);
}