class Caridina::Events::Message::Content
- Caridina::Events::Message::Content
- Reference
- Object
Overview
Represents a m.room.message event's content.
This event's content can have different fields according to its field
#msgtype
.
Each available content is represent by its own type.
To know which message event you are dealing with, you can use a case clause
over the content's type.
case event.content
when Caridina::Events::Message::Text
# handle a message
when Caridina::Events::Message::MSC2676::Text
# handle a message edit
when Caridina::Events::Message::Unknown
# Unknown message type, but you can still inspect `event.content.body` and
# `event.content.msgtype`.
else
# fallback
end
Included Modules
- JSON::Serializable