From ca8f4e194f0e9e518935a111ed048e5aedeb6746 Mon Sep 17 00:00:00 2001 From: "Zed A. Shaw" Date: Tue, 5 Aug 2025 12:31:12 -0400 Subject: [PATCH] Need to find out why GODEBUG is ignored. Trying on linux. --- Makefile | 3 +++ tools/cmd/bot/bot.go | 21 ++++++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b5ad819..8ca4635 100644 --- a/Makefile +++ b/Makefile @@ -45,3 +45,6 @@ cover_report: go tool cover -func=coverage.txt go tool cover -html=coverage.txt -o coverage.html open coverage.html + +twitch_mock: + go tool twitch-cli mock-api start -p 8081 diff --git a/tools/cmd/bot/bot.go b/tools/cmd/bot/bot.go index 4ac5431..f534518 100644 --- a/tools/cmd/bot/bot.go +++ b/tools/cmd/bot/bot.go @@ -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) }