A message received on or sent through an interaction. Discriminated
union over the type discriminator - narrow on message.type to get the
concrete subtype with its body and type-specific fields.
Example
if (message.type === MessageType.CHAT) { // message is ChatMessage; message.body is ChatMessageBody console.log(message.body.text.content); } elseif (message.type === MessageType.SYSTEM) { // message is SystemMessage; message.body is SystemMessageBody console.log(message.body.text.content); }
A message received on or sent through an interaction. Discriminated union over the
typediscriminator - narrow onmessage.typeto get the concrete subtype with its body and type-specific fields.