Anyone got sendChatMessage to work?

Hi,
Using the Jitsi Meet API I want to programmatically send a message to all in a Jitsi room but sendChatMessage does not seem to work.
I tried:-

  1. api.executeCommand(‘sendChatMessage’, message:‘Hi all’, to:’’, ignorePrivacy:false);
    but I get an error with a missing ).
  2. api.executeCommand(‘sendChatMessage’, ‘Hi all’, ‘’, false); gives no error but nothing appears in the Chat.
  3. I tried a json kinda format with {} but nothing.
    Can you share a working example?
    Many thanks

Hi, Thanks but I worked it out. This works:-
api.executeCommand(‘sendChatMessage’, ‘text’, ‘’, true);
Mistake I made was to send this before the room had finished initializing. If I wait 5 secs then it works every time.

Hi, Thanks but I worked it out. This works:-
api.executeCommand(‘sendChatMessage’, ‘text’, ‘’, true);
Mistake I made was to send this before the room had finished initializing. If I wait 5 secs then it works every time.