Registering an Application
- logon to https://dev.twitch.tv
- goto your developer console at https://dev.twitch.tv/console
- register an application
- as a redirect url enter: http://localhost:9980
- in the "Manage Application" section, note Client ID and Client Secret
Getting an Token
-
open twitcher.tox and fill in Client ID and Client Secret on the Twitch Parameter Page
-
Hit Get Token
-
In the opened up webbrowser window log onto your twitch account
-
acknowledge the permissions for the app (you can change permissions on the Permissions Parameter Page)
-
the webbrowser will close and the component will receive a oAuth and oAuth refresh token from twitch
Chat
On the Chat Parameter Page toggle the Connect Parameter. You can send messages to the selected room via the parameters on that page as well.
Messages received in the chat will be redirected to the referenced Chat Callback DAT's callback functions.
You can also call the SendMsg Method on the twitcher component to send messages:
SendMsg(channel=ChannelName, room=RoomName, msg=MessageString)
For more information on Twitch's Chat system, please read here: https://dev.twitch.tv/docs/irc
PubSub
You can Listen and Receive events under the PubSub category of the Twitch API. Enable the categories on the PubSub Parameter Page and parse received messages via the specified PubSub Callback DAT.
For more on PubSub, please read here: https://dev.twitch.tv/docs/pubsub
API Calls
API calls can be made on the old V5 API and the new Twitch API. The API Call Parameter page allows for sending API calls to any endpoint specified in the Twitch API documentation.
Do make sure that you have the right presmissions set when retrieving your oAuth token.
You can also call the APICall Method on the twitcher component to interact with the API:
APICall(v5=False, enpoint='streams', pars={'first':25})
Messages received will be processed in the referenced API Callback DAT.
For a full documentation on Twitch's API, check https://dev.twitch.tv/docs/v5 for the older V5 and https://dev.twitch.tv/docs/api for the new API.