Start bringing in Helix for a twitch bot and have notes on how to use the twitch-cli tool.
This commit is contained in:
parent
55de5155f2
commit
fd059ad3cf
5 changed files with 338 additions and 6 deletions
31
tools/cmd/bot/bot.go
Normal file
31
tools/cmd/bot/bot.go
Normal file
|
@ -0,0 +1,31 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/nicklaw5/helix/v2"
|
||||
)
|
||||
|
||||
|
||||
func main() {
|
||||
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{
|
||||
IDs: []string{"64812820"},
|
||||
Logins: []string{"marcusjill866"},
|
||||
})
|
||||
if err != nil { panic(err) }
|
||||
|
||||
fmt.Printf("Status code: %d\n", resp.StatusCode)
|
||||
fmt.Printf("Rate limit: %d\n", resp.GetRateLimit())
|
||||
fmt.Printf("Rate limit remaining: %d\n", resp.GetRateLimitRemaining())
|
||||
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)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue