I need the most basic help

or

Thats rig is for Extension development, not for jumping in to the API.

Both Discord and Twitch oAuth require YOU to give Discord/Twitch the redirectURL you want to use for token exchange.

See Registration:

Discord gives you a token to use for your Bot to login, thats if you are making a bot, and set your client to be/have a bot

If you want to make a bot then we can discuss that further or check the docs:

TMI is essentially IRCv3 compatible IRC over Websockets (or the IRC port), so if you have a working IRC parser/library, again, in your language of choice (any will do it just needs a IRC or a Websockets module) you can do it in Brainfuck if you really want.

oAuth is easy, on $service make a client (for Twitch this is Twitch Developers), tell the client what your redirectURI is.

Plumb the loginRedirectURL (place you redirect a user to), tokenExchangeURL (the place you post a returned code to, to get a token), from the docs into your oAuth client/code and away you go…

Documentation for oAuth is here

It’s the same as everywhere else that implements oAuth, and you need three bits of information, two URL’s and what scopes exist…

For “standard” oAuth aka “OAuth Authorization Code Flow”

  • send user to $service aka loginRedirectURL https://id.twitch.tv/oauth2/authorize
  • user accepts (or rejects) app connection
  • user is sent to your redirectURI with a code https://<your registered redirect URI>/?code=<authorization code>
  • you exchange the code for a token, aka tokenExchangeURL https://id.twitch.tv/oauth2/token

The TwitchAPI is just an HTTP based get/post API. (Ignoring chat as thats websockets and arguable “not” API). It speaks JSON, so you just need a JSON parser, which is included in most languages these days, and/or writing your own (de)serializer is childs play in your language of choice.

For example, you can use a command line curl client:

This gets information about the most active streams for game ID 33214.

curl -H 'Client-ID: p0gch4mp101fy451do9uod1s1x9i4a' \
-X GET 'https://api.twitch.tv/helix/streams?game_id=33214'

You can use whatever language you want as long as it can make a cURL/web request. Language is completely irrelevant.

Since you cited Discord I can link two a couple of libraries that are nodeJS based that can help, but then it’s just a “dumb” cURL client wrapped in a helper function. Personally I don’t bother, I generally just write out the cURL requests and use nodeJS request module to make them.

What are you trying to do, you’ve touched on about three or four wildly different things in your post.