From 76c78dfbb1a7b4781311fcd7c2d392b5a92eb0d8 Mon Sep 17 00:00:00 2001 From: lyx0 <66651385+lyx0@users.noreply.github.com> Date: Wed, 4 Jan 2023 15:32:17 +0100 Subject: [PATCH] refactor from pkg to internal --- cmd/bot/channel.go | 4 ++-- cmd/bot/command.go | 2 +- cmd/bot/commands.go | 4 ++-- cmd/bot/main.go | 2 +- cmd/bot/timer.go | 2 +- cmd/bot/user.go | 4 ++-- {pkg => internal}/commands/bttv.go | 2 +- {pkg => internal}/commands/bttvemotes.go | 4 ++-- {pkg => internal}/commands/coinflip.go | 2 +- {pkg => internal}/commands/currency.go | 4 ++-- {pkg => internal}/commands/decapi/bttvemotes.go | 0 {pkg => internal}/commands/decapi/currency.go | 0 {pkg => internal}/commands/decapi/ffzemotes.go | 0 {pkg => internal}/commands/decapi/followage.go | 0 {pkg => internal}/commands/decapi/tweet.go | 0 {pkg => internal}/commands/decapi/types.go | 0 {pkg => internal}/commands/decapi/userid.go | 0 {pkg => internal}/commands/echo.go | 2 +- {pkg => internal}/commands/ffz.go | 2 +- {pkg => internal}/commands/ffzemotes.go | 4 ++-- {pkg => internal}/commands/firstline.go | 4 ++-- {pkg => internal}/commands/followage.go | 4 ++-- {pkg => internal}/commands/ivr/firstline.go | 0 {pkg => internal}/commands/ivr/randomquote.go | 0 {pkg => internal}/commands/ping.go | 4 ++-- {pkg => internal}/commands/preview.go | 2 +- {pkg => internal}/commands/seventv.go | 2 +- {pkg => internal}/commands/tweet.go | 4 ++-- {pkg => internal}/commands/weather.go | 2 +- {pkg => internal}/commands/xkcd.go | 2 +- {pkg => internal}/common/counter.go | 0 {pkg => internal}/common/privs.go | 0 {pkg => internal}/common/random.go | 0 {pkg => internal}/common/send.go | 0 {pkg => internal}/common/uptime.go | 0 {pkg => internal}/humanize/time.go | 0 36 files changed, 31 insertions(+), 31 deletions(-) rename {pkg => internal}/commands/bttv.go (84%) rename {pkg => internal}/commands/bttvemotes.go (76%) rename {pkg => internal}/commands/coinflip.go (88%) rename {pkg => internal}/commands/currency.go (79%) rename {pkg => internal}/commands/decapi/bttvemotes.go (100%) rename {pkg => internal}/commands/decapi/currency.go (100%) rename {pkg => internal}/commands/decapi/ffzemotes.go (100%) rename {pkg => internal}/commands/decapi/followage.go (100%) rename {pkg => internal}/commands/decapi/tweet.go (100%) rename {pkg => internal}/commands/decapi/types.go (100%) rename {pkg => internal}/commands/decapi/userid.go (100%) rename {pkg => internal}/commands/echo.go (78%) rename {pkg => internal}/commands/ffz.go (84%) rename {pkg => internal}/commands/ffzemotes.go (75%) rename {pkg => internal}/commands/firstline.go (77%) rename {pkg => internal}/commands/followage.go (78%) rename {pkg => internal}/commands/ivr/firstline.go (100%) rename {pkg => internal}/commands/ivr/randomquote.go (100%) rename {pkg => internal}/commands/ping.go (79%) rename {pkg => internal}/commands/preview.go (90%) rename {pkg => internal}/commands/seventv.go (84%) rename {pkg => internal}/commands/tweet.go (76%) rename {pkg => internal}/commands/weather.go (97%) rename {pkg => internal}/commands/xkcd.go (96%) rename {pkg => internal}/common/counter.go (100%) rename {pkg => internal}/common/privs.go (100%) rename {pkg => internal}/common/random.go (100%) rename {pkg => internal}/common/send.go (100%) rename {pkg => internal}/common/uptime.go (100%) rename {pkg => internal}/humanize/time.go (100%) diff --git a/cmd/bot/channel.go b/cmd/bot/channel.go index 81852fb..6c3bf5e 100644 --- a/cmd/bot/channel.go +++ b/cmd/bot/channel.go @@ -4,9 +4,9 @@ import ( "fmt" "github.com/gempir/go-twitch-irc/v3" + "github.com/lyx0/nourybot/internal/commands/decapi" + "github.com/lyx0/nourybot/internal/common" "github.com/lyx0/nourybot/internal/data" - "github.com/lyx0/nourybot/pkg/commands/decapi" - "github.com/lyx0/nourybot/pkg/common" ) // AddChannel takes in a channel name, then calls GetIdByLogin for the diff --git a/cmd/bot/command.go b/cmd/bot/command.go index 4068cf3..47c5348 100644 --- a/cmd/bot/command.go +++ b/cmd/bot/command.go @@ -5,8 +5,8 @@ import ( "strconv" "github.com/gempir/go-twitch-irc/v3" + "github.com/lyx0/nourybot/internal/common" "github.com/lyx0/nourybot/internal/data" - "github.com/lyx0/nourybot/pkg/common" ) // AddCommand takes in a name parameter and a twitch.PrivateMessage. It slices the diff --git a/cmd/bot/commands.go b/cmd/bot/commands.go index 1ba88cc..18f41f9 100644 --- a/cmd/bot/commands.go +++ b/cmd/bot/commands.go @@ -4,8 +4,8 @@ import ( "strings" "github.com/gempir/go-twitch-irc/v3" - "github.com/lyx0/nourybot/pkg/commands" - "github.com/lyx0/nourybot/pkg/common" + "github.com/lyx0/nourybot/internal/commands" + "github.com/lyx0/nourybot/internal/common" ) // handleCommand takes in a twitch.PrivateMessage and then routes the message to diff --git a/cmd/bot/main.go b/cmd/bot/main.go index 4c9d213..8a4b416 100644 --- a/cmd/bot/main.go +++ b/cmd/bot/main.go @@ -11,8 +11,8 @@ import ( "github.com/jakecoffman/cron" "github.com/joho/godotenv" _ "github.com/lib/pq" + "github.com/lyx0/nourybot/internal/common" "github.com/lyx0/nourybot/internal/data" - "github.com/lyx0/nourybot/pkg/common" "github.com/nicklaw5/helix" "go.uber.org/zap" ) diff --git a/cmd/bot/timer.go b/cmd/bot/timer.go index d14ab45..c7148e9 100644 --- a/cmd/bot/timer.go +++ b/cmd/bot/timer.go @@ -6,8 +6,8 @@ import ( "strings" "github.com/gempir/go-twitch-irc/v3" + "github.com/lyx0/nourybot/internal/common" "github.com/lyx0/nourybot/internal/data" - "github.com/lyx0/nourybot/pkg/common" ) // AddTimer slices the message into relevant parts, adding the values onto a diff --git a/cmd/bot/user.go b/cmd/bot/user.go index 6a71b1c..a3c2a13 100644 --- a/cmd/bot/user.go +++ b/cmd/bot/user.go @@ -5,9 +5,9 @@ import ( "strconv" "github.com/gempir/go-twitch-irc/v3" + "github.com/lyx0/nourybot/internal/commands/decapi" + "github.com/lyx0/nourybot/internal/common" "github.com/lyx0/nourybot/internal/data" - "github.com/lyx0/nourybot/pkg/commands/decapi" - "github.com/lyx0/nourybot/pkg/common" ) // AddUser calls GetIdByLogin to get the twitch id of the login name and then adds diff --git a/pkg/commands/bttv.go b/internal/commands/bttv.go similarity index 84% rename from pkg/commands/bttv.go rename to internal/commands/bttv.go index 51ca2b4..1247fca 100644 --- a/pkg/commands/bttv.go +++ b/internal/commands/bttv.go @@ -4,7 +4,7 @@ import ( "fmt" "github.com/gempir/go-twitch-irc/v3" - "github.com/lyx0/nourybot/pkg/common" + "github.com/lyx0/nourybot/internal/common" ) func Bttv(target, query string, tc *twitch.Client) { diff --git a/pkg/commands/bttvemotes.go b/internal/commands/bttvemotes.go similarity index 76% rename from pkg/commands/bttvemotes.go rename to internal/commands/bttvemotes.go index 9962dd5..0534545 100644 --- a/pkg/commands/bttvemotes.go +++ b/internal/commands/bttvemotes.go @@ -2,8 +2,8 @@ package commands import ( "github.com/gempir/go-twitch-irc/v3" - "github.com/lyx0/nourybot/pkg/commands/decapi" - "github.com/lyx0/nourybot/pkg/common" + "github.com/lyx0/nourybot/internal/commands/decapi" + "github.com/lyx0/nourybot/internal/common" "go.uber.org/zap" ) diff --git a/pkg/commands/coinflip.go b/internal/commands/coinflip.go similarity index 88% rename from pkg/commands/coinflip.go rename to internal/commands/coinflip.go index d7a4d32..b050741 100644 --- a/pkg/commands/coinflip.go +++ b/internal/commands/coinflip.go @@ -2,7 +2,7 @@ package commands import ( "github.com/gempir/go-twitch-irc/v3" - "github.com/lyx0/nourybot/pkg/common" + "github.com/lyx0/nourybot/internal/common" ) func Coinflip(target string, tc *twitch.Client) { diff --git a/pkg/commands/currency.go b/internal/commands/currency.go similarity index 79% rename from pkg/commands/currency.go rename to internal/commands/currency.go index 010424d..cee3464 100644 --- a/pkg/commands/currency.go +++ b/internal/commands/currency.go @@ -2,8 +2,8 @@ package commands import ( "github.com/gempir/go-twitch-irc/v3" - "github.com/lyx0/nourybot/pkg/commands/decapi" - "github.com/lyx0/nourybot/pkg/common" + "github.com/lyx0/nourybot/internal/commands/decapi" + "github.com/lyx0/nourybot/internal/common" "go.uber.org/zap" ) diff --git a/pkg/commands/decapi/bttvemotes.go b/internal/commands/decapi/bttvemotes.go similarity index 100% rename from pkg/commands/decapi/bttvemotes.go rename to internal/commands/decapi/bttvemotes.go diff --git a/pkg/commands/decapi/currency.go b/internal/commands/decapi/currency.go similarity index 100% rename from pkg/commands/decapi/currency.go rename to internal/commands/decapi/currency.go diff --git a/pkg/commands/decapi/ffzemotes.go b/internal/commands/decapi/ffzemotes.go similarity index 100% rename from pkg/commands/decapi/ffzemotes.go rename to internal/commands/decapi/ffzemotes.go diff --git a/pkg/commands/decapi/followage.go b/internal/commands/decapi/followage.go similarity index 100% rename from pkg/commands/decapi/followage.go rename to internal/commands/decapi/followage.go diff --git a/pkg/commands/decapi/tweet.go b/internal/commands/decapi/tweet.go similarity index 100% rename from pkg/commands/decapi/tweet.go rename to internal/commands/decapi/tweet.go diff --git a/pkg/commands/decapi/types.go b/internal/commands/decapi/types.go similarity index 100% rename from pkg/commands/decapi/types.go rename to internal/commands/decapi/types.go diff --git a/pkg/commands/decapi/userid.go b/internal/commands/decapi/userid.go similarity index 100% rename from pkg/commands/decapi/userid.go rename to internal/commands/decapi/userid.go diff --git a/pkg/commands/echo.go b/internal/commands/echo.go similarity index 78% rename from pkg/commands/echo.go rename to internal/commands/echo.go index f99cfe5..b8c0204 100644 --- a/pkg/commands/echo.go +++ b/internal/commands/echo.go @@ -2,7 +2,7 @@ package commands import ( "github.com/gempir/go-twitch-irc/v3" - "github.com/lyx0/nourybot/pkg/common" + "github.com/lyx0/nourybot/internal/common" ) func Echo(target, message string, tc *twitch.Client) { diff --git a/pkg/commands/ffz.go b/internal/commands/ffz.go similarity index 84% rename from pkg/commands/ffz.go rename to internal/commands/ffz.go index 8ecc994..6048a3d 100644 --- a/pkg/commands/ffz.go +++ b/internal/commands/ffz.go @@ -4,7 +4,7 @@ import ( "fmt" "github.com/gempir/go-twitch-irc/v3" - "github.com/lyx0/nourybot/pkg/common" + "github.com/lyx0/nourybot/internal/common" ) func Ffz(target, query string, tc *twitch.Client) { diff --git a/pkg/commands/ffzemotes.go b/internal/commands/ffzemotes.go similarity index 75% rename from pkg/commands/ffzemotes.go rename to internal/commands/ffzemotes.go index 349a5df..dd1052e 100644 --- a/pkg/commands/ffzemotes.go +++ b/internal/commands/ffzemotes.go @@ -2,8 +2,8 @@ package commands import ( "github.com/gempir/go-twitch-irc/v3" - "github.com/lyx0/nourybot/pkg/commands/decapi" - "github.com/lyx0/nourybot/pkg/common" + "github.com/lyx0/nourybot/internal/commands/decapi" + "github.com/lyx0/nourybot/internal/common" "go.uber.org/zap" ) diff --git a/pkg/commands/firstline.go b/internal/commands/firstline.go similarity index 77% rename from pkg/commands/firstline.go rename to internal/commands/firstline.go index 7898dbc..ca4fe55 100644 --- a/pkg/commands/firstline.go +++ b/internal/commands/firstline.go @@ -4,8 +4,8 @@ import ( "fmt" "github.com/gempir/go-twitch-irc/v3" - "github.com/lyx0/nourybot/pkg/commands/ivr" - "github.com/lyx0/nourybot/pkg/common" + "github.com/lyx0/nourybot/internal/commands/ivr" + "github.com/lyx0/nourybot/internal/common" ) func FirstLine(target, channel, username string, tc *twitch.Client) { diff --git a/pkg/commands/followage.go b/internal/commands/followage.go similarity index 78% rename from pkg/commands/followage.go rename to internal/commands/followage.go index 694fcdf..70f2bee 100644 --- a/pkg/commands/followage.go +++ b/internal/commands/followage.go @@ -2,8 +2,8 @@ package commands import ( "github.com/gempir/go-twitch-irc/v3" - "github.com/lyx0/nourybot/pkg/commands/decapi" - "github.com/lyx0/nourybot/pkg/common" + "github.com/lyx0/nourybot/internal/commands/decapi" + "github.com/lyx0/nourybot/internal/common" "go.uber.org/zap" ) diff --git a/pkg/commands/ivr/firstline.go b/internal/commands/ivr/firstline.go similarity index 100% rename from pkg/commands/ivr/firstline.go rename to internal/commands/ivr/firstline.go diff --git a/pkg/commands/ivr/randomquote.go b/internal/commands/ivr/randomquote.go similarity index 100% rename from pkg/commands/ivr/randomquote.go rename to internal/commands/ivr/randomquote.go diff --git a/pkg/commands/ping.go b/internal/commands/ping.go similarity index 79% rename from pkg/commands/ping.go rename to internal/commands/ping.go index 6df60d8..4bc8a74 100644 --- a/pkg/commands/ping.go +++ b/internal/commands/ping.go @@ -4,8 +4,8 @@ import ( "fmt" "github.com/gempir/go-twitch-irc/v3" - "github.com/lyx0/nourybot/pkg/common" - "github.com/lyx0/nourybot/pkg/humanize" + "github.com/lyx0/nourybot/internal/common" + "github.com/lyx0/nourybot/internal/humanize" ) func Ping(target string, tc *twitch.Client) { diff --git a/pkg/commands/preview.go b/internal/commands/preview.go similarity index 90% rename from pkg/commands/preview.go rename to internal/commands/preview.go index 13c3055..c72167b 100644 --- a/pkg/commands/preview.go +++ b/internal/commands/preview.go @@ -4,7 +4,7 @@ import ( "fmt" "github.com/gempir/go-twitch-irc/v3" - "github.com/lyx0/nourybot/pkg/common" + "github.com/lyx0/nourybot/internal/common" ) func Preview(target, channel string, tc *twitch.Client) { diff --git a/pkg/commands/seventv.go b/internal/commands/seventv.go similarity index 84% rename from pkg/commands/seventv.go rename to internal/commands/seventv.go index f984e9b..8d01f7f 100644 --- a/pkg/commands/seventv.go +++ b/internal/commands/seventv.go @@ -4,7 +4,7 @@ import ( "fmt" "github.com/gempir/go-twitch-irc/v3" - "github.com/lyx0/nourybot/pkg/common" + "github.com/lyx0/nourybot/internal/common" ) func Seventv(target, emote string, tc *twitch.Client) { diff --git a/pkg/commands/tweet.go b/internal/commands/tweet.go similarity index 76% rename from pkg/commands/tweet.go rename to internal/commands/tweet.go index b2d9912..59379d9 100644 --- a/pkg/commands/tweet.go +++ b/internal/commands/tweet.go @@ -2,8 +2,8 @@ package commands import ( "github.com/gempir/go-twitch-irc/v3" - "github.com/lyx0/nourybot/pkg/commands/decapi" - "github.com/lyx0/nourybot/pkg/common" + "github.com/lyx0/nourybot/internal/commands/decapi" + "github.com/lyx0/nourybot/internal/common" "go.uber.org/zap" ) diff --git a/pkg/commands/weather.go b/internal/commands/weather.go similarity index 97% rename from pkg/commands/weather.go rename to internal/commands/weather.go index 934630a..5c1482a 100644 --- a/pkg/commands/weather.go +++ b/internal/commands/weather.go @@ -7,7 +7,7 @@ import ( owm "github.com/briandowns/openweathermap" "github.com/gempir/go-twitch-irc/v3" "github.com/joho/godotenv" - "github.com/lyx0/nourybot/pkg/common" + "github.com/lyx0/nourybot/internal/common" "go.uber.org/zap" ) diff --git a/pkg/commands/xkcd.go b/internal/commands/xkcd.go similarity index 96% rename from pkg/commands/xkcd.go rename to internal/commands/xkcd.go index 69d99cf..ae32071 100644 --- a/pkg/commands/xkcd.go +++ b/internal/commands/xkcd.go @@ -7,7 +7,7 @@ import ( "net/http" "github.com/gempir/go-twitch-irc/v3" - "github.com/lyx0/nourybot/pkg/common" + "github.com/lyx0/nourybot/internal/common" "go.uber.org/zap" ) diff --git a/pkg/common/counter.go b/internal/common/counter.go similarity index 100% rename from pkg/common/counter.go rename to internal/common/counter.go diff --git a/pkg/common/privs.go b/internal/common/privs.go similarity index 100% rename from pkg/common/privs.go rename to internal/common/privs.go diff --git a/pkg/common/random.go b/internal/common/random.go similarity index 100% rename from pkg/common/random.go rename to internal/common/random.go diff --git a/pkg/common/send.go b/internal/common/send.go similarity index 100% rename from pkg/common/send.go rename to internal/common/send.go diff --git a/pkg/common/uptime.go b/internal/common/uptime.go similarity index 100% rename from pkg/common/uptime.go rename to internal/common/uptime.go diff --git a/pkg/humanize/time.go b/internal/humanize/time.go similarity index 100% rename from pkg/humanize/time.go rename to internal/humanize/time.go