1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00
wtf/modules/twitch/client.go
2019-12-30 22:20:53 -05:00

28 lines
486 B
Go

package twitch
import (
"fmt"
"github.com/nicklaw5/helix"
)
type Twitch struct {
client *helix.Client
}
func NewClient(clientId string) *Twitch {
client, err := helix.NewClient(&helix.Options{
ClientID: clientId,
})
if err != nil {
fmt.Println(err)
}
return &Twitch{client: client}
}
func (t *Twitch) TopStreams(params *helix.StreamsParams) (*helix.StreamsResponse, error) {
if params == nil {
params = &helix.StreamsParams{}
}
return t.client.GetStreams(params)
}