This is an example of how to search channels. Here we are requesting the first two streams from the English language. SearchChannels returns live as well as offline channels.
client, err := helix.NewClient(&helix.Options{
ClientID: "your-client-id",
})
if err != nil {
// handle error
}
resp, err := client.SearchChannels(&helix.SearchChannelsParams{
First: 2,
Language: []string{"en"},
})
if err != nil {
// handle error
}
fmt.Printf("%+v\n", resp)
This is an example of how to get channel informations.
client, err := helix.NewClient(&helix.Options{
ClientID: "your-client-id",
})
if err != nil {
// handle error
}
resp, err := client.GetChannelInformation(&helix.GetChannelInformationParams{
BroadcasterID: "123456",
})
if err != nil {
// handle error
}
fmt.Printf("%+v\n", resp)
This is an example of how to modify channel informations.
The Delay
param is a Twitch Partner feature.
client, err := helix.NewClient(&helix.Options{
ClientID: "your-client-id",
})
if err != nil {
// handle error
}
resp, err := client.EditChannelInformation(&helix.EditChannelInformationParams{
BroadcasterID : "123456",
GameID : "456789",
BroadcasterLanguage : "en",
Title : "Your stream title",
Delay : 0,
})
if err != nil {
// handle error
}
fmt.Printf("%+v\n", resp)