So, I am trying to change the channel title and game from my tmi.js application. I have tried doing everything from this:
function putItem()
{
client.api({
url: "https://api.twitch.tv/kraken/channels/[My Channel Id]",
method: "PUT",
headers: {
"Accept": "application/vnd.twitchtv.v5+json",
"Authorization": "OAuth [My Access Token]",
"Client-ID": "[My Client ID]",
"Content-Type": "application/json"
},
body: {"channel": {"status": "The Finalest of Fantasies", "game": "Final Fantasy XV", "channel_feed_enabled": true}},
json: true
}, function(err, res, body) {
console.log(body);
});
}
To this:
function putItem()
{
client.api({
url: "https://api.twitch.tv/kraken/channels/[My Channel Id]",
method: "PUT",
headers: {
"Accept": "application/vnd.twitchtv.v5+json",
"Authorization": "OAuth [My Access Token]",
"Client-ID": "[My Client ID]"
},
body: "channel[status]=Playing+cool+new+game!&channel[game]=Diablo"
}, function(err, res, body) {
console.log(body);
});
}
And yes, [My Channel ID], [My Client ID] were not placeholders, I censored them out for this post.
My Twitch API request still responds with data, but the data was not changed the way I wanted it. It was returning what I previously had, and it wasnât being changed on my channel, either. It did respond with the previous status and game data, which was not Diablo or Final Fantasy. How do I correctly use this API?
thanks been trying to figure this out for two days, I initially started to use request but was told not to by my friend cause client.api was the same but apparently the method isnât.