Goal: My game is launched, broadcaster authenticates via browser, my bot joins broadcaster to read&write in chat. Either using 2 “apps” : one “Game Integration” and one “Chat Bot” or just using one app.
Problems:
request user-token with “channel:bot” scope, use that token with corresponding client-id to send chat message:
{“error”:“Unauthorized”,“status”:401,“message”:“User access token requires the user:write:chat scope.”}
If I add “user:write:chat” it appears as “write messages in your username” during user-authorization (in browser). But I want to write as the bot, not as the broadcaster!
Similar problem when I want to read (subscribe to channel:chat:message via EventSub) - it shows up as “read messages and appear in your username”. Not sure if there is a way to read messages “as a bot”?
It works when I use “user:read:chat” or “user:write:chat”. But that’ll happen in the broadcasters name and show a confusing warning during auth-flow in browser.
while “channel:bot” just shows “join your chat as a bot” - won’t that suffice? Again, I want to read and write as the bot, in the broadcasters channel.
Documentation says:
channel.chat.message
(NEW) The channel.chat.message
subscription type sends a notification when any user sends a message to a channel’s chat room.
Authorization
Requires user:read:chat
scope from the chatting user. If app access token used, then additionally requires user:bot
scope from chatting user, and either channel:bot
scope from broadcaster or moderator status.
- who is the “chatting user” ? isn’t that my bot?
- “if app access token is used…” everytime I try (or ask chatGPT) it seems like I need user-level scopes so I can’t actually use a app-access-token (via credentials, id&secret)…
I get “channel:bot” from user - it’s fine.
I don’t want to get “user:read:chat” and “user:write:chat” from user, as that looks overkill to do that in the users name.
Is there a way to achieve this?