This is an example of how to get the broadcaster subscriptions.
client, err := helix.NewClient(&helix.Options{
ClientID: "your-client-id",
UserAccessToken: "your-user-access-token",
})
if err != nil {
// handle error
}
resp, err := client.GetSubscriptions(&helix.SubscriptionsParams{
BroadcasterID: "29776980",
})
if err != nil {
// handle error
}
fmt.Printf("%+v\n", resp)
This is an example of how to check if a user is subscribed to a broadcaster.
client, err := helix.NewClient(&helix.Options{
ClientID: "your-client-id",
UserAccessToken: "your-user-access-token",
})
if err != nil {
// handle error
}
resp, err := client.CheckUserSubscription(&helix.UserSubscriptionsParams{
BroadcasterID: "29776980",
UserID: "145328278",
})
if err != nil {
// handle error
}
fmt.Printf("%+v\n", resp)