museun / twitchchat

interface to the irc portion of Twitch's chat
Apache License 2.0
103 stars 22 forks source link

Emote identifiers can be strings #240

Open halzy opened 1 year ago

halzy commented 1 year ago

For example, with subscriber emotes the id is a string like: emotesv2_c9b440ae1089457fbec4bd83ce091b0a

Full Privmsg dump:

Privmsg {
    raw: "@badge-info=;badges=;client-nonce=6165e054a7a023fdc345cc99944d9090;color=#FF9CEE;display-name=GlitchButSmol;emote-only=1;emotes=emotesv2_c9b440ae1089457fbec4bd83ce091b0a:0-9/emotesv2_99e7ca82ee744cae9f54dced65ea4658:11-21/emotesv2_fb79a7ffecfc4ff89486317d0d8bd582:23-36;first-msg=0;flags=;id=d642db40-fddf-4c07-bc9d-43779f15dbdf;mod=0;returning-chatter=0;room-id=75244893;subscriber=0;tmi-sent-ts=1669989103046;turbo=0;user-id=403440621;user-type= :glitchbutsmol!glitchbutsmol@glitchbutsmol.tmi.twitch.tv PRIVMSG #mrhalzy :breade3Box icedkiSleep idlefaBlankies\r\n",
    tags: {
        "badge-info": "",
        "badges": "",
        "client-nonce": "6165e054a7a023fdc345cc99944d9090",
        "color": "#FF9CEE",
        "display-name": "GlitchButSmol",
        "emote-only": "1",
        "emotes": "emotesv2_c9b440ae1089457fbec4bd83ce091b0a:0-9/emotesv2_99e7ca82ee744cae9f54dced65ea4658:11-21/emotesv2_fb79a7ffecfc4ff89486317d0d8bd582:23-36",
        "first-msg": "0",
        "flags": "",
        "id": "d642db40-fddf-4c07-bc9d-43779f15dbdf",
        "mod": "0",
        "returning-chatter": "0",
        "room-id": "75244893",
        "subscriber": "0",
        "tmi-sent-ts": "1669989103046",
        "turbo": "0",
        "user-id": "403440621",
        "user-type": "",
    },
    name: "glitchbutsmol",
    channel: "#mrhalzy",
    data: "breade3Box icedkiSleep idlefaBlankies",
    ctcp: None,
}
Emilgardis commented 1 year ago

This is after emotes v2, with emotesv1 they didn't have this prefix. This was changed sometime in 2021, around august

~Fixing this should be easy, I think it's ok to strip the emotesv2_ prefix since it was just a way for twitch to force irc clients to use the new v2 endpoint for images.~

I retract this statement, it's ascii now :)