I've been playing around with the YouTube live chat API to look render a YouTube live stream chat, but I'm stuck on how to handle emotes.
The YouTube API for live chat messages seems to only ever return the message in plain text, not metadata about emotes. This itself is fine, as there is standard syntax for emotes within the plain text, but I'm struggling with how to convert those into images.
If I look at the response I get from the YouTube API, I can see no information about the emotes beyond what is in the plain text message:
{"kind": "youtube#liveChatMessage","etag": "UaRmhczzavJeCA9S1_s8J_4MHD0","id": "LCC.CjgKDQoLd1VwYUIzYTdkVW8qJwoYVUNEWExPVjNTMEdUd21EOFY4R1A2dzlREgt3VXBhQjNhN2RVbxJFChpDT25vOHN6SW92VUNGZUFJMWdBZE85b1BfZxInQ1BhdG12UEhvdlVDRlhzNFRBb2RVSE1BeVExNjQxNjU5MDY5OTU3","snippet": {"type": "textMessageEvent","liveChatId": "Cg0KC3dVcGFCM2E3ZFVvKicKGFVDRFhMT1YzUzBHVHdtRDhWOEdQNnc5URILd1VwYUIzYTdkVW8","authorChannelId": "UC_MMOdc84fer50_SIPiPX1Q","publishedAt": "2022-01-08T16:24:28.363Z","hasDisplayContent": true,"displayMessage": ":yougotthis::elbowcough:","textMessageDetails": {"messageText": ":yougotthis::elbowcough:" } },"authorDetails": {"channelId": "UC_MMOdc84fer50_SIPiPX1Q","channelUrl": "http://www.youtube.com/channel/UC_MMOdc84fer50_SIPiPX1Q","displayName": "Blake Nolan","profileImageUrl": "https://yt3.ggpht.com/ytc/AKedOLSVNcUaOuoH49GXdG1Zlam0uBMJYJXUI5h_pHtMr-rOVr5hDnjzspewBUVqgKyw=s88-c-k-c0x00ffffff-no-rj","isVerified": false,"isChatOwner": false,"isChatSponsor": false,"isChatModerator": false }}But if I look at how this message shows up in YouTube chat, the emotes are rendered:
What am I missing to perform this lookup and conversion myself so that I can render the emotes from the chat messages?
Cheers.
