Chatterino / chatterino2

Chat client for https://twitch.tv
MIT License
2.03k stars 446 forks source link

Display channel of emote origin in tooltips #917

Open igoresque opened 5 years ago

igoresque commented 5 years ago

Twitch sub emotes don't have links to emote page, so it would be nice to either see the channel it's from in a tooltip, or have a link to the channel you can sub to to get the emote in the place where the ffz and bttv emote links are located.

ferostarsky commented 5 years ago

Summary of this idea: "Display channel of sub emotes (or be able to click it and it will open the channel where you can get the sub emote)

I also support this feature, BTTV already has it, so when you click the emote you can see the details, see screenshot: 508YHNl

I think it is possible to do this for BTTV, because they probably parse the emote img html element:

<img class="chat-image chat-line__message--emote tw-inline-block" src="https://static-cdn.jtvnw.net/emoticons/v1/300113079/1.0" srcset="https://static-cdn.jtvnw.net/emoticons/v1/300113079/1.0 1x,https://static-cdn.jtvnw.net/emoticons/v1/300113079/2.0 2x,https://static-cdn.jtvnw.net/emoticons/v1/300113079/3.0 4x" alt="cripbTeef"> => cripbTeef

you extract the 300113079 and then you should be able from somewhere get the channel. Only solution I found fast was to use the api.twitchemotes.com but maybe that is not the best approach.

You build this request: https://api.twitchemotes.com/api/v4/emotes?id=300113079 Response: [{"code":"cripbTeef","emoticon_set":300066980,"id":300113079,"channel_id":"158374052","channel_name":"cripb"}]

and then you have the channel name and you are able to build a link to it.

I just put this solution together fast, did not scout how your code works or how you get the chat messages, probably REST calls, maybe you will be able to work with this somehow.

Keep up the good work, chatterino2 is really good. Thanks guys.

x9136 commented 6 months ago

I don't know what additional info is loaded to display sub emotes initially, but if there's a channel name, I suggest making the channel link in the same place where the 7tv emotes link is now. Only instead of "Open 7TV emote link" write "Open emote source channel".

pajlada commented 6 months ago

This looks like it might be possible with chat over eventsub

Felanbird commented 6 months ago

Almost certainly possible now, finally https://dev.twitch.tv/docs/api/reference/#get-user-emotes

actually the helix API isn't necessary for this, eventsub alone handles it