The text itself, exactly as it appeared in Message.content.
Discriminant: plain text that the parser found no markup in.
The alt text from the markdown, or an empty string when it had none.
OptionalmimeType?: stringimage/gif when the URL itself ends in .gif, ignoring case; absent otherwise.
The check looks at the whole URL, so a query string or fragment suppresses it —
cat.gif?v=2 carries no mimeType. Video detection differs: it strips both before
looking at the extension.
URL of the image.
Discriminant: an image, from markdown image syntax such as .
The alt text from the markdown, or an empty string when it had none.
URL of the video file.
Optionalthumbnail?: stringURL of the poster image, when the thumbnail syntax supplied one.
Discriminant: a video, either from thumbnail syntax ([](video)) or from
an image whose URL ends in .mp4, .webm, .mkv, .mov, .m4v or .ogv once any
query string and fragment have been stripped.
Target of the link.
The text shown for the link.
Discriminant: a link, from markdown [label](url) or from an HTML <a href>.
One renderable piece of a message: a run of text, an image, a video or a link.
parseMessageParts splits a message's content into these, and the SDK keeps the result on Message.parts. Switch on
typewhen rendering. Anything the parser did not recognize is preserved verbatim as atextpart, in its original order, and nothing is dropped or reordered; a recognized image, video or link replaces the markup it was written as, so the parts are not a concatenation of the original string.