From d84728646917705e8b5adfd0fc384481278e4c04 Mon Sep 17 00:00:00 2001 From: lyx0 <66651385+lyx0@users.noreply.github.com> Date: Sat, 6 Nov 2021 21:29:34 +0100 Subject: [PATCH] move personal commands into own directory --- pkg/commands/{ => personal}/farm.go | 2 +- pkg/commands/{ => personal}/justinfan.go | 2 +- pkg/commands/{ => personal}/rave.go | 2 +- pkg/commands/{ => personal}/streamlink.go | 2 +- pkg/commands/{ => personal}/xset.go | 2 +- pkg/handlers/command.go | 23 ++++++++++++++++------- 6 files changed, 21 insertions(+), 12 deletions(-) rename pkg/commands/{ => personal}/farm.go (94%) rename pkg/commands/{ => personal}/justinfan.go (88%) rename pkg/commands/{ => personal}/rave.go (94%) rename pkg/commands/{ => personal}/streamlink.go (93%) rename pkg/commands/{ => personal}/xset.go (89%) diff --git a/pkg/commands/farm.go b/pkg/commands/personal/farm.go similarity index 94% rename from pkg/commands/farm.go rename to pkg/commands/personal/farm.go index 3432800..578e8df 100644 --- a/pkg/commands/farm.go +++ b/pkg/commands/personal/farm.go @@ -1,4 +1,4 @@ -package commands +package personal import "github.com/lyx0/nourybot/cmd/bot" diff --git a/pkg/commands/justinfan.go b/pkg/commands/personal/justinfan.go similarity index 88% rename from pkg/commands/justinfan.go rename to pkg/commands/personal/justinfan.go index ecff996..8415a9c 100644 --- a/pkg/commands/justinfan.go +++ b/pkg/commands/personal/justinfan.go @@ -1,4 +1,4 @@ -package commands +package personal import "github.com/lyx0/nourybot/cmd/bot" diff --git a/pkg/commands/rave.go b/pkg/commands/personal/rave.go similarity index 94% rename from pkg/commands/rave.go rename to pkg/commands/personal/rave.go index 77b4491..1cf5d96 100644 --- a/pkg/commands/rave.go +++ b/pkg/commands/personal/rave.go @@ -1,4 +1,4 @@ -package commands +package personal import "github.com/lyx0/nourybot/cmd/bot" diff --git a/pkg/commands/streamlink.go b/pkg/commands/personal/streamlink.go similarity index 93% rename from pkg/commands/streamlink.go rename to pkg/commands/personal/streamlink.go index 2c2ffd0..c5122b2 100644 --- a/pkg/commands/streamlink.go +++ b/pkg/commands/personal/streamlink.go @@ -1,4 +1,4 @@ -package commands +package personal import "github.com/lyx0/nourybot/cmd/bot" diff --git a/pkg/commands/xset.go b/pkg/commands/personal/xset.go similarity index 89% rename from pkg/commands/xset.go rename to pkg/commands/personal/xset.go index b1f9d58..4a89fff 100644 --- a/pkg/commands/xset.go +++ b/pkg/commands/personal/xset.go @@ -1,4 +1,4 @@ -package commands +package personal import "github.com/lyx0/nourybot/cmd/bot" diff --git a/pkg/handlers/command.go b/pkg/handlers/command.go index 8a451ba..dfe7f44 100644 --- a/pkg/handlers/command.go +++ b/pkg/handlers/command.go @@ -6,6 +6,7 @@ import ( "github.com/gempir/go-twitch-irc/v2" "github.com/lyx0/nourybot/cmd/bot" "github.com/lyx0/nourybot/pkg/commands" + "github.com/lyx0/nourybot/pkg/commands/personal" "github.com/lyx0/nourybot/pkg/db" "github.com/lyx0/nourybot/pkg/utils" ) @@ -475,7 +476,7 @@ func Command(message twitch.PrivateMessage, nb *bot.Bot) { // remember from here on. case "farm": if target == "nouryqt" || target == "nourybot" { - commands.Farm(target, nb) + personal.Farm(target, nb) return } else { return @@ -483,7 +484,7 @@ func Command(message twitch.PrivateMessage, nb *bot.Bot) { case "justinfan": if target == "nouryqt" || target == "nourybot" { - commands.Justinfan(target, nb) + personal.Justinfan(target, nb) return } else { return @@ -491,7 +492,7 @@ func Command(message twitch.PrivateMessage, nb *bot.Bot) { case "farming": if target == "nouryqt" || target == "nourybot" { - commands.Farm(target, nb) + personal.Farm(target, nb) return } else { return @@ -499,7 +500,15 @@ func Command(message twitch.PrivateMessage, nb *bot.Bot) { case "rave": if target == "nouryqt" || target == "nourybot" { - commands.Rave(target, nb) + personal.Rave(target, nb) + return + } else { + return + } + + case "repeat": + if target == "nouryqt" || target == "nourybot" { + personal.Xset(target, nb) return } else { return @@ -507,7 +516,7 @@ func Command(message twitch.PrivateMessage, nb *bot.Bot) { case "streamlink": if target == "nouryqt" || target == "nourybot" { - commands.Streamlink(target, nb) + personal.Streamlink(target, nb) return } else { return @@ -515,7 +524,7 @@ func Command(message twitch.PrivateMessage, nb *bot.Bot) { case "streamlinkconfig": if target == "nouryqt" || target == "nourybot" { - commands.Streamlink(target, nb) + personal.Streamlink(target, nb) return } else { return @@ -523,7 +532,7 @@ func Command(message twitch.PrivateMessage, nb *bot.Bot) { case "xset": if target == "nouryqt" || target == "nourybot" { - commands.Xset(target, nb) + personal.Xset(target, nb) return } else { return