From f094d4c5dd054b1578fe5bd0d48cabb3044b8e47 Mon Sep 17 00:00:00 2001 From: lyx0 Date: Sat, 5 Aug 2023 20:12:07 +0200 Subject: [PATCH 1/3] upgrade to go-twitch-irc v4 --- cmd/bot/channel.go | 2 +- cmd/bot/command.go | 2 +- cmd/bot/commands.go | 2 +- cmd/bot/main.go | 2 +- cmd/bot/timer.go | 2 +- cmd/bot/user.go | 4 ++-- go.mod | 6 +++--- go.sum | 8 ++++++-- internal/commands/bttv.go | 2 +- internal/commands/bttvemotes.go | 2 +- internal/commands/coinflip.go | 2 +- internal/commands/currency.go | 2 +- internal/commands/echo.go | 2 +- internal/commands/ffz.go | 2 +- internal/commands/ffzemotes.go | 2 +- internal/commands/firstline.go | 2 +- internal/commands/followage.go | 2 +- internal/commands/lastfm.go | 2 +- internal/commands/phonetic.go | 2 +- internal/commands/ping.go | 2 +- internal/commands/preview.go | 2 +- internal/commands/seventv.go | 2 +- internal/commands/tweet.go | 2 +- internal/commands/weather.go | 2 +- internal/commands/xkcd.go | 2 +- internal/common/privs.go | 2 +- internal/common/send.go | 2 +- 27 files changed, 35 insertions(+), 31 deletions(-) diff --git a/cmd/bot/channel.go b/cmd/bot/channel.go index 6c3bf5e..b942981 100644 --- a/cmd/bot/channel.go +++ b/cmd/bot/channel.go @@ -3,7 +3,7 @@ package main import ( "fmt" - "github.com/gempir/go-twitch-irc/v3" + "github.com/gempir/go-twitch-irc/v4" "github.com/lyx0/nourybot/internal/commands/decapi" "github.com/lyx0/nourybot/internal/common" "github.com/lyx0/nourybot/internal/data" diff --git a/cmd/bot/command.go b/cmd/bot/command.go index e0bfe05..8e4db79 100644 --- a/cmd/bot/command.go +++ b/cmd/bot/command.go @@ -4,7 +4,7 @@ import ( "fmt" "strconv" - "github.com/gempir/go-twitch-irc/v3" + "github.com/gempir/go-twitch-irc/v4" "github.com/lyx0/nourybot/internal/common" "github.com/lyx0/nourybot/internal/data" ) diff --git a/cmd/bot/commands.go b/cmd/bot/commands.go index d6166d8..6c36e45 100644 --- a/cmd/bot/commands.go +++ b/cmd/bot/commands.go @@ -4,7 +4,7 @@ import ( "fmt" "strings" - "github.com/gempir/go-twitch-irc/v3" + "github.com/gempir/go-twitch-irc/v4" "github.com/lyx0/nourybot/internal/commands" "github.com/lyx0/nourybot/internal/common" ) diff --git a/cmd/bot/main.go b/cmd/bot/main.go index 7a078a4..ca48867 100644 --- a/cmd/bot/main.go +++ b/cmd/bot/main.go @@ -8,7 +8,7 @@ import ( "os" "time" - "github.com/gempir/go-twitch-irc/v3" + "github.com/gempir/go-twitch-irc/v4" "github.com/jakecoffman/cron" "github.com/joho/godotenv" _ "github.com/lib/pq" diff --git a/cmd/bot/timer.go b/cmd/bot/timer.go index 98a34b9..1862dc5 100644 --- a/cmd/bot/timer.go +++ b/cmd/bot/timer.go @@ -5,7 +5,7 @@ import ( "regexp" "strings" - "github.com/gempir/go-twitch-irc/v3" + "github.com/gempir/go-twitch-irc/v4" "github.com/lyx0/nourybot/internal/common" "github.com/lyx0/nourybot/internal/data" "github.com/redis/go-redis/v9" diff --git a/cmd/bot/user.go b/cmd/bot/user.go index 1e6cfc9..9e620b0 100644 --- a/cmd/bot/user.go +++ b/cmd/bot/user.go @@ -4,7 +4,7 @@ import ( "fmt" "strconv" - "github.com/gempir/go-twitch-irc/v3" + "github.com/gempir/go-twitch-irc/v4" "github.com/lyx0/nourybot/internal/commands" "github.com/lyx0/nourybot/internal/common" "go.uber.org/zap" @@ -46,7 +46,7 @@ func (app *Application) DebugUser(login string, message twitch.PrivateMessage) { } else { reply := fmt.Sprintf("User %v: ID %v, Login: %s, TwitchID: %v, Level: %v", login, user.ID, user.Login, user.TwitchID, user.Level) common.Send(message.Channel, reply, app.TwitchClient) - app.TwitchClient.Whisper(message.User.Name, reply) + //app.TwitchClient.Whisper(message.User.Name, reply) return } } diff --git a/go.mod b/go.mod index 65de3e3..4afcb84 100644 --- a/go.mod +++ b/go.mod @@ -5,12 +5,14 @@ go 1.20 require ( github.com/briandowns/openweathermap v0.18.0 github.com/dustin/go-humanize v1.0.0 - github.com/gempir/go-twitch-irc/v3 v3.2.0 + github.com/gempir/go-twitch-irc/v4 v4.0.0 // indirect github.com/jakecoffman/cron v0.0.0-20190106200828-7e2009c226a5 github.com/joho/godotenv v1.4.0 github.com/julienschmidt/httprouter v1.3.0 github.com/lib/pq v1.10.6 github.com/nicklaw5/helix v1.25.0 + github.com/redis/go-redis/v9 v9.0.3 + github.com/shkh/lastfm-go v0.0.0-20191215035245-89a801c244e0 go.uber.org/zap v1.21.0 ) @@ -18,8 +20,6 @@ require ( github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect github.com/golang-jwt/jwt v3.2.1+incompatible // indirect - github.com/redis/go-redis/v9 v9.0.3 // indirect - github.com/shkh/lastfm-go v0.0.0-20191215035245-89a801c244e0 // indirect go.uber.org/atomic v1.9.0 // indirect go.uber.org/multierr v1.8.0 // indirect ) diff --git a/go.sum b/go.sum index b421469..a97dc66 100644 --- a/go.sum +++ b/go.sum @@ -2,6 +2,8 @@ github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLj github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/briandowns/openweathermap v0.18.0 h1:JYTtJ4bKjXZRmDTe7huJ5+dZ7CsjPUw10GUzMASkNV8= github.com/briandowns/openweathermap v0.18.0/go.mod h1:0GLnknqicWxXnGi1IqoOaZIw+kIe5hkt+YM5WY3j8+0= +github.com/bsm/ginkgo/v2 v2.7.0 h1:ItPMPH90RbmZJt5GtkcNvIRuGEdwlBItdNVoyzaNQao= +github.com/bsm/gomega v1.26.0 h1:LhQm+AFcgV2M0WyKroMASzAzCAJVpAxQXv4SaI9a69Y= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -11,8 +13,10 @@ github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/r github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/gempir/go-twitch-irc/v3 v3.2.0 h1:ENhsa7RgBE1GMmDqe0iMkvcSYfgw6ZsXilt+sAg32/U= -github.com/gempir/go-twitch-irc/v3 v3.2.0/go.mod h1:/W9KZIiyizVecp4PEb7kc4AlIyXKiCmvlXrzlpPUytU= +github.com/gempir/go-twitch-irc/v4 v3.2.0 h1:ENhsa7RgBE1GMmDqe0iMkvcSYfgw6ZsXilt+sAg32/U= +github.com/gempir/go-twitch-irc/v4 v3.2.0/go.mod h1:/W9KZIiyizVecp4PEb7kc4AlIyXKiCmvlXrzlpPUytU= +github.com/gempir/go-twitch-irc/v4 v4.0.0 h1:sHVIvbWOv9nHXGEErilclxASv0AaQEr/r/f9C0B9aO8= +github.com/gempir/go-twitch-irc/v4 v4.0.0/go.mod h1:QsOMMAk470uxQ7EYD9GJBGAVqM/jDrXBNbuePfTauzg= github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= github.com/jakecoffman/cron v0.0.0-20190106200828-7e2009c226a5 h1:kCvm3G3u+eTRbjfLPyfsfznJtraYEfZer/UvQ6CaQhI= diff --git a/internal/commands/bttv.go b/internal/commands/bttv.go index 1247fca..143bf3e 100644 --- a/internal/commands/bttv.go +++ b/internal/commands/bttv.go @@ -3,7 +3,7 @@ package commands import ( "fmt" - "github.com/gempir/go-twitch-irc/v3" + "github.com/gempir/go-twitch-irc/v4" "github.com/lyx0/nourybot/internal/common" ) diff --git a/internal/commands/bttvemotes.go b/internal/commands/bttvemotes.go index 0534545..2180fff 100644 --- a/internal/commands/bttvemotes.go +++ b/internal/commands/bttvemotes.go @@ -1,7 +1,7 @@ package commands import ( - "github.com/gempir/go-twitch-irc/v3" + "github.com/gempir/go-twitch-irc/v4" "github.com/lyx0/nourybot/internal/commands/decapi" "github.com/lyx0/nourybot/internal/common" "go.uber.org/zap" diff --git a/internal/commands/coinflip.go b/internal/commands/coinflip.go index b050741..8de2c2f 100644 --- a/internal/commands/coinflip.go +++ b/internal/commands/coinflip.go @@ -1,7 +1,7 @@ package commands import ( - "github.com/gempir/go-twitch-irc/v3" + "github.com/gempir/go-twitch-irc/v4" "github.com/lyx0/nourybot/internal/common" ) diff --git a/internal/commands/currency.go b/internal/commands/currency.go index cee3464..6a3b008 100644 --- a/internal/commands/currency.go +++ b/internal/commands/currency.go @@ -1,7 +1,7 @@ package commands import ( - "github.com/gempir/go-twitch-irc/v3" + "github.com/gempir/go-twitch-irc/v4" "github.com/lyx0/nourybot/internal/commands/decapi" "github.com/lyx0/nourybot/internal/common" "go.uber.org/zap" diff --git a/internal/commands/echo.go b/internal/commands/echo.go index b8c0204..96090e2 100644 --- a/internal/commands/echo.go +++ b/internal/commands/echo.go @@ -1,7 +1,7 @@ package commands import ( - "github.com/gempir/go-twitch-irc/v3" + "github.com/gempir/go-twitch-irc/v4" "github.com/lyx0/nourybot/internal/common" ) diff --git a/internal/commands/ffz.go b/internal/commands/ffz.go index 6048a3d..f7be09b 100644 --- a/internal/commands/ffz.go +++ b/internal/commands/ffz.go @@ -3,7 +3,7 @@ package commands import ( "fmt" - "github.com/gempir/go-twitch-irc/v3" + "github.com/gempir/go-twitch-irc/v4" "github.com/lyx0/nourybot/internal/common" ) diff --git a/internal/commands/ffzemotes.go b/internal/commands/ffzemotes.go index dd1052e..0ff5226 100644 --- a/internal/commands/ffzemotes.go +++ b/internal/commands/ffzemotes.go @@ -1,7 +1,7 @@ package commands import ( - "github.com/gempir/go-twitch-irc/v3" + "github.com/gempir/go-twitch-irc/v4" "github.com/lyx0/nourybot/internal/commands/decapi" "github.com/lyx0/nourybot/internal/common" "go.uber.org/zap" diff --git a/internal/commands/firstline.go b/internal/commands/firstline.go index ca4fe55..679559e 100644 --- a/internal/commands/firstline.go +++ b/internal/commands/firstline.go @@ -3,7 +3,7 @@ package commands import ( "fmt" - "github.com/gempir/go-twitch-irc/v3" + "github.com/gempir/go-twitch-irc/v4" "github.com/lyx0/nourybot/internal/commands/ivr" "github.com/lyx0/nourybot/internal/common" ) diff --git a/internal/commands/followage.go b/internal/commands/followage.go index 70f2bee..683a1e9 100644 --- a/internal/commands/followage.go +++ b/internal/commands/followage.go @@ -1,7 +1,7 @@ package commands import ( - "github.com/gempir/go-twitch-irc/v3" + "github.com/gempir/go-twitch-irc/v4" "github.com/lyx0/nourybot/internal/commands/decapi" "github.com/lyx0/nourybot/internal/common" "go.uber.org/zap" diff --git a/internal/commands/lastfm.go b/internal/commands/lastfm.go index fb7a7bd..272c509 100644 --- a/internal/commands/lastfm.go +++ b/internal/commands/lastfm.go @@ -4,7 +4,7 @@ import ( "fmt" "os" - "github.com/gempir/go-twitch-irc/v3" + "github.com/gempir/go-twitch-irc/v4" "github.com/joho/godotenv" "github.com/lyx0/nourybot/internal/common" "github.com/shkh/lastfm-go/lastfm" diff --git a/internal/commands/phonetic.go b/internal/commands/phonetic.go index 682619b..1fef46f 100644 --- a/internal/commands/phonetic.go +++ b/internal/commands/phonetic.go @@ -3,7 +3,7 @@ package commands import ( "fmt" - "github.com/gempir/go-twitch-irc/v3" + "github.com/gempir/go-twitch-irc/v4" "github.com/lyx0/nourybot/internal/common" ) diff --git a/internal/commands/ping.go b/internal/commands/ping.go index 4bc8a74..9799d2c 100644 --- a/internal/commands/ping.go +++ b/internal/commands/ping.go @@ -3,7 +3,7 @@ package commands import ( "fmt" - "github.com/gempir/go-twitch-irc/v3" + "github.com/gempir/go-twitch-irc/v4" "github.com/lyx0/nourybot/internal/common" "github.com/lyx0/nourybot/internal/humanize" ) diff --git a/internal/commands/preview.go b/internal/commands/preview.go index c72167b..bb52e77 100644 --- a/internal/commands/preview.go +++ b/internal/commands/preview.go @@ -3,7 +3,7 @@ package commands import ( "fmt" - "github.com/gempir/go-twitch-irc/v3" + "github.com/gempir/go-twitch-irc/v4" "github.com/lyx0/nourybot/internal/common" ) diff --git a/internal/commands/seventv.go b/internal/commands/seventv.go index 8d01f7f..776508d 100644 --- a/internal/commands/seventv.go +++ b/internal/commands/seventv.go @@ -3,7 +3,7 @@ package commands import ( "fmt" - "github.com/gempir/go-twitch-irc/v3" + "github.com/gempir/go-twitch-irc/v4" "github.com/lyx0/nourybot/internal/common" ) diff --git a/internal/commands/tweet.go b/internal/commands/tweet.go index 59379d9..0fe75ce 100644 --- a/internal/commands/tweet.go +++ b/internal/commands/tweet.go @@ -1,7 +1,7 @@ package commands import ( - "github.com/gempir/go-twitch-irc/v3" + "github.com/gempir/go-twitch-irc/v4" "github.com/lyx0/nourybot/internal/commands/decapi" "github.com/lyx0/nourybot/internal/common" "go.uber.org/zap" diff --git a/internal/commands/weather.go b/internal/commands/weather.go index 5c1482a..9599881 100644 --- a/internal/commands/weather.go +++ b/internal/commands/weather.go @@ -5,7 +5,7 @@ import ( "os" owm "github.com/briandowns/openweathermap" - "github.com/gempir/go-twitch-irc/v3" + "github.com/gempir/go-twitch-irc/v4" "github.com/joho/godotenv" "github.com/lyx0/nourybot/internal/common" "go.uber.org/zap" diff --git a/internal/commands/xkcd.go b/internal/commands/xkcd.go index ae32071..65bd1e7 100644 --- a/internal/commands/xkcd.go +++ b/internal/commands/xkcd.go @@ -6,7 +6,7 @@ import ( "io" "net/http" - "github.com/gempir/go-twitch-irc/v3" + "github.com/gempir/go-twitch-irc/v4" "github.com/lyx0/nourybot/internal/common" "go.uber.org/zap" ) diff --git a/internal/common/privs.go b/internal/common/privs.go index 5b24718..0fc2aca 100644 --- a/internal/common/privs.go +++ b/internal/common/privs.go @@ -1,6 +1,6 @@ package common -import "github.com/gempir/go-twitch-irc/v3" +import "github.com/gempir/go-twitch-irc/v4" // ElevatedPrivsMessage is checking a given message twitch.PrivateMessage // if it came from a moderator/vip/or broadcaster and returns a bool diff --git a/internal/common/send.go b/internal/common/send.go index 6b72330..67e8a1e 100644 --- a/internal/common/send.go +++ b/internal/common/send.go @@ -8,7 +8,7 @@ import ( "log" "net/http" - "github.com/gempir/go-twitch-irc/v3" + "github.com/gempir/go-twitch-irc/v4" "go.uber.org/zap" ) From 059cc7dd4cf1b5fac480d69c37760788c61545c0 Mon Sep 17 00:00:00 2001 From: lyx0 Date: Sat, 5 Aug 2023 20:41:55 +0200 Subject: [PATCH 2/3] go mod tidy --- go.mod | 2 +- go.sum | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 4afcb84..5a33327 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.20 require ( github.com/briandowns/openweathermap v0.18.0 github.com/dustin/go-humanize v1.0.0 - github.com/gempir/go-twitch-irc/v4 v4.0.0 // indirect + github.com/gempir/go-twitch-irc/v4 v4.0.0 github.com/jakecoffman/cron v0.0.0-20190106200828-7e2009c226a5 github.com/joho/godotenv v1.4.0 github.com/julienschmidt/httprouter v1.3.0 diff --git a/go.sum b/go.sum index a97dc66..77251df 100644 --- a/go.sum +++ b/go.sum @@ -13,8 +13,6 @@ github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/r github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/gempir/go-twitch-irc/v4 v3.2.0 h1:ENhsa7RgBE1GMmDqe0iMkvcSYfgw6ZsXilt+sAg32/U= -github.com/gempir/go-twitch-irc/v4 v3.2.0/go.mod h1:/W9KZIiyizVecp4PEb7kc4AlIyXKiCmvlXrzlpPUytU= github.com/gempir/go-twitch-irc/v4 v4.0.0 h1:sHVIvbWOv9nHXGEErilclxASv0AaQEr/r/f9C0B9aO8= github.com/gempir/go-twitch-irc/v4 v4.0.0/go.mod h1:QsOMMAk470uxQ7EYD9GJBGAVqM/jDrXBNbuePfTauzg= github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= From f0ea352858df4ada24e5067ea55d9ba93d50337b Mon Sep 17 00:00:00 2001 From: lyx0 Date: Tue, 19 Sep 2023 13:31:59 +0200 Subject: [PATCH 3/3] Delete .github/workflows/codeql-analysis.yml --- .github/workflows/codeql-analysis.yml | 70 --------------------------- 1 file changed, 70 deletions(-) delete mode 100644 .github/workflows/codeql-analysis.yml diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index 70ddd2d..0000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,70 +0,0 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# -name: "CodeQL" - -on: - push: - branches: [ master ] - pull_request: - # The branches below must be a subset of the branches above - branches: [ master ] - schedule: - - cron: '23 11 * * 2' - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - matrix: - language: [ 'go' ] - # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] - # Learn more about CodeQL language support at https://git.io/codeql-language-support - - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v1 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - # queries: ./path/to/local/query, your-org/your-repo/queries@main - - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v1 - - # ℹī¸ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl - - # ✏ī¸ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language - - #- run: | - # make bootstrap - # make release - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1