You do the oAuth flow once
This gives you a user token and a refresh token
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.