I am using the onMessageSent( ) event listener of Chatbox element to capture the message (through program) sent by the site visitor using the WixChat chatbox in my site. The program snippet provided ‘velo’ (https://www.wix.com/velo/reference/$w/chatbox) for using the ‘event listener’ is as below:
$w(“#myChatbox”).onMessageSent((message) => {
const channelId = message.channelId;
const messageText = message.payload.text;
});
However when I using the above snippet I am getting following error:-
Parameter ‘message’ implicitly has an ‘any’ type, but a better type may be inferred from usage.
Argument of type ‘(message: any) => void’ is not assignable to parameter of type ‘Message’. Type ‘(message: any) => void’ is missing the following properties from type ‘Message’: channelId, type, summary, participantId, and 2 more.
Request support to resolve the issue?