Hello, I am writing chat-bot for streamer’s chats and I need some help.I use js code from docs and I have problem with token.
In this chapter - Connecting to Twitch IRC are described two ways to get token. I need get token through API.
At first I was trying to get a token by OAuth Client Credentials Flow - it is familiar to me because I am sending many requests in “server-to-server” mode. But in this case when I send request:
POST https://id.twitch.tv/oauth2/token? client_id=<my_client_id>&client_secret=
<my_client_secret>&grant_type=client_credentials&scope=user_subscriptions user_read chat:edit
chat:read channel:moderate whispers:read whispers:edit channel_editor
I get usual response with access_token, I use this access_token for connecting to chat, but I always get error - “Login unsuccessful”
But if I use OAuth Authorization Code Flow via example I get a valid token and I can work with chat-bot. This way works great - have no questions. But it is uncomfortable - I need to open web-page and go to twitch-auth then redirect back to page.
My purpose is to get a token by “server-to-server” way. Is it possible for chat/irc?