Hi, I tried to follow and unfollow with JS, but gives me follow or remove it, could you help?
my code:
function follower(){
Twitch.api({method: 'user'}, function (error, user) {
if (error) console.log("ERROR");
var channel = "";
Twitch.api({ method: 'users/'+user.name+'/follows/channels/'+channel ,verb: 'PUT'}, function (error, response) {
if (error) console.log(error);
if(response) console.log(response);
});
});
}
function unfollow(){
Twitch.api({method: 'user'}, function (error, user) {
if (error) console.log("ERROR");
var channel = "";
Twitch.api({ method: 'users/'+user.name+'/follows/channels/'+channel ,verb: 'DELETE'}, function (error, response) {
if (error) console.log(error);
if(response) console.log(response);
});
});
}
Thx to Help! im can GET but no PUT AND DELETE!