Can someone who has some sleep recently and knows what they’re doing help me out with this problem?
I’m trying to create a script to remove lurking bots from the channel after one of our frequent gift sub givers complained about accidentally giving subs to bots. The response I’m getting from my script is that the ‘moderator:manage:banned_users’ scope is missing except it isn’t, it is in the callback script and it’s been authorized for our web app by the broadcaster - I know because I did it myself on his computer by logging in and out again on our website and the authorization update request was there and included the moderator:manage:banned_users scope.
Here’s my code - in case that is responsible for the error.
$BAN = curl_init();
$databody = array(
'user_id' => $whoID,
'reason' => 'bot',
);
$datain = array('data'=> $databody);
$data = json_encode($datain);
curl_setopt($BAN, CURLOPT_URL, "https://api.twitch.tv/helix/moderation/bans?broadcaster_id=501071947&moderator_id=501071947");
curl_setopt($BAN, CURLOPT_RETURNTRANSFER, true);
curl_setopt($BAN, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($BAN, CURLOPT_HTTPHEADER, array(
'Authorization: Bearer '.$authtoken,
'Client-Id: '.$clientid,
'Content-type: application/json',
));
curl_setopt($BAN, CURLOPT_POST,true);
curl_setopt($BAN, CURLOPT_POSTFIELDS,$data);
$BANresult = json_decode(curl_exec($BAN),true);
echo curl_error($BAN);
curl_close($BAN);
var_dump($BANresult);