Twitch Connect For Personal Site

I recommend you check out the following link, it details the process behind authenticating a user for your application (in this case, your site):
Twitch-API/authentication.md

  1. First you need to figure out where on your site they’ll be redirected back to after they approve the request you make; this is the URL you’ll need to specify it when your register your new application.
  2. Register your application. You can see some examples in your own Twitch connection settings. This is what allows your site to make the requests. If they approve your request, your application will show up in their connections list as an approved connection.
  3. When you’re ready to make the request, you’ll direct them to an api.twitch.tv URL where they confirm that they want to give your application permission to access their profile. They’ll be able to see what scopes / permissions you’re requesting access for (email, subscriptions, etc), so only request the bare minimum scopes you require (or even none if all you need is their account name).
  4. After they click the button to approve, Twitch will send them and a code back to your URL from step 1. This is just a code that approves your application to request OAuth tokens for their account; it basically just says they’ve approved your application, but doesn’t let you access any information yet.
  5. At this point, the user has done everything they need to; all API requests from this point on will be performed solely by your server. Use this code to ask the Twitch API for an OAuth token, using the code you got back.
  6. This time, you’ll get an OAuth token back; this is the code you’ll be using to actually talk to the Twitch API get their account name.
  7. You can use the OAuth token to make an API request to api.twitch.tv/kraken. You’ll get back JSON encoded data, within will be token.user_name as a string.
  8. Now that you know their Twitch username and have confirmed their identity, just look up their points in your chat bot’s database.

Obviously these are just the basic steps, you’ll still need to check the documentation (my first link at the very top) for exactly how to perform each request, as well as registering a new application with Twitch and setting up the coding on your site (keeping the user authenticated on your site throughout the process, saving the information you get back from the API, handling access between your web server and your chat bot’s database, etc.).

EDIT:
I should also note that alternatively you could handle authorizing and obtaining an OAuth key client-side with JavaScript, and finally just give the OAuth key to the server to verify their username with. There’s probably a few different good ways of doing everything; just use whatever way works best for you, and make sure it’s secure.