|
|
|
@ -2,16 +2,22 @@ package main |
|
|
|
|
|
|
|
|
|
import ( |
|
|
|
|
"fmt" |
|
|
|
|
"os" |
|
|
|
|
"github.com/nicklaw5/helix/v2" |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func main() { |
|
|
|
|
debug := os.Getenv("GODEBUG") |
|
|
|
|
fmt.Printf("%v\n\n", debug) |
|
|
|
|
|
|
|
|
|
client, err := helix.NewClient(&helix.Options{ |
|
|
|
|
ClientID: "57116762594c61061237ed15fcdf0f", |
|
|
|
|
APIBaseURL: "http://127.0.0.1:8081/mock", |
|
|
|
|
AppAccessToken: "a2bc8f684ea663d", |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
if err != nil { panic(err) } |
|
|
|
|
|
|
|
|
|
resp, err := client.GetUsers(&helix.UsersParams{ |
|
|
|
@ -26,6 +32,19 @@ func main() { |
|
|
|
|
fmt.Printf("Rate limit reset: %d\n\n", resp.GetRateLimitReset()) |
|
|
|
|
|
|
|
|
|
for _, user := range resp.Data.Users{ |
|
|
|
|
fmt.Printf("ID: %s Name: %s", user.ID, user.DisplayName) |
|
|
|
|
fmt.Printf("ID: %s Name: %s\n", user.ID, user.DisplayName) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
event_resp, err := client.CreateEventSubSubscription(&helix.EventSubSubscription{ |
|
|
|
|
Type: helix.EventSubTypeStreamOnline, |
|
|
|
|
Version: "1", |
|
|
|
|
Transport: helix.EventSubTransport{ |
|
|
|
|
Method: "webhook", |
|
|
|
|
Callback: "https://fuckyou.com/follow", |
|
|
|
|
Secret: "s3cre7w0rd", |
|
|
|
|
}, |
|
|
|
|
}) |
|
|
|
|
if err != nil { panic(err) } |
|
|
|
|
|
|
|
|
|
fmt.Printf("%+v\n", event_resp) |
|
|
|
|
} |
|
|
|
|