Hi,
I have been attempting to write a node.js twitch bot. I have got most of the commands i need done but am struggling with setting the game name, I have figured out how to set with the following:
if(command === 'title') {
if(isModUp) {
streamtitle = args;
streamtitle = streamtitle.toString();
streamtitle = streamtitle.replaceAll(',', ' ');
headers = {
'Authorization':'Bearer OAUTH HERE',
'Client-Id':'CLIENT ID HERE',
'Content-Type':'application/json'
};
data = {
'title':`${streamtitle}`
};
axios.patch('https://api.twitch.tv/helix/channels?broadcaster_id=123393473', data, {'headers':headers});
}else{
};
};
Basically im am struggling to find what to put inside the data variable to set game.
is it game, gamename etc
e.g. when i try the following:
if(command === 'game') {
if(isModUp) {
gametitle= args;
gametitle= gametitle.toString();
gametitle= gametitle.replaceAll(',', ' ');
headers = {
'Authorization':'Bearer 2mipvcn5skx2xf8n4rzv9t0zpf8vx0',
'Client-Id':'pv288tr1yt623898ifv8vmqzl62pzb',
'Content-Type':'application/json'
};
data = {
'game':`${gametitle}`
};
axios.patch('https://api.twitch.tv/helix/channels?broadcaster_id=123393473', data, {'headers':headers});
}else{
};
};
i get “AxiosError: Request failed with status code 401”
Thank you