Cheering emotes

Cheering is live, woo! Time to develop stuff.

An example message:

@badges=staff/1,bits/1000;bits=100;color=;display-name=mavericks_goose;emotes=;id=b34ccfc7-4977-403a-8a94-33c6bac34fb8;mod=0;room-id=23161357;subscriber=0;turbo=1;user-id=104874624;user-type=staff :mavericks_goose!mavericks_goose@mavericks_goose.tmi.twitch.tv PRIVMSG #lirik :cheer100

From here, I can see that there’s the bits badge and a new bits tag, which shows how many bits were given.

However, I also see that the emotes tag isn’t being used for parsing the cheersX emotes. Why has this been left to the client and how should I be showing these? If the bits tag is present, replace all of the cheersX words with the emotes? Just the first? Only those that add up?

1 Like

Similary findings

@badges=moderator/1,subscriber/1,turbo/1;bits=100;color=#00BFFF;display-name=Gav;emotes=;id=a51cf2d7-2de4-45cb-b250-9f21d3ffd7ee;mod=1;room-id=23161357;subscriber=1;turbo=1;user-id=20027899;user-type=mod :gav!gav@gav.tmi.twitch.tv PRIVMSG #lirik :cheer5 cheer5 cheer5 cheer5 cheer5 cheer5 cheer5 cheer5 cheer5 cheer5 cheer5 cheer5 cheer5 cheer5 cheer5 cheer5 cheer5 cheer5 cheer5 cheer5 KEK

Bits donated = 100 total, but cheer5 emotes don’t have the defined positions like the other emotes.

In terms of actual behavior (based on the web client) cheer5 does the 5 bit emote, instead of a cumulative 100 bit emote (which is fine) - but you have to manually parse each cheer5 with regex, which I thought we got rid of.

Yeah - Same thoughts …if someone only has enough for 4 cheer5 but chat message has 10 cheer5 tags, do we need to parse only the first 4?

Adding cost structure into emote parsing client side is not ideal…would like this to use the emote tag as well to take the guessing out of the picture.

1 Like

I’d also like to know if bits can be sent via oauth’d login, i feel like cheer should only be allowed with normal logins - otherwise malicious apps could suck an account dry relatively easily with a permission that wasn’t granted. (Or a new oauth permission specifically to allow bit transactions with oauth)

Yeah - Same thoughts …if someone only has enough for 4 cheer5 but chat message has 10 cheer5 tags, do we need to parse only the first 4?

That would not generate a bits tag in the first place. The sum of cheer# will be the bits amount in the tag. Any other combination won’t get sent. The inclusion of a bits=amount tag in a message validates that the message contained the correct amount, and they had enough.

2 Likes

Seconded. This is a concern.

This is now documented: https://github.com/justintv/Twitch-API/blob/master/IRC.md#bits-message

did anyone gather all hex colors for text amount after emote icon?

update
found it
[{min_bits:1,image:"gray",color:"#979797"},{min_bits:100,image:"purple",color:"#9c3ee8"},{min_bits:1e3,image:"green",color:"#1db2a5"},{min_bits:5e3,image:"blue",color:"#0099fe"},{min_bits:1e4,image:"red",color:"#f43021"}]

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.