|
|
|
@ -189,6 +189,7 @@ func twitchHTTPClient(call string, bearer string) (string, error) { |
|
|
|
|
var bearerHeader = "Bearer " + bearer |
|
|
|
|
|
|
|
|
|
req, err := http.NewRequest("GET", url, nil) |
|
|
|
|
req.Header.Add("Client-ID", ircBot.AppCredentials.ClientID) |
|
|
|
|
req.Header.Add("Authorization", bearerHeader) |
|
|
|
|
|
|
|
|
|
client := &http.Client{} |
|
|
|
@ -222,7 +223,7 @@ func TwitchAdminHandler(response http.ResponseWriter, request *http.Request) { |
|
|
|
|
} |
|
|
|
|
req.Header.Add("Client-ID", ircBot.AppCredentials.ClientID) |
|
|
|
|
req.Header.Add("Authorization", "Bearer "+ircBot.AppCredentials.Password) |
|
|
|
|
req.Header.Set("Content-Type", "application/x-www-form-urlencoded") |
|
|
|
|
req.Header.Set("Content-Type", "application/json") |
|
|
|
|
resp, err := http.DefaultClient.Do(req) |
|
|
|
|
if err != nil { |
|
|
|
|
response.WriteHeader(500) |
|
|
|
@ -277,6 +278,10 @@ func TwitchAdminHandler(response http.ResponseWriter, request *http.Request) { |
|
|
|
|
fmt.Fprint(response, usersResponse) |
|
|
|
|
fmt.Fprint(response, "\n---\n") |
|
|
|
|
fmt.Fprint(response, usersObject) |
|
|
|
|
fmt.Fprint(response, "\n---\n") |
|
|
|
|
fmt.Fprint(response, "curl -H 'Authorization: Bearer "+oauthResponse.Access_token+ |
|
|
|
|
"' -H 'Client-ID: "+ircBot.AppCredentials.ClientID+ |
|
|
|
|
" -X GET https://api.twitch.tv/users") |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|