Skip to content

Commit

Permalink
update ChatLive_loadCheersChannel to use new api
Browse files Browse the repository at this point in the history
  • Loading branch information
fgl27 committed May 14, 2023
1 parent 39f145b commit 9fc452e
Show file tree
Hide file tree
Showing 2 changed files with 7,497 additions and 7,154 deletions.
16 changes: 4 additions & 12 deletions app/specific/ChatLive.js
Original file line number Diff line number Diff line change
Expand Up @@ -574,27 +574,19 @@ function ChatLive_loadCheersChannel(chat_number, id) {
if (id !== Chat_Id[chat_number]) return;

if (!extraEmotesDone.cheers[ChatLive_selectedChannel_id[chat_number]]) {
BaseXmlHttpGet(
'https://api.twitch.tv/v5/bits/actions?channel_id=' +
encodeURIComponent(ChatLive_selectedChannel_id[chat_number]) +
'&client_id=' +
AddCode_backup_client_id,
ChatLive_loadCheersChannelSuccess,
noop_fun,
chat_number,
id
);
var theUrl = Main_helix_api + 'bits/cheermotes?broadcaster_id=' + ChatLive_selectedChannel_id[chat_number];

BaseXmlHttpGet(theUrl, ChatLive_loadCheersChannelSuccess, noop_fun, chat_number, id, true);
}
}

function ChatLive_loadCheersChannelSuccess(responseText, chat_number, id) {
if (id !== Chat_Id[chat_number]) return;

cheers[ChatLive_selectedChannel_id[chat_number]] = {};
var data = JSON.parse(responseText);

try {
data.actions.forEach(function (action) {
data.data.forEach(function (action) {
cheers[ChatLive_selectedChannel_id[chat_number]][action.prefix] = {};

action.tiers.forEach(function (tier) {
Expand Down
Loading

0 comments on commit 9fc452e

Please sign in to comment.