You need to do this using a token that belongs to 534869164
From the descriptions this appears to be the correct direction. So the error suggests theres something wrong with your token as in it’s of the wrong type.
The validate endpoint will confirm the scopes and if it’s of type “user”
To be honest, I’m a bit stunned on how I’m supposed to retrieved a token from a backend.
So far, it was done by having the game pop a webbrowser to login in Twitch.
And yes, the bot will always be Irid Novo. It’s the name of the space station in the game.
or the game links to your backend and the streamers can link their account via your website, and the game just loads up that association. (borderlands does this, you login to shift in game, and on the shift website outside of the game you link shift to twitch for example)
Or they might just need the broadcasters channel name, so you could just use a blank text field and ask the streamer for their name, then you don’t need oAuth at all.
Sorry, I’m not talking about the streamer. That’s fine, it works. I get the token of the streamers easily using the method of linking to a website after login in Twitch and accepting the scopes.
I’m talking about the chatbot. How do I get a token for the chatbot without having to manually login everytime I need the bot to be up and running?
Store both, then use the refresh token to get a new token when that first token expires.
The token is only checked for validity when the bot logs into chat.
So
bot service boots,
uses the refresh token to get a new token
store the new refresh token if one is returned
logs into chat using that token
So you use the refresh token to get a new token when the bot connects to chat. (since a normal user token only last four hours)
The bot would run on your server, the game will talk to the server, and tell the server to tell the bot to send a message.
The game wouldn’t login to chat itself.
Backend storing token and refreshing and handling all that… Good thing I was already doing that for streamers with a SQL database. Created a “fake” user that get logged in anytime a real player does.