Functiondiscord-component-embedv0.2.1
toComponentEmbed
Converts a <Container> tree into the JSON document Discord reads for a component embed. To write the JSON into a page, use toComponentEmbedJson or toComponentEmbedScript. Both escape it for HTML.
Throws:
a
ComponentEmbedErrorwhen the tree breaks a rule of the format, or when your own code throws while the tree is read. Checkerror.codeto see which.
toComponentEmbed(root: EmbedElement): ComponentEmbedPayloadroot
root: EmbedElement