onMessageSent Event Listener problem

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?

The code most likely works in spite of the error message. The error you are getting is really just a Typescript (code parsing mechanism) syntax notification. Is your code not working?

If you feel that there is a bug, then your question should be directed to Wix Customer Care . Understand that this forum is not a support site, and is not monitored for bugs or system issues. Please report bugs to Wix Customer Care to ensure timely handling of your problem. They track and monitor all incoming issues and will escalate bugs to product teams.

Hi Yisrael - appreciate your response & suggestion. The code is not working. Let me write to Wix Customer Care. Thank you very much.

I’m struggling with the same issue. Did you find a solution?

I didn’t find a solution yet.