Widget.dom
Anything that comes from a viewer (their name, their message) may contain HTML. Widget.dom draws it as
text, never as code.
Widget.dom.text(element, value): ElementSets value with textContent (never HTML) and returns the element.
renderMessage
Section titled “renderMessage”Widget.dom.renderMessage(parts): DocumentFragmentA message with its emotes as images and the rest as text, ready for append. It takes message.parts from a
chat event (or plain text).
Widget.on("Twitch.ChatMessage", (message) => { item.append(Widget.dom.renderMessage(message.parts));});Widget.dom.image(url, options?): HTMLImageElement | nullAn <img> only if the URL is from an allowed CDN (emotes, badges, cheers); otherwise null. options
accepts alt and className.