Twitch chatbot for pogify
This package is also an API.
trigger:
!pogify
- chatbot sends a url to the currently set pogify session.
- if no session, sends nothing
Broadcaster Only
- chatbot sends
pong
in chat. - should be used to check if the chatbot is connected.
Broadcaster Only
- sets the session for a channel.
- chatbot will return a success or failure message
Broadcaster Only
- disconnects the chatbot from the chat.
Broadcaster Only
- chatbot sends the url to create a session.
- doesn't automatically create a new session (yet).
- console page for broadcasters to connect the chatbot.
- broadcasters sign in through twitch, and obtain a token
- token scope: nothing
- token is used to verify identity for chatbot api.
- once authenticated, ui allows broadcasters to connect, disconnect, and set session IDs just as they can with chat commands.
- page has one button that redirects to twitch auth.
- the callback (
/init/callback
) automatically runs identity verification and initializes the chatbot. - if the signed in account username doesn't match the one that is declared by
BOT_USERNAME
in the.env
file then the callback will error.
- callback uri for twitch auth to initialize chatbot.
All endpoints with the exception of the root /
, init /init
, and init callback /init/callback
require a authorization bearer header with an oauth token issued by this chatbot only.
- unauthenticated calls will return with status code 401.
Note: API endpoints will return with status code 503 if the chatbot has not been initialized with /init
- chatbot will join the chat of the channel specified by the oauth token.
- chatbot will leave the chat of the channel specified by the oauth token.
- API will set the session to return on a
!pogify
command.
- API will return the currently set session
- using oidc id_tokens would allow tokens issued by other client_ids to be used here as long as it's registered as a valid
aud
. However, that then means that emails are also as part of the token scope which is both unnecessary and may cause some friction for people weary about pogify asking for their email.- means that we need to request the user from the
get users
endpoint of the Twitch API. - or maybe just have a shared secret to give the pogify api a direct line into the bot.
- or maybe just use the same client_id for both the pogify api and pogify_bot?
- means that we need to request the user from the
- issue pogify tokens? (is that really necessary?)
- port to golang for the additional performance.
- migrate off of sqlite3. but also probably wouldn't use that much storage for it anyways...
- periodically disconnect inactive channels?
- how often?
- what would be the parameters to disconnect?
- if kept connected then would just always be reading chats.
- better UI.
- current ui is barebones.
tests- no fetch retry. should add
- integration tests