Skip to content

Commit

Permalink
poll: Add some debug logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Rosuav committed Sep 10, 2023
1 parent f82a01e commit ad54254
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions poll.pike
Original file line number Diff line number Diff line change
Expand Up @@ -590,10 +590,17 @@ void stream_status(string name, mapping info)
multiset scopes = (multiset)(creds[1] / " ");
mapping headers = ([]);
if (scopes["moderator:read:followers"]) headers->Authorization = "Bearer " + creds[0];
mapping info = yield(twitch_api_request(sprintf(
"https://api.twitch.tv/helix/channels/followers?broadcaster_id=%d&user_id=%d",
chanid, userid), headers));
if (sizeof(info->data)) return info->data[0]->followed_at;
mixed ex = catch {
mapping info = yield(twitch_api_request(sprintf(
"https://api.twitch.tv/helix/channels/followers?broadcaster_id=%d&user_id=%d",
chanid, userid), headers));
if (sizeof(info->data)) return info->data[0]->followed_at;
};
if (ex) {
werror("ERROR IN check_following(%O, %O)\n", userid, chanid);
if (headers->Authorization) werror("Using broadcaster auth\n");
werror(describe_backtrace(ex));
}
}

//Fetch a stream's schedule, up to N events within the next M seconds.
Expand Down

0 comments on commit ad54254

Please sign in to comment.