{"action":"created","issue":{"url":"https://api.github.com/repos/chatty/chatty/issues/91","repository_url":"https://api.github.com/repos/chatty/chatty","labels_url":"https://api.github.com/repos/chatty/chatty/issues/91/labels{/name}","comments_url":"https://api.github.com/repos/chatty/chatty/issues/91/comments","events_url":"https://api.github.com/repos/chatty/chatty/issues/91/events","html_url":"https://github.com/chatty/chatty/issues/91","id":180431307,"number":91,"title":"Support for Twitch Prime user icon","user":{"login":"lewisje","id":4865237,"avatar_url":"https://avatars.githubusercontent.com/u/4865237?v=3","gravatar_id":"","url":"https://api.github.com/users/lewisje","html_url":"https://github.com/lewisje","followers_url":"https://api.github.com/users/lewisje/followers","following_url":"https://api.github.com/users/lewisje/following{/other_user}","gists_url":"https://api.github.com/users/lewisje/gists{/gist_id}","starred_url":"https://api.github.com/users/lewisje/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lewisje/subscriptions","organizations_url":"https://api.github.com/users/lewisje/orgs","repos_url":"https://api.github.com/users/lewisje/repos","events_url":"https://api.github.com/users/lewisje/events{/privacy}","received_events_url":"https://api.github.com/users/lewisje/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-01T01:42:02Z","updated_at":"2016-10-02T00:54:40Z","closed_at":null,"body":"[👑 KappaPrime](http://arstechnica.com/gaming/2016/09/amazon-adds-twitch-perks-to-99year-prime-subscription/)"},"comment":{"url":"https://api.github.com/repos/chatty/chatty/issues/comments/250946980","html_url":"https://github.com/chatty/chatty/issues/91#issuecomment-250946980","issue_url":"https://api.github.com/repos/chatty/chatty/issues/91","id":250946980,"user":{"login":"broadstone","id":1326425,"avatar_url":"https://avatars.githubusercontent.com/u/1326425?v=3","gravatar_id":"","url":"https://api.github.com/users/broadstone","html_url":"https://github.com/broadstone","followers_url":"https://api.github.com/users/broadstone/followers","following_url":"https://api.github.com/users/broadstone/following{/other_user}","gists_url":"https://api.github.com/users/broadstone/gists{/gist_id}","starred_url":"https://api.github.com/users/broadstone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/broadstone/subscriptions","organizations_url":"https://api.github.com/users/broadstone/orgs","repos_url":"https://api.github.com/users/broadstone/repos","events_url":"https://api.github.com/users/broadstone/events{/privacy}","received_events_url":"https://api.github.com/users/broadstone/received_events","type":"User","site_admin":false},"created_at":"2016-10-02T00:54:40Z","updated_at":"2016-10-02T00:54:40Z","body":"I did some research for the author here:\r\n\r\nIn the IRC debug log, turbos still exist and are `@badges=turbo/1;`, and the new twitch prime user icon is indicated by `@badges=premium/1;`\r\n\r\nSo as in commit 9c7c9cf7a2299f7bb74ec521c11e729ffbb6f6df, where `badges.containsKey(\"turbo\")` was checked, you'll have to check for `badges.containsKey(\"premium\")` for this new state.  It is currently distinct from turbo in terms of badge iconing.\r\n\r\nThe normal API you use, https://api.twitch.tv/kraken/chat/<CHANNEL>/badges doesn't actually contain the \"premium\" badge item.\r\n\r\nThere is this undocumented API, though I'm not sure you're allowed to use it: https://badges.twitch.tv/v1/badges/global/display?language=en  It is what the webchat is using.\r\n\r\nIt was, however, publicly disclosed here: https://discuss.dev.twitch.tv/t/beta-badge-api/6388 So I assume it is permitted.\r\nIn fact, that discussion states how you can precisely use the IRC output to look up the right badge.  \"turbo/1\", as an example, is root -> \"badge_sets\" -> \"turbo\" -> \"1\" > \"image_url_1x\"\r\n\r\nIt also contains the links necessary for loading the badges for cheers (which appear to be linked to total cheer bits paid per user per channel, which appears to be broadcast using the pubsub system for total bit count). That may help with badges for issue #71.  In the case of bits, though, I haven't captured a debug instance of them happening, are probably bits/1, bits/100, or bits/1000, as there entries for each.  They'd be root -> badge_sets -> bits -> \"1000\" -> \"image_url_1x\" for example for 1000."}}
{"actor":{"display_login":"broadstone"}}