...
If present, this function is called whenever a message is originated by the local application using the delivery system (i.e. input from this control, standard chat window interactions (text, dice, chat output, etc.), or those added by chatwindow.deliverMessage or Comm.deliverChatMessage APIs). The following message types messages will not trigger this event: vote prompts, application system prompts, or system messagesmessages, or those added by chatwindow.addMessage or Comm.addChatMessage APIs.
Parameters
messagedata (table)
A table containing information about the message. See the chatentry description for details.
...