From 82626346cee93fe2f8b398c1e3d4710126559ccb Mon Sep 17 00:00:00 2001 From: lyx0 <66651385+lyx0@users.noreply.github.com> Date: Sat, 4 Jun 2022 02:29:05 +0200 Subject: [PATCH] use go-twitch-irc v3 instead --- cmd/bot/main.go | 17 +++++++++++++---- go.mod | 2 +- go.sum | 4 ++-- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/cmd/bot/main.go b/cmd/bot/main.go index 56e789c..7f0b77b 100644 --- a/cmd/bot/main.go +++ b/cmd/bot/main.go @@ -5,7 +5,7 @@ import ( "log" "os" - "github.com/gempir/go-twitch-irc/v2" + "github.com/gempir/go-twitch-irc/v3" "github.com/joho/godotenv" ) @@ -32,8 +32,8 @@ func main() { log.Fatal("Error loading .env file") } - cfg.botUsername = os.Getenv("TWITCH_USER") - cfg.botOauth = os.Getenv("TWITCH_OAUTH") + cfg.botUsername = os.Getenv("BOT_USER") + cfg.botOauth = os.Getenv("BOT_OAUTH") logger := log.New(os.Stdout, "", log.Ldate|log.Ltime) @@ -44,5 +44,14 @@ func main() { logger: logger, } - app.twitchClient.Connect() + app.twitchClient.Join("nourylul") + app.twitchClient.Join("nourybot") + + app.twitchClient.Say("nourylul", "xd") + app.twitchClient.Say("nourybot", "xd") + + err = app.twitchClient.Connect() + if err != nil { + panic(err) + } } diff --git a/go.mod b/go.mod index 16fcf91..7a4f2ca 100644 --- a/go.mod +++ b/go.mod @@ -3,6 +3,6 @@ module github.com/lyx0/nourybot go 1.17 require ( - github.com/gempir/go-twitch-irc/v2 v2.8.1 + github.com/gempir/go-twitch-irc/v3 v3.1.0 github.com/joho/godotenv v1.4.0 ) diff --git a/go.sum b/go.sum index dc267dc..67e7216 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,4 @@ -github.com/gempir/go-twitch-irc/v2 v2.8.1 h1:M0Rt2ODGPEk33+UEwv2XSrnGMMwVyUoBt+MNI3ZVf8c= -github.com/gempir/go-twitch-irc/v2 v2.8.1/go.mod h1:120d2SdlRYg8tRnZwsyNPeS+mWPn+YmNEzB7Bv/CDGE= +github.com/gempir/go-twitch-irc/v3 v3.1.0 h1:bUVZ5mADhH7KidJVcl+z79kgLJ7sjdAk4b/ylAvaLy0= +github.com/gempir/go-twitch-irc/v3 v3.1.0/go.mod h1:/W9KZIiyizVecp4PEb7kc4AlIyXKiCmvlXrzlpPUytU= github.com/joho/godotenv v1.4.0 h1:3l4+N6zfMWnkbPEXKng2o2/MR5mSwTrBih4ZEkkz1lg= github.com/joho/godotenv v1.4.0/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4=