diff options
| author | ilotterytea <iltsu@alright.party> | 2025-10-11 20:12:23 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2025-10-11 20:12:23 +0500 |
| commit | d680e3d9566c622c16f299c3399b5668b9b34cb0 (patch) | |
| tree | 860b42339e838cda087d053135e2df84a34b85e8 /cmd | |
| parent | cc40d94b3edb6ab22954e20d9ca0ddd66dcacf3b (diff) | |
feat: connect to twitch
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/statsbot/main.go | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/cmd/statsbot/main.go b/cmd/statsbot/main.go index c048119..4e4ac77 100644 --- a/cmd/statsbot/main.go +++ b/cmd/statsbot/main.go @@ -1,7 +1,25 @@ package main -import "fmt" +import ( + "log" + + "github.com/gempir/go-twitch-irc" +) func main() { - fmt.Println("hello world") + client := twitch.NewClient("justinfan65432", "12345") + + client.OnConnect(func() { + log.Println("Connected to Twitch IRC!") + }) + + client.OnNewMessage(func(channel string, user twitch.User, message twitch.Message) { + log.Printf("Message: %s\n", message.Text) + }) + + client.Join("forsen") + + if err := client.Connect(); err != nil { + log.Panicf("Failed to connect Twitch IRC: %v\n", err) + } } |
