I’m trying to create a chat bot using twitch-js. I generated my access token using twitchtokengenerator.com and selected all scopes for my bot account. Using chat works great, but I want to add a command to change title and game of my stream. I’m using this API request to achieve that:
api.put(‘channels/’ + channelID, { body: { channel: { status: title } }, headers: { ‘Content-Type’: ‘application/json’ } });
For some reason it always returns
{“status”:403,“message”:“Fail to auth.”,“error”:“Forbidden”,“error_code”:“error_auth_failure”}
when using my bot account.
When I generate a token for my own account it works just fine however.
Does the bot account need further authorisation?
It logs into chat using an oAuth with chat_login for the bot in order to read/write to chat as the bot user account
it auths to twitch API with a oAuth for the channel with the channel_editor for the channel owner, to read/write to the channel as the channel user account