I’m working on code for a chatbot application for broadcasters that would ideally be able to send messages to the broadcaster’s channel as the broadcaster.
My application currently uses the OAuth Authorization Code Grant Flow (from what I can tell) to get OAuth tokens for broadcasters and refreshes the OAuth tokens before they expire. I should theoretically always have a valid OAuth token for the broadcaster (barring disconnections on Twitch side and what not). I believe I have the correct scope/permissions when the broadcaster goes through the OAuth flow. I have tried to use a broadcaster OAuth token for connecting to Twitch chat, but I get a “Login Unsuccessful” message. I have tested this application with the chatbot Twitch account and token for that, and it works with that information, but not using the OAuth token for the broadcaster’s account.
Here’s an example of my token (quickly revoked after I got this information) and the scopes associated with it: